添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Somehow after an update of my system gunicorn does not want to be started by supervisord. My systems python went to python 3.11 but I turned back to python 3.10 but still the same problem.

$sudo supervisorctl status
languagedetect-gunicorn          RUNNING   pid 1219, uptime 5:04:08
mayan-edms-celery-beat           RUNNING   pid 1207, uptime 5:04:08
mayan-edms-gunicorn              FATAL     can't find command '/data/mayan/44/311/bin/gunicorn --bind unix:///run/mayan/mayan.sock --env DJANGO_SETTINGS_MODULE=mayan.settings.production --limit-request-line 4094 --max-requests 300 --max -requests-jitter 50  --worker-class sync --timeout 240 --workers 3 mayan.wsgi'
mayan-edms-worker_a              RUNNING   pid 2092, uptime 5:03:28
mayan-edms-worker_b              RUNNING   pid 1209, uptime 5:04:08
mayan-edms-worker_c              RUNNING   pid 2095, uptime 5:03:27
mayan-edms-worker_d              RUNNING   pid 2093, uptime 5:03:28
pgadmin4-gunicorn                RUNNING   pid 1220, uptime 5:04:08

I have been looking in all directions but cant solve it somehow. If I go to the venv as the mayan user and start gunicorn via commandline all works.

What am I missing?

mayan.conf:

[supervisord]
environment=
    DJANGO_SETTINGS_MODULE=mayan.settings.production,
#    DJANGO_SETTINGS_MODULE=mayan.settings.developement,
    MAYAN_SETTINGS_MODULE=mayan.settings.production,
#    MAYAN_SETTINGS_MODULE=mayan.settings.development,
    ORGANIZATIONS_URL_BASE_PATH=docs,
    ORGANIZATIONS_INSTALLATION_URL=https://www.domain.com/docs,
    MAYAN_ALLOWED_HOSTS = '["*"]',
    MAYAN_MEDIA_ROOT=/data/mayan/media,
    MAYAN_PYTHON_BIN_DIR=/data/mayan/44/311/bin,
    MAYAN_GUNICORN_BIN=/data/mayan/44/311/bin/gunicorn,
    MAYAN_GUNICORN_LIMIT_REQUEST_LINE=4094,
    MAYAN_GUNICORN_MAX_REQUESTS=300,
    MAYAN_GUNICORN_REQUESTS_JITTER=50,
    MAYAN_GUNICORN_TEMPORARY_DIRECTORY="",
    MAYAN_GUNICORN_TIMEOUT=240,
    MAYAN_GUNICORN_WORKER_CLASS=sync,
    MAYAN_GUNICORN_WORKERS=3,
    MAYAN_CELERY_BROKER_URL="redis+socket:///run/redis/redis.sock?db=0",
    MAYAN_CELERY_RESULT_BACKEND="redis+socket:///run/redis/redis.sock?db=1",
    MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'*****','USER':'mayan','HOST':'/run/postgresql'}}",
    MAYAN_LOCK_MANAGER_BACKEND="mayan.apps.lock_manager.backends.redis_lock.RedisLock",
    MAYAN_LOCK_MANAGER_BACKEND_ARGUMENTS="{'redis_url':'unix:///run/redis/redis.sock?db=2'}",
    MAYAN_WORKER_A_CONCURRENCY="",
    MAYAN_WORKER_A_MAX_MEMORY_PER_CHILD="--max-memory-per-child=30000",
    MAYAN_WORKER_A_MAX_TASKS_PER_CHILD="--max-tasks-per-child=25",
    MAYAN_WORKER_B_CONCURRENCY="",
    MAYAN_WORKER_B_MAX_MEMORY_PER_CHILD="--max-memory-per-child=30000",
    MAYAN_WORKER_B_MAX_TASKS_PER_CHILD="--max-tasks-per-child=12",
    MAYAN_WORKER_C_CONCURRENCY="",
    MAYAN_WORKER_C_MAX_MEMORY_PER_CHILD="--max-memory-per-child=30000",
    MAYAN_WORKER_C_MAX_TASKS_PER_CHILD="--max-tasks-per-child=12",
    MAYAN_WORKER_D_CONCURRENCY="--concurrency=1",
    MAYAN_WORKER_D_MAX_MEMORY_PER_CHILD="--max-memory-per-child=30000",
    MAYAN_WORKER_D_MAX_TASKS_PER_CHILD="--max-tasks-per-child=3",
    STATIC_URL="static/",
    DEBUG="CRITICAL", # DEBUG | INFO | WARNING | ERROR | CRITICAL | FATAL
    _LAST_LINE=""
