Cron Job Error Fatal

I have this error: [319006][-none-][FATAL] cron.php: missing expected allowed_cron_users entry in config.php. No cron user checks will occur.

I configured nano /var/www/html/suitecrm/config.php
with: $sugar_config[‘cron’] = array(
‘allowed_cron_users’ => array(‘www-data’, ‘root’),
);

and: crontab -l -u www-data
*/5 * * * * php -f /var/www/html/suitecrm/cron.php > /dev/null 2>&1

I put 5 because it was throttled.

The Cron is running.

If i delete root I have the same error.

I have tried to diagnose it and solve it but not succesfuly.

root@vmi2450688:~# cat /var/www/html/suitecrm/VERSION
8.8.0
root@vmi2450688:~# apache2 -v
Server version: Apache/2.4.52 (Ubuntu)
Server built: 2024-03-18T13:41:27
root@vmi2450688:~# mysql --version
mysql Ver 15.1 Distrib 10.6.18-MariaDB, for debian-linux-gnu (x86_64) using Ed itLine wrapper
root@vmi2450688:~# ls -lah /var/www/html/suitecrm
ls -lah /var/www/html/suitecrm/public/legacy
total 2.3M

Some info:

Not 100% Sure but can be permissions to the cron.php if when root is deleted the issue persists.

I have modified with this: ‘cron’ =>
array (
‘max_cron_jobs’ => 10,
‘max_cron_runtime’ => 30,
‘min_cron_interval’ => 30,
‘allowed_cron_users’ =>
array (
0 => ‘www-data’,
),
),

I have also add permission:
root@vmi2450688:~# sudo chown -R www-data:www-data /var/www/html/suitecrm/
sudo chmod 775 /var/www/html/suitecrm/config.php
root@vmi2450688:~# crontab -u www-data -l
*/5 * * * * php -f /var/www/html/suitecrm/cron.php > /dev/null 2>&1
root@vmi2450688:~#

I still get the same error in the log: Mon Feb 24 2025 at 12:15:02 [372893][-none-][FATAL] cron.php: missing expected allowed_cron_users entry in config.php. No cron user checks will occur.

The error says that it will not be doing checks, but it is not really a fatal error because everything will still work, so don’t worry.

My guess is that something about your hosting is preventing it from getting the current username.