Hello Matteo
I apologise, the topic that I meant is this one https://moodle.org/mod/forum/discuss.php?d=362075.
Thanks for sharing the links with the php bugs, I will look at it later.
For the moment here a few more informations:
- We have two instaces running the same setup with the moodle release Moodle 3.2.5+ (Build: 20170928).
- One of the platform doesn't show any errors like on the other platform. And they have installed the same php version/packages.
- The stacktrace of the failing platform is:
- Notice: Undefined offset: 0 in /var/www/html/<path>/lib/accesslib.php on line 3665
Warning: array_keys() expects parameter 1 to be array, null given in /var/www/html/<path>/lib/accesslib.php on line 3665
Warning: implode(): Invalid arguments passed in /var/www/html/<path>/lib/accesslib.php on line 3665
Notice: Undefined offset: 0 in /var/www/html/<path>/lib/accesslib.php on line 3670
Warning: array_keys() expects parameter 1 to be array, null given in /var/www/html/<path>/lib/accesslib.php on line 3670
Warning: implode(): Invalid arguments passed in /var/www/html/<path>/lib/accesslib.php on line 3670
Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')
AND userid NOT IN (
' at line 5
SELECT u.id, u.username, u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.firstname,u.lastname
FROM mdl_user u
JOIN (SELECT DISTINCT userid FROM ( SELECT userid
FROM mdl_role_assignments
WHERE contextid IN (1) AND roleid IN ()
AND userid NOT IN (
SELECT userid
FROM mdl_role_assignments
WHERE contextid IN (1)
AND roleid IN ()
) ) us) ra ON ra.userid = u.id
WHERE u.deleted = 0 AND u.id <> ?
ORDER BY u.lastname, u.firstname, u.id
[array (
0 => '1',
)]
Error code: dmlreadexception
Stack trace:- line 479 of /lib/dml/moodle_database.php: dml_read_exception thrown
- line 1190 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
- line 3699 of /lib/accesslib.php: call to mysqli_native_moodle_database->get_records_sql()
- line 3811 of /lib/adminlib.php: call to get_users_by_capability()
- line 3178 of /lib/adminlib.php: call to admin_setting_users_with_capability->load_choices()
- line 1408 of /lib/adminlib.php: call to admin_setting_configmultiselect->is_related()
- line 856 of /lib/adminlib.php: call to admin_settingpage->search()
- line 856 of /lib/adminlib.php: call to admin_category->search()
- line 7861 of /lib/adminlib.php: call to admin_category->search()
- line 64 of /admin/search.php: call to admin_search_settings_html()
The error is because the array is NULL and then the roleid is not set! I've noticed yesterday when I was debugging in the accesslib.php, that the capabilities array is set different. Most time there's only the "moodle/site:approvecourse" capability set! The search was only working when in the caps array, the capability with "moodle/site:config" is set too.
PS: When I disable opcache in the broken platform It runs well!!! But the healthy platform has the same opcache configurations like the others one. Can it be, that something in the "mdl_config" is misconfigured?
Kind Regards
Adrian