Skip to content

AttributeError: 'dict' object has no attribute 'f_back' in profiler thread #1958

@adamchainz

Description

@adamchainz

How do you use Sentry?

Sentry Saas (sentry.io)

Version

1.16.0

Steps to Reproduce

Run sentry SDK with profiling on, Python 3.11

Expected Result

The thread runs fine without crashing.

Actual Result

The profiler thread (<Thread(sentry.profiler.ThreadScheduler, started daemon 140454125577984)>) fails this stack trace:

AttributeError: 'dict' object has no attribute 'f_back'
  File "threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)

Unfortunately there is no more information. It looks like the full stack trace is not captured / lost, perhaps because this is an exception within a thread?

Full screenshot from Sentry UI:

Xnapper-2023-03-15-14 21 38

It's not clear from a quick glance at the source how a dict could be ending up in the profiler thread's queue.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions