Bitnami SuiteCRM 8.3 - Issue running scheduled jobs (works in SSH CLI)

Good Evening,

I deployed the bitnami azure instance of sutieCRM 8.3, and while most things appear to be working, the jobs never actually execute. I have followed the ultimate schedulers guide and everything - fixed my crontab - and the system log even says it is running! Can someone please help me get my scheduler working?

Image used: SuiteCRM Cloud Hosting on Azure

The only way I can get jobs to appear on the schedular as having ran, is by running the cron.php file manually in CLI, as bitnami user:

cd /bitnami/suitecrm/public/legacy; php -f cron.php > /dev/null 2>&1

Somehow when I run that manually, my scheduled jobs run once in suiteCRM.

Here is the tail of my logs (You can see I threw the kitchen sink at this, and have root, daemon, and bitnami running):

Aug 7 02:33:12 HCFCRM dhclient[522]: XMT: Solicit on eth0, interval 113740ms.
Aug 7 02:34:01 HCFCRM CRON[41657]: (daemon) CMD (nohup php -f /bitnami/suitecrm/public/legacy/cron.php > /dev/null 2>&1 &)
Aug 7 02:34:01 HCFCRM CRON[41658]: (bitnami) CMD (cd /bitnami/suitecrm/public/legacy; php -f cron.php > /dev/null 2>&1)
Aug 7 02:34:01 HCFCRM CRON[41656]: (root) CMD (cd /bitnami/suitecrm/public/legacy; php -f cron.php > /dev/null 2>&1)
Aug 7 02:34:01 HCFCRM CRON[41659]: (daemon) CMD (cd /opt/bitnami/suitecrm; /opt/bitnami/php/bin/php -f cron.php > /dev/null 2>&1)
Aug 7 02:35:01 HCFCRM CRON[41668]: (bitnami) CMD (cd /bitnami/suitecrm/public/legacy; php -f cron.php > /dev/null 2>&1)
Aug 7 02:35:01 HCFCRM CRON[41667]: (daemon) CMD (cd /opt/bitnami/suitecrm; /opt/bitnami/php/bin/php -f cron.php > /dev/null 2>&1)
Aug 7 02:35:01 HCFCRM CRON[41669]: (daemon) CMD (nohup php -f /bitnami/suitecrm/public/legacy/cron.php > /dev/null 2>&1 &)
Aug 7 02:35:01 HCFCRM CRON[41670]: (root) CMD (cd /bitnami/suitecrm/public/legacy; php -f cron.php > /dev/null 2>&1)

Cron Service Status response:

● cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2023-08-07 01:33:11 UTC; 12min ago
Docs: man:cron(8)
Main PID: 40642 (cron)
Tasks: 1 (limit: 19188)
Memory: 360.0K
CPU: 684ms
CGroup: /system.slice/cron.service
└─40642 /usr/sbin/cron -f

Aug 07 01:45:01 HCFCRM CRON[40854]: pam_unix(cron:session): session opened for user bitnami(uid=1000) by (uid=0)
Aug 07 01:45:01 HCFCRM CRON[40856]: (daemon) CMD (cd /opt/bitnami/suitecrm; /opt/bitnami/php/bin/php -f cron.php > /dev/null 2>&1)
Aug 07 01:45:01 HCFCRM CRON[40857]: (bitnami) CMD (su -c “cd /bitnami/suitecrm/public/legacy; php -f cron.php > /dev/null 2>&1” bitnami)
Aug 07 01:45:01 HCFCRM CRON[40855]: pam_unix(cron:session): session closed for user daemon
Aug 07 01:45:01 HCFCRM CRON[40853]: pam_unix(cron:session): session closed for user root
Aug 07 01:45:01 HCFCRM su[40860]: pam_unix(su:auth): auth could not identify password for [bitnami]
Aug 07 01:45:01 HCFCRM su[40860]: FAILED SU (to bitnami) bitnami on none
Aug 07 01:45:01 HCFCRM CRON[40852]: pam_unix(cron:session): session closed for user daemon
Aug 07 01:45:02 HCFCRM CRON[40854]: (CRON) info (No MTA installed, discarding output)
Aug 07 01:45:02 HCFCRM CRON[40854]: pam_unix(cron:session): session closed for user bitnami

