!!! error/generalexceptionmessage !!! after update from 3.9.2 to 3.9.4

!!! error/generalexceptionmessage !!! after update from 3.9.2 to 3.9.4

by Anze Pratnemer -
Number of replies: 4

Greetings,

I'm getting !!! error/generalexceptionmessage !!! on all tasks after I updated Moodle from 3.9.2 to 3.9.4 yesterday.

I have Debugging on DEVELOPER, php_log is set to /var/log/php_errors.log (read from phpinfo) and no file is created there. I restarted the server already.

Manually triggering cron.php from cli returns same error string (and only this string.).

Turning on Display debug messages does nothing.

How to debug whats causing it? Its the same error for every task I try to run manually, cron job is not working for 18 hours now because of this error.


Average of ratings: -
In reply to Anze Pratnemer

Re: !!! error/generalexceptionmessage !!! after update from 3.9.2 to 3.9.4

by Anze Pratnemer -
After some more digging (adding echo errors to code directly) I found this:

!!!! error/generalexceptionmessage !!!

Stack trace: * line 425 of /lib/setuplib.php: ArgumentCountError thrown
* line 608 of /lib/setup.php: call to default_error_handler()
* line 608 of /lib/setup.php: call to require_once()
* line 28 of /config.php: call to require_once()
* line 33 of /admin/cli/cron.php: call to require()

Which leads to this: 

require(__DIR__.'/../../config.php');
 and finaly to
require_once($CFG->libdir .'/deprecatedlib.php');

Which seems like I have a php configuration problem..


In reply to Anze Pratnemer

Re: !!! error/generalexceptionmessage !!! after update from 3.9.2 to 3.9.4

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

What version of PHP is this? There may be different versions installed so check using the path to the PHP binary being used for cron, e.g. /path/to/php -v.

Maybe this could be caused by lib/setuplib.php:default_error_handler() being invoked with PHP 8.0 as there's a warning about $errcontext:

This parameter has been DEPRECATED as of PHP 7.2.0, and REMOVED as of PHP 8.0.0. If your function defines this parameter without a default, an error of "too few arguments" will be raised when it is called.

Average of ratings: Useful (2)
In reply to Leon Stringer

Re: !!! error/generalexceptionmessage !!! after update from 3.9.2 to 3.9.4

by Anze Pratnemer -
Nice catch!

I do have version 7.2 installed which is used by apache and is shown in moodle phpinfo section, and I also have php8.0 for some other reason. Removing it is out of the question sad

I did alter source code to get defualt value on that param $errcontext and I got fresh new errors, mainly from same problem of default values.
Deprecated: Required parameter $totalcount follows optional parameter $categoryid in /var/www/html/lib/deprecatedlib.php on line 3246

Deprecated: Required parameter $accesssince follows optional parameter $groupid in /var/www/html/lib/deprecatedlib.php on line 3813

Deprecated: Required parameter $roleid follows optional parameter $groupid in /var/www/html/lib/deprecatedlib.php on line 3813

Deprecated: Required parameter $statusid follows optional parameter $groupid in /var/www/html/lib/deprecatedlib.php on line 3813

Deprecated: Required parameter $search follows optional parameter $groupid in /var/www/html/lib/deprecatedlib.php on line 3813

Fatal error: Method lang_string::__set_state() must take exactly 1 argument in /var/www/html/lib/moodlelib.php on line 10577

Added all the default values (mostly null, some "") and for last error I had to make method static and add one dummy parameter with default value.

It started working now..