question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Got 'DatabaseTrace' object has no attribute 'sql_format' error

See original GitHub issue

Got ‘DatabaseTrace’ object has no attribute ‘sql_format’ error

I’m using 7.10.0.175 with PostgreSQL

newrelic/api/database_trace.py in create_node at line 231

            start_time=self.start_time,
            end_time=self.end_time,
            duration=self.duration,
            exclusive=self.exclusive,
            stack_trace=self.stack_trace,
            sql_format=self.sql_format,
            connect_params=self.connect_params,
            cursor_params=self.cursor_params,
            sql_parameters=self.sql_parameters,
            execute_params=self.execute_params,
            host=self.host,

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
daveisferacommented, Sep 13, 2022

This is still happening with 8.1.0.180. Here’s the traceback:

Traceback (most recent call last):
  File "/usr/src/venv/lib/python3.9/site-packages/asgiref/sync.py", line 472, in thread_handler
    raise exc_info[1]
  File "/usr/src/venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 38, in inner
    response = await get_response(request)
  File "/usr/src/venv/lib/python3.9/site-packages/django/utils/deprecation.py", line 129, in __acall__
    response = await sync_to_async(
  File "/usr/src/venv/lib/python3.9/site-packages/asgiref/sync.py", line 435, in __call__
    ret = await asyncio.wait_for(future, timeout=None)
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 442, in wait_for
    return await fut
  File "/usr/src/venv/lib/python3.9/site-packages/asgiref/current_thread_executor.py", line 22, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/venv/lib/python3.9/site-packages/newrelic/hooks/adapter_asgiref.py", line 27, in thread_handler_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/src/venv/lib/python3.9/site-packages/asgiref/sync.py", line 476, in thread_handler
    return func(*args, **kwargs)
  File "/usr/src/app/apps/account/middleware.py", line 27, in process_request
    account = Account.objects.get(user=request.user)
  File "/usr/src/venv/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/src/venv/lib/python3.9/site-packages/django/db/models/query.py", line 431, in get
    num = len(clone)
  File "/usr/src/venv/lib/python3.9/site-packages/django/db/models/query.py", line 262, in __len__
    self._fetch_all()
  File "/usr/src/venv/lib/python3.9/site-packages/django/db/models/query.py", line 1324, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/src/venv/lib/python3.9/site-packages/django/db/models/query.py", line 51, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/usr/src/venv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
    cursor.execute(sql, params)
  File "/usr/src/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/usr/src/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/src/venv/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/src/venv/lib/python3.9/site-packages/newrelic/hooks/database_psycopg2.py", line 64, in execute
    return super(CursorWrapper, self).execute(sql, parameters, *args,
  File "/usr/src/venv/lib/python3.9/site-packages/newrelic/hooks/database_dbapi2.py", line 37, in execute
    return self.__wrapped__.execute(sql, parameters,
  File "/usr/src/venv/lib/python3.9/site-packages/newrelic/api/time_trace.py", line 186, in __exit__
    self._complete_trace()
  File "/usr/src/venv/lib/python3.9/site-packages/newrelic/api/time_trace.py", line 494, in _complete_trace
    node = self.create_node()
  File "/usr/src/venv/lib/python3.9/site-packages/newrelic/api/database_trace.py", line 232, in create_node
    sql_format=self.sql_format,
AttributeError: 'DatabaseTrace' object has no attribute 'sql_format'
0reactions
daveisferacommented, Sep 7, 2022

Thanks for fixing this! Is there an ETA for a release that will include this fix?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django with MSSQL giving error :'DatabaseWrapper' object ...
After that I tried to open Admin panal using http:// 127.0.0.1:8000/admin it gives error. ERROR 'DatabaseWrapper' object has no attribute ...
Read more >
SQL Lab - 'dict' object has no attribute 'set' · Issue #20838 · ...
When I am in SQL Lab and run some SQLs against a test Postgres Database, I got dict object has no attribute set...
Read more >
AttributeError: type object 'Query' has no attribute 'from_json'
AttributeError : type object 'Query' has no attribute 'from_json' ... I tried to edit page's content and click publish but got internal server...
Read more >
'AttributeError: 'str' object has no attribute 'decode'' 1603 ...
This issue "AttributeError: 'str' object has no attribute 'decode'" 1603 error while upgrading vCenter Server 6.7 with a SQL database and ...
Read more >
'DeltaTable' object has no attribute 'clone'
I have the following error : AttributeError: 'DeltaTable' object has no attribute 'clone' ... Anyhow, the only way to get it working is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found