Page 1 of 1

Cron Job Errors after Upgrade

Posted: Mon Jun 29, 2020 9:18 pm
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

Re: Cron Job Errors after Upgrade

Posted: Mon Jun 29, 2020 9:47 pm
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);

Re: Cron Job Errors after Upgrade

Posted: Tue Jun 30, 2020 7:43 am
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.