错误:CANT_REREAD:作为路径 /home/app/logs/celery.log 一部分命名的目录不存在

Zor*_*gan 2 python django celery ubuntu-16.04

我正在学习有关如何在 Django 生产服务器上使用 Celery 的教程

当我说到这里时:

Now reread the configuration and add the new process:

    sudo supervisorctl reread
    sudo supervisorctl update 
Run Code Online (Sandbox Code Playgroud)

sudo supervisorctl reread当我在我的服务器(Ubuntu 16.04)终端中执行时,它返回以下内容:

ERROR: CANT_REREAD: 
The directory named as part of the path /home/app/logs/celery.log does not exist. 
in section 'app-celery' (file: '/etc/supervisor/conf.d/app-celery.conf')
Run Code Online (Sandbox Code Playgroud)

我已经完成了之前的所有说明,包括安装supervisor以及app-celery.conf在文件夹中创建名为 mysite-celery.conf ( ) 的文件: /etc/supervisor/conf.d

如果您好奇我的 app-celery.conf 文件如下所示:

[program:app-celery]
command=/home/app/bin/celery worker -A draft1 --loglevel=INFO
directory=/home/app/draft1
user=zorgan
numprocs=1
stdout_logfile=/home/app/logs/celery.log
stderr_logfile=/home/app/logs/celery.log
autostart=true
autorestart=true
startsecs=10

; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600

stopasgroup=true

; Set Celery priority higher than default (999)
; so, if rabbitmq is supervised, it will start first.
priority=1000
Run Code Online (Sandbox Code Playgroud)

知道问题是什么吗?

小智 6

不知何故,主管无法创建文件夹 - /home/app/logs/。您可以使用 mkdir 手动创建它并重新启动主管服务

mkdir /home/app/logs
sudo service supervisor restart
Run Code Online (Sandbox Code Playgroud)