by Matt Wallace.
Hello,
Up until now all my installations have gone absolutely fine, however the latest upgrade has failed leaving our platform unusable.
The error being thrown is:
Warning: Undefined property: stdClass::$debug_developer_use_pretty_exceptions in /var/www/moodle/lib/setuplib.php on line 370
Warning: Undefined property: stdClass::$debug_developer_use_pretty_exceptions in /var/www/moodle/lib/setuplib.php on line 370
Error
error/generalexceptionmessage
Debug info:
Error code: generalexceptionmessage
$a contents: Call to undefined function is_dir()
Stack trace:
line 698 of /lib/classes/component.php: Error thrown
line 569 of /lib/classes/component.php: call to core_component::fetch_plugins()
line 473 of /lib/classes/component.php: call to core_component::fetch_plugintypes()
line 446 of /lib/classes/component.php: call to core_component::fill_all_caches()
line 371 of /lib/classes/component.php: call to core_component::get_cache_content()
line 149 of /lib/classes/component.php: call to core_component::init()
line 631 of /lib/setup.php: call to core_component::classloader()
line 38 of /config.php: call to require_once()
line 27 of /login/index.php: call to require()
Here is the output from git to show the branch I am on, the change I made to setuplib.php in order to uncover the underlying error, and the configuration settings to ensure debug mode given that I can't get to the admin pages at the moment to enable debug via the UI:
========================== GIT OUTPUT ================================
www-data@tooling:~/moodle$ git status
On branch MOODLE_404_STABLE
Your branch is up to date with 'origin/MOODLE_404_STABLE'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: lib/setuplib.php
no changes added to commit (use "git add" and/or "git commit -a")
========================== CHANGES TO GET ACTUAL ERROR ================================
www-data@tooling:~/moodle$ git diff
diff --git a/lib/setuplib.php b/lib/setuplib.php
index 4468ce39790..5b4f3d8cbbd 100644
--- a/lib/setuplib.php
+++ b/lib/setuplib.php
@@ -657,7 +657,8 @@ function get_exception_info($ex): stdClass {
$moreinfourl = $errordoclink . 'error/' . $modulelink . '/' . $errorcode;
if (empty($link)) {
- $link = get_local_referer(false) ?: ($CFG->wwwroot . '/');
+ // $link = get_local_referer(false) ?: ($CFG->wwwroot . '/');
+ $link = ($CFG->wwwroot . '/');
}
// When printing an error the continue button should never link offsite.
========================== CONFIG FILE CHANGES ================================
www-data@tooling:~/moodle$ cat config.php
<?php // Moodle configuration file
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = 'mariadb';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = '<USER>';
$CFG->dbpass = '<PASSWORD>';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbport' => 3306,
'dbsocket' => '',
'dbcollation' => 'utf8mb4_general_ci',
);
$CFG->wwwroot = 'https://my.moodle.install';
$CFG->dataroot = '/var/www/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0750;
$CFG->sslproxy = true;
//=========================================================================
// 7. SETTINGS FOR DEVELOPMENT SERVERS - not intended for production use!!!
//=========================================================================
//
// Force a debugging mode regardless the settings in the site administration
@error_reporting(E_ALL | E_STRICT); // NOT FOR PRODUCTION SERVERS!
@ini_set('display_errors', '1'); // NOT FOR PRODUCTION SERVERS!
$CFG->debug = (E_ALL | E_STRICT); // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS!
$CFG->debugdisplay = 1; // NOT FOR PRODUCTION SERVERS!
require_once(__DIR__ . '/lib/setup.php');
// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!
Any help you can provide on resolving this would be welcome!
Thanks in advance!