Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied: '/code/celerybeat.pid'

I can't run Celery beat using Docker.

celerybeat_1    | celery.platforms.LockFailed: [Errno 13] Permission 
denied: '/code/celerybeat.pid'

docker service:

celerybeat:
 <<: *django
 depends_on:
  - postgres
  - redis
 command: /start-celerybeat.sh

start-celerybeat.sh

#!/bin/sh

set -o errexit
set -o nounset

celery -A my_project.taskapp beat -l info --loglevel=debug --scheduler django_celery_beat.schedulers:DatabaseScheduler

How can I fix that?

like image 348
paul Avatar asked Dec 13 '22 13:12

paul


1 Answers

Delete that file. Then, modify the last line of start-celerybeat.sh, adding --pidfile /tmp/celerybeat.pid to the end

like image 200
Shinra tensei Avatar answered Jan 01 '23 18:01

Shinra tensei