Puncte:0

Failed to start Celery Service

drapel us

I am trying to daemonize celery on Linux. And after ironing out a lot of errors and reading through tons of configuration. I am unable to run Celery. I am running Ubuntu 20.04 and Celery 5.2+. Following is the error I get:

● celery.service - Celery Service
     Loaded: loaded (/etc/systemd/system/celery.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2022-01-01 22:16:17 UTC; 22s ago
    Process: 15402 ExecStart=/usr/local/bin/pipenv run celery multi start ${CELERYD_NODES} -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} --logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD>
    Process: 15409 ExecStop=/usr/local/bin/pipenv run celery ${CELERY_BIN} multi stopwait ${CELERYD_NODES} --pidfile=${CELERYD_PID_FILE} (code=exited, status=2)

Jan 01 22:16:16 ip-172-31-37-240 pipenv[15409]:   warnings.warn(
Jan 01 22:16:16 ip-172-31-37-240 pipenv[15409]: /usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.23ubuntu1 is an invalid version and will not be supported>
Jan 01 22:16:16 ip-172-31-37-240 pipenv[15409]:   warnings.warn(
Jan 01 22:16:16 ip-172-31-37-240 pipenv[15409]: Loading .env environment variables...
Jan 01 22:16:17 ip-172-31-37-240 pipenv[15409]: Usage: celery [OPTIONS] COMMAND [ARGS]...
Jan 01 22:16:17 ip-172-31-37-240 pipenv[15409]: Try 'celery --help' for help.
Jan 01 22:16:17 ip-172-31-37-240 pipenv[15409]: Error: No such command '/usr/local/bin/celery'.
Jan 01 22:16:17 ip-172-31-37-240 systemd[1]: celery.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Jan 01 22:16:17 ip-172-31-37-240 systemd[1]: celery.service: Failed with result 'exit-code'.
Jan 01 22:16:17 ip-172-31-37-240 systemd[1]: Failed to start Celery Service.

I am a terminal noob but to my understanding when I cd /usr/local/bin/ and then ls -a. I get the following file structure.

.  ..  autopep8  celery  django-admin  gunicorn  markdown_py  pipenv  pipenv-resolver  pycodestyle  sqlformat  virtualenv  virtualenv-clone
#celery.service

[Unit]
Description=Celery Service
After=network.target

[Service]
Type=forking
User=celery
Group=celery

EnvironmentFile=/etc/default/celeryd
WorkingDirectory=/home/ubuntu/project/Instagram-Clone-Backend
ExecStart=/usr/local/bin/pipenv run celery multi start ${CELERYD_NODES} \
  -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
  --logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}
ExecStop=/usr/local/bin/pipenv run celery ${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
  --pidfile=${CELERYD_PID_FILE}
ExecReload=/usr/local/bin/pipenv run celery ${CELERY_BIN} multi restart ${CELERYD_NODES} \
  -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
  --logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}

[Install]
WantedBy=multi-user.target
#/etc/default/celeryd

 # Names of nodes to start
 #   most people will only start one node:
 CELERYD_NODES="worker1"
 #   but you can also start multiple and configure settings
 #   for each in CELERYD_OPTS
 #CELERYD_NODES="worker1 worker2 worker3"
 #   alternatively, you can specify the number of nodes to start:
 #CELERYD_NODES=10

 # Absolute or relative path to the 'celery' command:
 #CELERY_BIN="/usr/local/bin/celery"
 #CELERY_BIN="/virtualenvs/def/bin/celery"
 CELERY_BIN="/usr/local/bin/celery"

 # App instance to use
 # comment out this line if you don't use an app
 CELERY_APP="instagram.celery"
 # or fully qualified:
#  CELERY_APP="authentication.tasks:app"

 # Where to chdir at start.
 CELERYD_CHDIR="/home/ubuntu/project/Instagram-Clone-Backend"

 # Extra command-line arguments to the worker
 CELERYD_OPTS="--time-limit=300 --concurrency=8"
 # Configure node-specific settings by appending node name to arguments:
 #CELERYD_OPTS="--time-limit=300 -c 8 -c:worker2 4 -c:worker3 2 -Ofair:worker1"

 # Set logging level to DEBUG
 #CELERYD_LOG_LEVEL="DEBUG"

 # %n will be replaced with the first part of the nodename.
 CELERYD_LOG_FILE="/var/log/celery/%n%I.log"
 CELERYD_PID_FILE="/var/run/celery/%n.pid"

 # Workers should run as an unprivileged user.
 #   You need to create this user manually (or you can choose
 #   a user/group combination that already exists (e.g., nobody).
 CELERYD_USER="celery"
 CELERYD_GROUP="celery"

 # If enabled pid and log directories will be created if missing,
 # and owned by the userid/group configured.
 CELERY_CREATE_DIRS=1

drapel in
Cum ai instalat `telina`? `pipenv` va ști despre asta doar dacă ați folosit pip-ul oferit de pipenv pentru a-l instala
GuruRandapa avatar
drapel us
@matigo Vă mulțumim pentru răspuns... Problema este rezolvată acum. Tocmai am scris propriile mele ExecStart și ExecStop. Mi-am dat seama că acestea sunt doar comenzi pe care le folosesc demonii, cum ar fi `sudo service celery start`, vor folosi ExecStart, așa că doar am scris ceea ce scriu în mod normal pentru a porni țelina. `pipenv run telina -Un lucrător instagram.celery -l INFO` și funcționează ca un farmec.

Postează un răspuns

Majoritatea oamenilor nu înțeleg că a pune multe întrebări deblochează învățarea și îmbunătățește legătura interpersonală. În studiile lui Alison, de exemplu, deși oamenii își puteau aminti cu exactitate câte întrebări au fost puse în conversațiile lor, ei nu au intuit legătura dintre întrebări și apreciere. În patru studii, în care participanții au fost implicați în conversații ei înșiși sau au citit transcrieri ale conversațiilor altora, oamenii au avut tendința să nu realizeze că întrebarea ar influența – sau ar fi influențat – nivelul de prietenie dintre conversatori.