open-formulieren / open-forms

Smart and dynamic forms
https://open-forms.readthedocs.io
Other
35 stars 27 forks source link

Sentry celery - Received unregistered task of type KeyError('openforms.submissions.tasks.cleanup_on_completion_results'). #886

Closed alextreme closed 2 years ago

alextreme commented 2 years ago

https://sentry.maykinmedia.nl/maykin-media/open-forms/issues/291000/events/0c6e0c4c89f74e878586387fa025825f/

Received unregistered task of type KeyError('openforms.submissions.tasks.cleanup_on_completion_results'). The message has been ignored and discarded.

Did you remember to import the module containing this task? Or maybe you're using relative imports?

Please see http://docs.celeryq.org/en/latest/internals/protocol.html for more information.

The full contents of the message body was: b'[[], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]' (77b)

sergei-maertens commented 2 years ago

Might be because of an import in the package __init__.py

Bartvaderkin commented 2 years ago

I think the link to the Sentry event is a mistake and should be https://sentry.maykinmedia.nl/maykin-media/open-forms/issues/291494/

alextreme commented 2 years ago

Yes you're correct Bart, sorry!

Bartvaderkin commented 2 years ago

Maybe this is caused because we re-import the tasks in the __init__.py? When I inspect the worker is has different paths then in the BEAT config, but it is only a problem for this task.

celery-tasks

Bartvaderkin commented 2 years ago

After discussion with @sergei-maertens I expanded the BeatConfigTest to check for use of full paths in the beat configuration instead of to re-imports.

See the failing build of the first commit in the PR.