mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 17:31:34 -05:00
This was added in Celery 4 [1]. and appears to be incompatible with our approach of injecting "request_id" into task arguments (example exception below). Although our other apps are on Celery 5 our logs don't show any similar issues, probably because all their tasks are invoked without request IDs. In the longterm we should decide if we want to enable argument checking and fix the tracing approach, or stop tracing request IDs in Celery tasks. [1]: https://docs.celeryproject.org/en/stable/userguide/tasks.html#argument-checking 2021-11-01T11:37:36 delivery delivery ERROR None "RETRY: Email notification f69a9305-686f-42eb-a2ee-61bc2ba1f5f3 failed" [in /Users/benthorner/Documents/Projects/api/app/celery/provider_tasks.py:68] Traceback (most recent call last): File "/Users/benthorner/Documents/Projects/api/app/celery/provider_tasks.py", line 53, in deliver_email raise TypeError("test retry") TypeError: test retry [2021-11-01 11:37:36,385: ERROR/ForkPoolWorker-1] RETRY: Email notification f69a9305-686f-42eb-a2ee-61bc2ba1f5f3 failed Traceback (most recent call last): File "/Users/benthorner/Documents/Projects/api/app/celery/provider_tasks.py", line 53, in deliver_email raise TypeError("test retry") TypeError: test retry [2021-11-01 11:37:36,394: WARNING/ForkPoolWorker-1] Task deliver_email[449cd221-173c-4e18-83ac-229e88c029a5] reject requeue=False: deliver_email() got an unexpected keyword argument 'request_id' Traceback (most recent call last): File "/Users/benthorner/Documents/Projects/api/app/celery/provider_tasks.py", line 53, in deliver_email raise TypeError("test retry") TypeError: test retry During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/benthorner/.pyenv/versions/notifications-api/lib/python3.6/site-packages/celery/app/task.py", line 731, in retry S.apply_async() File "/Users/benthorner/.pyenv/versions/notifications-api/lib/python3.6/site-packages/celery/canvas.py", line 219, in apply_async return _apply(args, kwargs, **options) File "/Users/benthorner/.pyenv/versions/notifications-api/lib/python3.6/site-packages/celery/app/task.py", line 537, in apply_async check_arguments(*(args or ()), **(kwargs or {})) TypeError: deliver_email() got an unexpected keyword argument 'request_id' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/benthorner/.pyenv/versions/notifications-api/lib/python3.6/site-packages/celery/app/trace.py", line 450, in trace_task R = retval = fun(*args, **kwargs) File "/Users/benthorner/Documents/Projects/api/app/celery/celery.py", line 74, in __call__ return super().__call__(*args, **kwargs) File "/Users/benthorner/.pyenv/versions/notifications-api/lib/python3.6/site-packages/celery/app/trace.py", line 731, in __protected_call__ return self.run(*args, **kwargs) File "/Users/benthorner/Documents/Projects/api/app/celery/provider_tasks.py", line 71, in deliver_email self.retry(queue=QueueNames.RETRY) File "/Users/benthorner/.pyenv/versions/notifications-api/lib/python3.6/site-packages/celery/app/task.py", line 733, in retry raise Reject(exc, requeue=False) celery.exceptions.Reject: (TypeError("deliver_email() got an unexpected keyword argument 'request_id'",), False)