novacode-nl / odoo-celery

Odoo & Celery integration
GNU Lesser General Public License v3.0
42 stars 45 forks source link

KeyError: 'max_retries' #15

Closed PauliusP17 closed 5 years ago

PauliusP17 commented 5 years ago

I was testing the newly added retry parameter features and this Error came in the celery process log AS the task was going into its first retry:

[2019-06-12 11:08:50,121: INFO/ForkPoolWorker-4] odoo.addons.celery.odoo.call_task[cfa4c838-2eb6-41ae-a369-1371370dc714]: Retry task... Failure in Odoo 12_wings (task: 3c473865-4b6b-4293-a7f2-79a9c3d33882, model: res.partner, method: wings_update).
[2019-06-12 11:08:50,121: ERROR/ForkPoolWorker-4] odoo.addons.celery.odoo.call_task[cfa4c838-2eb6-41ae-a369-1371370dc714]: 'max_retries'
  => SUGGESTIONS: Check former XML-RPC log messages.

[2019-06-12 11:08:50,123: ERROR/ForkPoolWorker-4] Task odoo.addons.celery.odoo.call_task[cfa4c838-2eb6-41ae-a369-1371370dc714] raised unexpected: KeyError('max_retries',)
Traceback (most recent call last):
  File "/home/paulius/virtualenvs/odoo12/lib/python3.6/site-packages/celery/app/trace.py", line 385, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/paulius/virtualenvs/odoo12/lib/python3.6/site-packages/celery/app/trace.py", line 648, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/odoo12/addons-celery/celery/odoo.py", line 136, in call_task
    args = [task_uuid, 'FAILURE']
  File "/opt/odoo12/addons-celery/celery/odoo.py", line 85, in call_task
    # - retry requests * a given seconds
KeyError: 'max_retries'

Here are the parameters used when creating a the task:

 celery = {
            'countdown': 2,
            'retry': True,
            'max_retries': 4
            'retry_countdown_setting': 'MUL_RETR_SECS',
            'retry_countdown_multiply_retries_seconds': 60,
            'retry_policy': {
                'interval_start': 30
            }
        }
bobslee commented 5 years ago

Hi @PauliusP17

I can't reproduce your issue. See my related commit for my test. So I added your case (celery kwargs/config) into the celery_example module.

Please could you also test with the example module?

In case the error still occurs.. please check and let me know:

PauliusP17 commented 5 years ago

No issue here, was an error on my part, sorry.