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.

Sentry Exception names only show "Traceback" instead of actual exception name

See original GitHub issue

I have Sentry set up for a Python application that we’re using internally.

The Sentry exception ticket has the following attributes:

  • Name: Traceback (most recent call last):
  • Message:
Traceback (most recent call last):
  File "/percolate/analytics/pegasus/pegasus/services/aquarius/service.py", line 28, in Query
    resp = builder.build()
  File "/percolate/analytics/pegasus/pegasus/services/aquarius/builder.py", line 235, in build
    q = self.apply_sort(q)
  File "/percolate/analytics/pegasus/pegasus/services/aquarius/builder.py", line 225, in apply_sort
    sorts = [s.apply_sort(self.selects) for s in self.sort]
  File "/percolate/analytics/pegasus/pegasus/services/aquarius/builder.py", line 225, in <listcomp>
    sorts = [s.apply_sort(self.selects) for s in self.sort]
AttributeError: 'NumericField' object has no attribute 'apply_sort'

See the following screen capture: Screen Shot 2019-05-20 at 11 48 31 AM

I see a number of exceptions in the Sentry UI with the same Traceback: ... name instead of the specific exception name. Is there a reason why this is the case?

Here’s the code that triggers these exceptions:

            try:
                query_result = q.execution_options(timeout=PEGASUS_QUERY_TIMEOUT).all()
            except Exception as e:
                if sentry_client:
                    with sentry_client.configure_scope() as scope:
                        compiled_query = q.statement.compile(
                            dialect=postgresql.dialect()
                        )
                        scope.set_extra("query", str(compiled_query))
                        scope.set_extra("params", str(compiled_query.params))
                raise e

It’s not clear if I’m using the Sentry client closing context correctly, or if this is an actual issue within the Sentry SDK. Thank you for your help in advance!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
untitakercommented, May 20, 2019

You can change it to log.error("my code failed", exc_info=True) and it should work!

1reaction
irmiller22commented, May 20, 2019

Jinx, you hit the nail on the head. Thank you again. I’ll close this ticket out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sentry not showing exception in web UI with logger.exception()
Sentry will show the exception message and stack trace from the utils logger but the app logger will ONLY log the error message...
Read more >
Capturing Errors | Sentry Documentation
Notice the unhandled exception appears in the list of issues. Unhandled Issue. Click on the issue, to open the Issue Details page. Issue...
Read more >
Event Type Definitions - Sentry Developer Documentation
This page documents the event schema for errors, just like the other ... DEPRECATED: Prefer threads or exception depending on which is more...
Read more >
Reporting Exceptions in Python Scripts with Sentry
That's where adding Sentry can solved this distributed error logging problem. In this tutorial, we'll see how to quickly add Sentry to a...
Read more >
SentryOptions class - sentry_io library - Dart API - Pub.dev
Stack traces are always attached to exceptions; however, when this option is set, ... This only applies to Dart:io platforms and only the...
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