willadamskeane Posted February 3, 2022 Posted February 3, 2022 (edited) Hi there, Many of the routine maintenance tasks running on my forum are failing, without any errors appearing in their respective logs. When I run them manually, they run successfully (except for the queue task, which states that it cannot be run because it is already running, though it still complains that it fails to run). They are setup to execute through a cron job, which had been working fine in the past. Let me know what other info I can give to help debug. Thanks! Edited February 3, 2022 by willadamskeane
Jim M Posted February 3, 2022 Posted February 3, 2022 I was seeing quite a few database errors in your System Log where the system was having inability to connect. I am unsure if this was a temporary issue or more prolonging but I was able to run through the background tasks without error. If you continue to run into this, you may wish to contact your hosting provider for assistance in tracing down why you are unable to connect to your MySQL database during this period.
willadamskeane Posted February 3, 2022 Author Posted February 3, 2022 9 minutes ago, Jim M said: I was seeing quite a few database errors in your System Log where the system was having inability to connect. I am unsure if this was a temporary issue or more prolonging but I was able to run through the background tasks without error. If you continue to run into this, you may wish to contact your hosting provider for assistance in tracing down why you are unable to connect to your MySQL database during this period. I recently converted a number of old MyISAM tables to InnoDB, perhaps that had something to do with it. Though the issue with the tasks failing to run was happening well before I did the conversion. I'm self-hosted, so any MySQL issues I'll need to debug myself. Can you share with me the error you saw? And do you believe it to be the cause of the tasks failing to run?
Jim M Posted February 3, 2022 Posted February 3, 2022 2 minutes ago, willadamskeane said: I recently converted a number of old MyISAM tables to InnoDB, perhaps that had something to do with it. Though the issue with the tasks failing to run was happening well before I did the conversion. I'm self-hosted, so any MySQL issues I'll need to debug myself. Can you share with me the error you saw? And do you believe it to be the cause of the tasks failing to run? "MySQL server could not be found" were being returned. This is pretty much a generic connection issue that MySQL is returning. If the software cannot connect to the database, it cannot perform the task at hand but I do not see anything evident that it is from a task, no.
willadamskeane Posted February 3, 2022 Author Posted February 3, 2022 4 minutes ago, Jim M said: "MySQL server could not be found" were being returned. This is pretty much a generic connection issue that MySQL is returning. If the software cannot connect to the database, it cannot perform the task at hand but I do not see anything evident that it is from a task, no. So there's no way to know specifically why these tasks are locking up?
Jim M Posted February 3, 2022 Posted February 3, 2022 Just now, willadamskeane said: So there's no way to know specifically why these tasks are locking up? You would need to check your CRON log for any logging of errors.
Solution willadamskeane Posted February 3, 2022 Author Solution Posted February 3, 2022 (edited) I'm seeing crond[2285]: (/usr/bin/php) ERROR (getpwnam() failed) From a brief google search, it looks like I need to prefix a username to the cron command being executed. In my case, located in /etc/crontab. I'm going to try this, and will update here if successful in case someone else runs into this problem. Edit: So far seems to be working. For reference, in my crontab file I originally had: * * * * * /usr/bin/php -d memory_limit=-1... I changed this to: * * * * * root /usr/bin/php -d memory_limit=-1... Edited February 3, 2022 by willadamskeane Marc 1
Recommended Posts