Upgrade to 3.9 from 3.5

Upgrade to 3.9 from 3.5

by Ken Lacey -
Number of replies: 3

I have just upgraded from version 3.5 to 3.9.

The 3.5 version had Email-based self-registration working correctly.

Post upgrade all appeared to work, however 2 days later I received notification Email-based self-registration was reporting 'Error reading from database'.

The same error is reported on manual account creation.

I have checked the email address is not in the mdl_user table in either the username or email fields. There are a number of unconfirmed accounts which were not confirmed within the 7 day window and none of these relate to the new accounts.

Debug info with email address changed:

Error reading from database

More information about this error

× Debug info: COLLATION 'utf8mb4_bin' is not valid for CHARACTER SET 'utf8'
SELECT 'x'
FROM mdl_user
WHERE LOWER(email) COLLATE utf8mb4_bin = LOWER(?)
AND id IN (SELECT id
FROM mdl_user
WHERE email = ?
AND mnethostid = ?) LIMIT 0, 1
[array (
0 => 'new_user_email@gmail.com',
1 => 'new_user_email@gmail.com',
2 => '1',
)]
Error code: dmlreadexception

× Stack trace:

·         line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown

·         line 1212 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()

·         line 1955 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_recordset_sql()

·         line 1048 of /lib/authlib.php: call to moodle_database->record_exists_sql()

·         line 150 of /login/signup_form.php: call to signup_validate_data()

·         line 615 of /lib/formslib.php: call to login_signup_form->validation()

·         line 551 of /lib/formslib.php: call to moodleform->validate_defined_fields()

·         line 661 of /lib/formslib.php: call to moodleform->is_validated()

·         line 85 of /login/signup.php: call to moodleform->get_data()

Top of Form

Continue

Thanks in advance for any assistance.

Ken

Average of ratings: -
In reply to Ken Lacey

Re: Upgrade to 3.9 from 3.5

by Ken Task -
Picture of Particularly helpful Moodlers

Do follow Leon's link.

In addition ... there are some command line only scripts that will help with DB conversion to proper character set and collation.

Check the DB array lines in config.php file ... vs the same lines in config-dist.php.

Those CLI only scripts in code/admin/cli/ are:

mysql_collation.php,mysql_compressed_rows.php, and mysql_engine.php

Executed properly with the php for cli thusly will bring up help:

php [script_name_from_above].php

with further info/options.

'SoS', Ken

In reply to Ken Task

Re: Upgrade to 3.9 from 3.5

by Ken Lacey -
Thank you.
The issue was a mix match of tables utf8mb4_general_ci and utf8_general_ci
Updating tables to utf8mb4_unicode_ci resolved the issue.
Leon and Ken thanks for your assistance.
Ken