Skip to content

Huey integration fails with chords and groups聽#6310

Description

@niklas-chimney

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.47.0

Steps to Reproduce

  1. Create a consumer that uses Huey 3 and the Sentry Python SDK with default configuration.
  2. Create a huey group:

task_group = huey.group([one_task, another_task])

  1. Enqueue the group.

huey.enqueue(task_group)

  1. Huey integration raises an exception.

File "/app/.venv/lib/python3.13/site-packages/sentry_sdk/integrations/huey.py", line 62, in _sentry_enqueue
name=task.name,
^^^^^^^^^
AttributeError: 'chord' object has no attribute 'name'

  1. Looking at https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/huey.py#L60 a span is created which assumes enqueue is called only with tasks, as it expects a name attribute. This is not true for chord and group.
with sentry_sdk.start_span(
            op=OP.QUEUE_SUBMIT_HUEY,
            name=task.name,
            origin=HueyIntegration.origin,
        ):

Expected Result

The Huey integration should support group and chord, and not explode. 馃槃 The error in sentry also obscures the fact that the exception is actually inside the sentry sdk, and not in user code.

Actual Result

File "/app/.venv/lib/python3.13/site-packages/sentry_sdk/integrations/huey.py", line 62, in _sentry_enqueue
name=task.name,
^^^^^^^^^
AttributeError: 'chord' object has no attribute 'name'

Metadata

Metadata

Assignees

Labels

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions