Tyler Ives
Tyler Ives

Reputation: 31

Errno 13: Permission denied: 'celerybeat-schedule' with Celery running on AWS ECS and SQS

I have a separate Celery Beat and Work service running in ECS. The worker appears to be connecting to SQS fine. The Beat on the other hand is giving me trouble. I used these instructions as a template for what I am doing.

https://dev.to/daiquiri_team/deploying-django-application-on-aws-with-terraform-setting-up-celery-and-sqs-38ik

I deviated a little bit because I already had an existing Terraform/Django project running within AWS. The Django project is also on ECS.

I am having difficulty knowing what to be looking for because the error is rather vague. Why would the schedule create a Permissions denied? Is the Beat trying to write to SQS? I currently have 4 queues.

I am executing the command below from the container definition:

celery -A backend beat

I also am running the following in my container definition because I read that ECS is always run as root.

{"name": "C_FORCE_ROOT", "value": "true"}

Upvotes: 1

Views: 871

Answers (1)

tsah345
tsah345

Reputation: 1

According to the official Celery Beat documentation (under the Starting the Scheduler section):

Beat needs to store the last run times of the tasks in a local database file (named celerybeat-schedule by default), so it needs access to write in the current directory, or alternatively you can specify a custom location for this file:

celery -A proj beat -s /home/celery/var/run/celerybeat-schedule

So I think you just need to provide a path to which the container can write the file via the -s flag.

Upvotes: 0

Related Questions