主管没能跑芹菜

时间:2016-06-10 14:41:13

标签: python-3.x celery supervisor

我正在尝试在我的服务器上运行celery beat,但是我收到以下错误:

[2016-06-10 11:32:49,985: WARNING/MainProcess] self._index[key] = self._setval(pos, val)
[2016-06-10 11:32:49,985: WARNING/MainProcess] File "/usr/local/lib/python3.5/dbm/dumb.py", line 166, in _setval
[2016-06-10 11:32:49,985: WARNING/MainProcess] with _io.open(self._datfile, 'rb+') as f:
[2016-06-10 11:32:49,985: WARNING/MainProcess] PermissionError
[2016-06-10 11:32:49,986: WARNING/MainProcess] :
[2016-06-10 11:32:49,986: WARNING/MainProcess] [Errno 13] Permission denied: 'celerybeat-schedule.dat'
No local settings found
celery beat v3.1.23 (Cipater) is starting.
__    -    ... __   -        _
Configuration ->
    . broker -> redis://localhost:6379/0
    . loader -> celery.loaders.app.AppLoader
    . scheduler -> celery.beat.PersistentScheduler
    . db -> celerybeat-schedule
    . logfile -> [stderr]@%INFO
    . maxinterval -> now (0s)

[2016-06-10 11:35:28,814: INFO/MainProcess] beat: Starting..

我不知道为什么celerybeat-schedule.dat的权限被拒绝,因为我在配置文件中设置了用户和权限:

[program:project_celery_beat]
command=/home/project/_env/bin/celery beat -A project --loglevel=INFO --pidfile=/tmp/celerybeat-myapp.pid
directory=/home/project/project/app/
user=project
numprocs=1
stdout_logfile=/home/project/celery_beat.log
stderr_logfile=/home/project/celery_beat.log
autostart=true
autorestart=true
stopsignal=QUIT
environment=DJANGO_SETTINGS_MODULE="project.settings.sandbox":

如何解决此权限问题?

1 个答案:

答案 0 :(得分:0)

我今天遇到了这个问题。我通过以下方法解决了这个问题:

user = <An actual non-root user>

这很奇怪,因为对于芹菜,您实际上可以放入一个不存在的用户,并且效果很好。