Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks defined in workflows repository not added to task processor registry #5013

Open
sentry-io bot opened this issue Jan 17, 2025 · 1 comment
Open
Labels
api Issue related to the REST API bug Something isn't working

Comments

@sentry-io
Copy link

sentry-io bot commented Jan 17, 2025

Sentry Issue: FLAGSMITH-API-52D

KeyError: 'tasks.notify_group_of_change_request_assignment'
  File "task_processor/models.py", line 71, in callable
    return registered_tasks[self.task_identifier]

TaskProcessingError: ("No task registered with identifier '%s'. Ensure your task is decorated with @register_task_handler.", 'tasks.notify_group_of_change_request_assignment')
  File "task_processor/processor.py", line 96, in _run_task
    task.run()
  File "task_processor/models.py", line 66, in run
    return self.callable(*self.args, **self.kwargs)
  File "task_processor/models.py", line 73, in callable
    raise TaskProcessingError(

Failed to execute task 'tasks.notify_group_of_change_request_assignment'. Exception was: ("No task registered with identifier '%s'. Ensure your task is decorated with @register_task_handler.", 'tasks.notify_group_of_change_request_assignment')
@sentry-io sentry-io bot added the api Issue related to the REST API label Jan 17, 2025
@matthewelwell matthewelwell added the bug Something isn't working label Jan 17, 2025
@matthewelwell
Copy link
Contributor

I can reproduce this by doing e.g.

poetry install --with dev,workflows --no-root
LOG_LEVEL=DEBUG python manage.py runprocessor

Inspecting the debug logs as to which tasks are registered then shows that the task defined in the workflows repository here is not correctly registered.

This seems unusual considering the fact that we explicitly load the tasks module on AppConfig.ready here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant