Skip to content

TypeError in elasticapm.context.contextvars #2056

@jahendry

Description

@jahendry

I'm getting an unhandled TypeError from the set span method of the elasticapm.context.contextvars.ContextVar here

The spans variable is of type None and is throwing an unhandled exception.

I have been unable to find the root causes on this as it is happening in production sporadically without a clear way to reproduce it.

We are running this within a django/celery app with the following version numbers

django: 3.2.24
celery: 5.3.6
apm-agent-python: 6.20.0

Could we possibly add some type guards within this method or exception handling for this case?

Thanks,
Jamie

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions