0

I have a celery beat running under my workspace once per minute. My task is very simple:

@task()
def capturar_placas():
    print('Iniciando Captura de Placas do OpenALPR CLOUD')

But each time celery try to execute my task i got the following error:

File "/home/ronaldo.lanhellas/workspace/github/safepark/pythonvenv/lib64/python3.6/site-packages/kombu/transport/django/models.py", line 29, in Message
    queue = models.ForeignKey(Queue, related_name='messages')
celery.beat.SchedulingError: Couldn't apply scheduled task Capturar Placas: __init__() missing 1 required positional argument: 'on_delete'

Looking at "models.py" from kombu lib i noted that don't exists on_delete argument in FK, but Django 2.x require it. How can i solve that ? Update library maybe ?

Ronaldo Lanhellas
  • 2,975
  • 5
  • 46
  • 92
  • Somebody has [tried a pull request](https://github.com/celery/kombu/pull/892) to fix this issue. Your best bet is to post [your issue on github](https://github.com/celery/kombu/issues) or create a PR yourself (based on the one I just linked to). – Mathieu Dhondt Nov 21 '18 at 14:11
  • How can i create a local version of this library with this fix ? – Ronaldo Lanhellas Nov 21 '18 at 16:51
  • You can install it ([see this answer](https://stackoverflow.com/a/27134362/308204)) and then adapt the code. If you get it working, I'm sure the repository maintainers would like to see a PR from you. – Mathieu Dhondt Nov 23 '18 at 14:24

0 Answers0