[program:mayan-edms-gunicorn]
autorestart = true
autostart = true
command = "%(ENV_MAYAN_PYTHON_BIN_DIR)s/gunicorn --bind unix:///run/mayan/mayan.sock --env DJANGO_SETTINGS_MODULE=%(ENV_MAYAN_SETTINGS_MODULE)s --limit-request-line %(ENV_MAYAN_GUNICORN_LIMIT_REQUEST_LINE)s --max-requests %(ENV_MAYAN_GUNICORN_MAX_REQUESTS)s --max-requests-jitter %(ENV_MAYAN_GUNICORN_REQUESTS_JITTER)s %(ENV_MAYAN_GUNICORN_TEMPORARY_DIRECTORY)s --worker-class %(ENV_MAYAN_GUNICORN_WORKER_CLASS)s --timeout %(ENV_MAYAN_GUNICORN_TIMEOUT)s --workers %(ENV_MAYAN_GUNICORN_WORKERS)s mayan.wsgi"
environment =
  DJANGO_SETTINGS_MODULE=%(ENV_MAYAN_SETTINGS_MODULE)s
redirect_stderr = true
user = mayan
stdout_logfile=/var/log/supervisor/mayan_out.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=0
stdout_capture_maxbytes=1MB
stdout_events_enabled=true
stderr_logfile=/var/log/supervisor/mayan_err.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=0
stderr_capture_maxbytes=1MB
stderr_events_enabled=true

directory structure:

drwxr-xr-x 1 root root 292 Apr 22 10:38 /
drwxr-xr-x 1 root root 590 Jun 30 23:57 /data
drwxr-xr-x 1 mayan mayan 532 Jun 16 07:07 /data/mayan
drwxr-xr-x 1 mayan mayan 12 Jun 13 11:42 /data/mayan/44
drwxr-xr-x 1 mayan mayan 66 Jun 12 16:14 /data/mayan/44/311
              

It truns out that removing the “” around the gunicorn command solved it.

command = "%(ENV_MAYAN_PYTHON_BIN_DIR)s/gunicorn --bind unix:///run/mayan/mayan.sock --env DJANGO_SETTINGS_MODULE=%(ENV_MAYAN_SETTINGS_MODULE)s --limit-request-line %(ENV_MAYAN_GUNICORN_LIMIT_REQUEST_LINE)s --max-requests %(ENV_MAYAN_GUNICORN_MAX_REQUESTS)s --max-requests-jitter %(ENV_MAYAN_GUNICORN_REQUESTS_JITTER)s %(ENV_MAYAN_GUNICORN_TEMPORARY_DIRECTORY)s --worker-class %(ENV_MAYAN_GUNICORN_WORKER_CLASS)s --timeout %(ENV_MAYAN_GUNICORN_TIMEOUT)s --workers %(ENV_MAYAN_GUNICORN_WORKERS)s mayan.wsgi"
environment =
  DJANGO_SETTINGS_MODULE=%(ENV_MAYAN_SETTINGS_MODULE)s
command = %(ENV_MAYAN_PYTHON_BIN_DIR)s/gunicorn --bind unix:///run/mayan/mayan.sock --env DJANGO_SETTINGS_MODULE=%(ENV_MAYAN_SETTINGS_MODULE)s --limit-request-line %(ENV_MAYAN_GUNICORN_LIMIT_REQUEST_LINE)s --max-requests %(ENV_MAYAN_GUNICORN_MAX_REQUESTS)s --max-requests-jitter %(ENV_MAYAN_GUNICORN_REQUESTS_JITTER)s %(ENV_MAYAN_GUNICORN_TEMPORARY_DIRECTORY)s --worker-class %(ENV_MAYAN_GUNICORN_WORKER_CLASS)s --timeout %(ENV_MAYAN_GUNICORN_TIMEOUT)s --workers %(ENV_MAYAN_GUNICORN_WORKERS)s mayan.wsgi
environment =
  DJANGO_SETTINGS_MODULE=%(ENV_MAYAN_SETTINGS_MODULE)s