Fatal Error ...help please

Fatal Error ...help please

by Tobias Sanders -
Number of replies: 12

Hello,

our site is running on Moodle 4.3. It worked well but today the site won't answer. (HTTP Error 500).

I get this from the logfile

AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function get_local_referer() in /www/htdocs/w00c56c4/moodle_bmk/moodle/lib/setuplib.php:575\nStack trace:\n#0 /www/htdocs/w00c56c4/moodle_bmk/moodle/lib/setuplib.php(363): get_exception_info(Object(Error))\n#1 [internal function]: default_exception_handler(Object(Error))\n#2 {main}\n  thrown in /www/htdocs/w00c56c4/moodle_bmk/moodle/lib/setuplib.php on line 575', referer: https://www.moodle-bmk-hh.de/course/view.php?id=1452

Help please

Tobias

Average of ratings: -
In reply to Tobias Sanders

Re: Fatal Error ...help please

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

Is the file lib/weblib.php present in your Moodle source code folder? Does it contain the definition for get_local_referer():

    ⋮
229  */
 230 function get_local_referer($stripquery = true) {
 231     if (isset($_SERVER['HTTP_REFERER'])) {
   ⋮

Your error is saying this cannot be found so check if it's there.

In reply to Leon Stringer

Re: Fatal Error ...help please

by Tobias Sanders -
Yes it does. the function is there
In reply to Tobias Sanders

Re: Fatal Error ...help please

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

Enable debugging by adding these lines to config.php:

@error_reporting(E_ALL | E_STRICT);
@ini_set('display_errors', '1');
$CFG->debug = (E_ALL | E_STRICT);
$CFG->debugdisplay = 1;

These lines must be inserted before the last require_once(__DIR__ . '/lib/setup.php'); line. Hopefully this will show more detail with the error either in the browser or in the log file.

Please tell us your PHP version. Use a PHP info file to be certain.

In reply to Leon Stringer

Re: Fatal Error ...help please

by Tobias Sanders -
Thank you so much. Now I get these errors...but I can see the site and log in as an admin

Deprecated: Creation of dynamic property auth_plugin_saml2::$spname is deprecated in /www/htdocs/w00c56c4/moodle_bmk/moodle/auth/saml2/classes/auth.php on line 111

Deprecated: Creation of dynamic property auth_plugin_saml2::$certpem is deprecated in /www/htdocs/w00c56c4/moodle_bmk/moodle/auth/saml2/classes/auth.php on line 112

Deprecated: Creation of dynamic property auth_plugin_saml2::$certcrt is deprecated in /www/htdocs/w00c56c4/moodle_bmk/moodle/auth/saml2/classes/auth.php on line 113

Deprecated: Creation of dynamic property auth_plugin_saml2::$metadatalist is deprecated in /www/htdocs/w00c56c4/moodle_bmk/moodle/auth/saml2/classes/auth.php on line 119
Zum Hauptinhalt

Deprecated: Creation of dynamic property auth_plugin_saml2::$spname is deprecated in /www/htdocs/w00c56c4/moodle_bmk/moodle/auth/saml2/classes/auth.php on line 111

Deprecated: Creation of dynamic property auth_plugin_saml2::$certpem is deprecated in /www/htdocs/w00c56c4/moodle_bmk/moodle/auth/saml2/classes/auth.php on line 112

Deprecated: Creation of dynamic property auth_plugin_saml2::$certcrt is deprecated in /www/htdocs/w00c56c4/moodle_bmk/moodle/auth/saml2/classes/auth.php on line 113

Deprecated: Creation of dynamic property auth_plugin_saml2::$metadatalist is deprecated in /www/htdocs/w00c56c4/moodle_bmk/moodle/auth/saml2/classes/auth.php on line 119
In reply to Tobias Sanders

Re: Fatal Error ...help please

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

These deprecation warnings are due to the SAML2 Single sign on (auth_saml2) plugin. The version on the plugins directory only supports up to Moodle 4.1. However it looks like this has been reported (#781 Deprecated: Creation of dynamic property" warnings with PHP 8.2) and the version on GitHub contains a fix for this.

However, these warnings shouldn't stop your site from working, I'd be surprised if they are linked to the original fatal error.

In reply to Leon Stringer

Re: Fatal Error ...help please

by Tobias Sanders -
I wonder about that, too.
Perhaps this has something to do with it:
Last week friday I copied the moodle and the moodledata from the live server to our test domian folder "moodle4" on our server. Running with the URL (http://moodle-kp.bmk-hh.de/). Unfortuately I forgot to turn off the cronjobs in our server pointing to the testserver moodle.
So for a day the cronjob on the testserver directory was running as well as the one on the live server. Both had the same config.php and pointed to the live database.

Last saturday our live Moodle site was down and my mistake came to my attention. I turned off the cronjobs in the backend pointing to our testserver. After that the live server was back online and running. I also changed the DB-passwort in the config.php of the testserver to cut all possible connections.

The system worked fine until today and now I'm thinking that this has something to do with the actual bug...but I'm not sure.
Hope my explanation makes sense.
In reply to Tobias Sanders

Re: Fatal Error ...help please

by Ken Task -
Picture of Particularly helpful Moodlers

Has FQDN changed?

From: www.moodle-bmk-hh.de

to: student.bmk-hh.de

Or is student a SAML authentication server?

In the later .. "certpem is deprecated" - is reported.

LetsEncypt certs ok?

'SoS', Ken

In reply to Ken Task

Re: Fatal Error ...help please

by Tobias Sanders -
When I logout I also get this error
SAML2-Exception: Headers already sent.

Weitere Informationen über diesen Fehler

Debug-Info: #0 [dirroot]/auth/saml2/.extlib/simplesamlphp/lib/SimpleSAML/Session.php(701): SimpleSAML\Utils\HTTP::setCookie('MDL_SSP_AuthTok...', '_e91fc3f1ff0909...', Array)
#1 [dirroot]/auth/saml2/.extlib/simplesamlphp/modules/saml/lib/Auth/Source/SP.php(1231): SimpleSAML\Session->doLogin('www.moodle-bmk-...', Array)
#2 [dirroot]/auth/saml2/.extlib/simplesamlphp/modules/saml/lib/Auth/Source/SP.php(1277): SimpleSAML\Module\saml\Auth\Source\SP::handleUnsolicitedAuth('www.moodle-bmk-...', Array, 'https://www.moo...')
#3 [dirroot]/auth/saml2/.extlib/simplesamlphp/modules/saml/lib/Auth/Source/SP.php(1190): SimpleSAML\Module\saml\Auth\Source\SP::onProcessingCompleted(Array)
#4 [dirroot]/auth/saml2/.extlib/simplesamlphp/modules/saml/www/sp/saml2-acs.php(269): SimpleSAML\Module\saml\Auth\Source\SP->handleResponse(Array, 'tine20', Array)
#5 [dirroot]/auth/saml2/sp/saml2-acs.php(34): require('/www/htdocs/w00...')
#6 {main}
Error code: exception×Diese Systemnachricht ablehnen
Stack trace:
line 36 of /auth/saml2/sp/saml2-acs.php: saml2_exception thrown
In reply to Tobias Sanders

Re: Fatal Error ...help please

by Tobias Sanders -
I don't know why...but it's running again. Hope it stays that way.
Ken and Leon: Thank you very much for your help!

Cheers
Tobias
In reply to Tobias Sanders

RESOLVED Re: Fatal Error ...help please

by Ken Task -
Picture of Particularly helpful Moodlers

Have marked this thread as 'resolved'.

As to why it's working now ... suspect it had to do with cron job/task and caching as well as sessions.

But good to hear it's working again! smile

'SoS', Ken