Cron Job Errors after Upgrade

Ask your questions regarding TimeTrex installation here.
Post Reply
nth0mth0m
Posts: 32
Joined: Fri Nov 15, 2019 9:39 pm

Cron Job Errors after Upgrade

Post by nth0mth0m »

Hello Everyone,

I recently upgraded to the latest version available and my cron job fails when I run cron without /dev/null 2>&1, I get the following error:

PHP Fatal error: Uncaught Error: Call to undefined function convertHumanSizeToBytes() in /var/www/html/classes/modules/install/Install.class.php:1053
Stack trace:
#0 /var/www/html/classes/modules/install/Install.class.php(2159): Install->getPHPINISize('memory_limit')
#1 /var/www/html/classes/modules/install/Install.class.php(2293): Install->checkPHPMemoryLimit()
#2 /var/www/html/includes/CLI.inc.php(75): Install->checkAllRequirements(true)
#3 /var/www/html/maint/cron.php(43): require_once('/var/www/html/i...')
#4 {main}
thrown in /var/www/html/classes/modules/install/Install.class.php on line 1053
nth0mth0m
Posts: 32
Joined: Fri Nov 15, 2019 9:39 pm

Re: Cron Job Errors after Upgrade

Post by nth0mth0m »

For a workaround I replaced the the new getPHPINISize () function back to memory limit function as it was before the upgrade. I am no longer getting errors. Perhaps this is a result of my php version?

Replaced with... (Please let me know if you forsee any issues).

$raw_limit = ini_get('memory_limit');
//Debug::text('RAW Limit: '. $raw_limit, __FILE__, __LINE__, __METHOD__, 9);

$limit = str_ireplace( array('G', 'M', 'K'), array('000000000', '000000', '000'), $raw_limit ); //Use * 1000 rather * 1024 for easier parsing of G, M, K -- Make sure we consider -1 as the limit.
//$limit = (int)rtrim($raw_limit, 'M');
//Debug::text('Limit: '. $limit, __FILE__, __LINE__, __METHOD__, 9);
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Cron Job Errors after Upgrade

Post by shaunw »

The function it claims is missing is in the "includes/global.inc.php" file and has been there for many months. It should always be able to find that function as long as your TimeTrex files are not corrupt. You may want to try downloading TimeTrex again and performing the upgrade once more to ensure all files are correct.
Post Reply