[FastAPI] Cron jobs failing to run
-
I have described the bug in complete detail in the Description section. -
I have specified steps in the Reproduction section. -
I have included any logs related to the bug in the Logs section. -
I have included the versions which are affected in the Version(s) section.
Description
Cron jobs for the commands in docker/config/aurweb-cron
aren't running due to errors in the Cron file. The issue appears to be due to a missing user
argument before the bash
declaration.
Reproduction
Start a new container with the Cron file set at /etc/cron.d/aurweb-cron
, followed by running crond -nx proc
.
On a side note, I think using the -x proc
flags with crond
would be beneficial, as otherwise this error just silently goes by without notice in server logs.
Logs
Logs for the container with the -x proc
change shows the following:
log_it: (bash xxxxxx) ERROR (getpwnam() failed - user unknown)
Adding root
before the bash
declaration appears to fix the issue (solution was taken from an IBM article):
* * * * * root bash -c 'aurweb-mkpkglists --extended && echo "[$(date -u)] executed mkpkglists" >> /var/log/mkpkglists.log'
Version(s)
MPR: https://github.com/makedeb/mprweb/commit/1300b0b10a3b11f48fc9897e2db42923483096b4