I asked Bing AI for help -I followed the troubleshooting steps, some of mine are material different… like I am usinga user crontab instead of system wide, but as you can see I have tried all flavors of crontab, with no luck.

I updated the quotes to make it clear what was the guide and what was me.

Hi, I’m sorry to hear that you are having issues with running scheduled jobs in SuiteCRM. There are a few possible causes and solutions for this problem, depending on your configuration and environment. Here are some steps you can try to troubleshoot it:

  • First, make sure that your cron job is set up correctly and running as the right user. You can check the /etc/crontab file or use the crontab -l command to see your cron job settings. You should have something like this:

* * * * * daemon cd /opt/bitnami/suitecrm; /opt/bitnami/php/bin/php -f cron.php > /dev/null 2>&1

Response: Mine is like this (Could be an issue)

'* * * * * cd /bitnami/suitecrm/public/legacy; php -f cron.php > /dev/null 2>&1

This will run the cron.php script every minute as the daemon user. You can also use a different user, but make sure that it has the proper permissions to access the SuiteCRM files and database. You also need to add the user to the allowed_cron_users array in the config.php file, otherwise you may get an error⁴.

Response: CHECK - I was missing 'daemon, but it still isn’t working.

array (
  0 => 'bitnami',
 1 => 'daemon'
  • Second, check if your scheduled jobs are actually running or not. You can do this by going to Admin > Schedulers and clicking on each job to see its log. If there are no entries or only old entries, then your jobs are not running. If there are recent entries, then your jobs are running but may have some errors or issues.

Response: Not working - no new runs

  • Third, check your PHP and SuiteCRM logs for any errors or warnings related to the scheduled jobs. You can find the PHP logs in /opt/bitnami/php/var/log/php-fpm.log and the SuiteCRM logs in /opt/bitnami/suitecrm/suitecrm.log. Look for any messages that mention cron.php, schedulers, or specific jobs. You may find some clues about what is causing the problem.

Response: /opt/bitnami/php/var/log/ is empty

Response: /opt/bitnami/suitecrm/suitecrm.log - No mention of “cron”

  • Fourth, try to run the cron.php script manually from the command line >and see what happens. You can do this by typing:

cd /opt/bitnami/suitecrm; /opt/bitnami/php/bin/php -f cron.php

This will run the script as the current user and display any output or errors on the screen. You can also redirect the output to a file for later analysis, for example:

cd /opt/bitnami/suitecrm; /opt/bitnami/php/bin/php -f cron.php > cron_output.txt

This will create a file named cron_output.txt in the SuiteCRM directory with the output of the script.

Response: Mine is different to run right - I just modified it to try to CD into /suitecrm before running cron.php with an absolute path to bitnami’s php bin

This runs without error, but adding it to daemon crontab didn’t work either.

cd /opt/bitnami/suitecrm; php -f /bitnami/suitecrm/publi
c/legacy/cron.php > /dev/null 2>&1

  • Fifth, if none of the above steps help, you may need to check your SuiteCRM configuration and settings for any issues or conflicts. For example, you may need to adjust your time zone settings, email settings, or job parameters. You may also need to do a Quick Repair and Rebuild from Admin > Repair to fix any database or cache issues.

Response: Looks like I am going to try this then… To be continued

For more details and examples, you can check these resources:

************** I broke the link so I wouldn’t get flagged for more than 2 links ********

I hope this helps. If you have any other questions, please let me know. :blush:

Source: Conversation with Bing, 8/7/2023

Admin repair and rebuild didn’t work.

I also tried rebuilding the jobs, now the logs are clear - and it didn’t work either. I am doing a new reply because I can’t edit posts on my tablet for some reason.

I managed to get this working by running as a bash script, in crontab for daemon.

Syslog says it is running as root, but with user daemon. I also restored all the weird troubleshooting configurations that I did, back to the factory settings. I only have daemon in the allowed cron users, and am running in secure mode (however secure sudo is).

This worked for me:

sudo crontab -e
" * * * * * sudo -u daemon bash -c “cd /bitnami/suitecrm/public/legacy; php -f cron.php > /dev/null 2>&1”

I’m not sure if this is ideal, but its working.

1 Like

You should create an issue on github suitecrm-core for a dev to fix this bug. In your issue, paste a link to this thread so they’ll easily see your solution.