#5215 Reorder celery arguments (and s/info/INFO/)
Merged 2 years ago by ngompa. Opened 2 years ago by sergiodj.
sergiodj/pagure reorder-celery-args  into  master

@@ -4,7 +4,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=celery -A pagure.lib.tasks worker --loglevel=info -c 1 -Q authorized_keys_queue

+ ExecStart=celery -A pagure.lib.tasks worker --loglevel=INFO -c 1 -Q authorized_keys_queue

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  Restart=on-failure

@@ -5,7 +5,7 @@ 

  

  [Service]

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

- ExecStart=celery -A pagure.lib.tasks worker --loglevel=info -Q pagure_ci

+ ExecStart=celery -A pagure.lib.tasks worker --loglevel=INFO -Q pagure_ci

  Type=simple

  User=git

  Group=git

@@ -5,7 +5,7 @@ 

  

  [Service]

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

- ExecStart=celery -A pagure.lib.tasks worker --loglevel=info -Q pagure_webhook

+ ExecStart=celery -A pagure.lib.tasks worker --loglevel=INFO -Q pagure_webhook

  Type=simple

  User=git

  Group=git

@@ -5,7 +5,7 @@ 

  

  [Service]

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

- ExecStart=celery -A pagure.lib.tasks worker --loglevel=info

+ ExecStart=celery -A pagure.lib.tasks worker --loglevel=INFO

  Type=simple

  User=git

  Group=git

file modified
+1 -1
@@ -6,7 +6,7 @@ 

  RUN mkdir /code

  WORKDIR /code

  

- ENTRYPOINT ["/usr/bin/celery-3", "-A", "pagure.lib.tasks_services", "worker", "--loglevel", "info", "-Q", "pagure_logcom"]

+ ENTRYPOINT ["/usr/bin/celery-3", "-A", "pagure.lib.tasks_services", "worker", "--loglevel", "INFO", "-Q", "pagure_logcom"]

  

  # Code injection is last to make optimal use of caches

  VOLUME ["/code"]

file modified
+1 -1
@@ -6,7 +6,7 @@ 

  RUN mkdir /code

  WORKDIR /code

  

- ENTRYPOINT ["/usr/bin/celery-3", "-A", "pagure.lib.tasks", "worker", "--loglevel", "info"]

+ ENTRYPOINT ["/usr/bin/celery-3", "-A", "pagure.lib.tasks", "worker", "--loglevel", "INFO"]

  

  # Code injection is last to make optimal use of caches

  VOLUME ["/code"]

@@ -4,7 +4,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info -c 1 -Q authorized_keys_queue

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks worker --loglevel=infINFO -c 1 -Q authorized_keys_queue

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

file modified
+1 -1
@@ -8,7 +8,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks_services --loglevel=info -Q pagure_ci

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks_services worker --loglevel=INFO -Q pagure_ci

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

@@ -4,7 +4,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info -c 1 -Q gitolite_queue

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks worker --loglevel=INFO -c 1 -Q gitolite_queue

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

@@ -8,7 +8,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks_services --loglevel=info -Q pagure_loadjson

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks_services worker --loglevel=INFO -Q pagure_loadjson

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

file modified
+1 -1
@@ -8,7 +8,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks_services --loglevel=info -Q pagure_logcom

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks_services worker --loglevel=INFO -Q pagure_logcom

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

file modified
+1 -1
@@ -13,7 +13,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks_mirror --loglevel=info -Q pagure_mirror

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks_mirror worker --loglevel=INFO -Q pagure_mirror

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=mirror

file modified
+1 -1
@@ -8,7 +8,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks_services --loglevel=info -Q pagure_webhook

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks_services worker --loglevel=INFO -Q pagure_webhook

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

file modified
+1 -1
@@ -4,7 +4,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks worker --loglevel=INFO

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

@@ -10,7 +10,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info -Q <queue_name>

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks worker --loglevel=INFO -Q <queue_name>

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

file modified
+1 -1
@@ -53,7 +53,7 @@ 

          config = os.path.join(here, config)

      env["PAGURE_CONFIG"] = config

  

- cmd = [sys.executable, "-m", "celery", "worker", "-A", args.tasks]

+ cmd = [sys.executable, "-m", "celery", "-A", "worker", args.tasks]

  

  if args.queue:

      cmd.extend(["-Q", args.queue])

After upgrading my server to Debian bullseye, I noticed that some of
the pagure systemd services were not properly starting anymore.
celery was complaining that it didn't recognize the "-A" argument in
the "celery worker" command.

A quick web search told me that the "-A" argument must be passed right
after the "celery" command. After doing that, celery was now
complaining that it didn't recognize "info" as a proper loglevel.
After reading the error message, I noticed that it did have an
INFO (all caps) loglevel, so after uppercasing the word celery finally
started.

I'm not entirely sure when celery started being more pedantic about
its arguments (the same systemd unit was working with buster's
celery), but I think it's a good idea to reflect the needed changes
upstream so that others are not bit by this issue.

Pull-Request has been merged by ngompa

2 years ago