Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading from tutor 15 to tutor 18 breaks the MySQL connection due to the mysql_native_password authentication plugin not being found #1089

Closed
Danyal-Faheem opened this issue Jul 3, 2024 · 1 comment · Fixed by #1090

Comments

@Danyal-Faheem
Copy link
Contributor

Bug description

When you upgrade from tutor 15.x to tutor 18.x, the LMS cannot connect to the MySQL server during the launch step with the error:

ERROR 1524 (HY000): Plugin 'mysql_native_password' is not loaded

The same error occurs if you try to enter the SQLshell using the following methods:

  • do sqlshell command
  • Bashing into the MySQL container
  • Running ./manage.py lms dbshell in the LMS container

How to reproduce

  1. Install tutor 15.3.9.
  2. Run tutor local launch to launch a fresh local instance and verify that the LMS and Studio are working fine.
  3. Install tutor 16.x.
  4. Run tutor config save
  5. Run tutor local upgrade --from=olive
  6. Run tutor local launch
  7. Follow step 3-6 for tutor 17 and tutor 18 replacing the version and release name.

And then the init task for tutor 18 crashes at the MySQL step with the above mentioned error.

Environment
OS: MacOS Sonoma 14.5
Tutor versions 15.3.9 and 18.1.0

Additional context

This issue was initially raised in https://discuss.openedx.org/t/error-1524-hy000-plugin-mysql-native-password-is-not-loaded/13257/9

The default authentication plugin in MySQL 8.0 and onwards has been changed to caching_sha2_password whereas it was mysql_native_password in MySQL 5.7 and earlier. If a CREATE USER query did not specify the authentication plugin explicitly, the default authentication plugin was used.

According to the MySQL docs:

User accounts already created in existing instances are not altered as a part of an upgrade. So, all existing user accounts continue to use the same authentication plugin that they used in e.g. MySQL 5.7.

This means that the users that were created by Tutor in version 15 or earlier used the mysql_native_password authentication and even after upgrading to MySQL 8.0 in Palm and 8.4 in Redwood, that was not changed.

In Tutor 18.0.0, MySQL was upgraded to v8.4.0 as per #1071. In MySQL 8.4.0, mysql_native_password is disabled by default as per the docs. This means that if the DB contains users using the mysql_native_password plugin, it will refuse to connect.

A possible solution is to start the MySQL server with the parameters --mysql-native-password=ON. But this might be unsafe in the long run.

@DawoudSheraz
Copy link
Contributor

Thanks for leading the investigations on this @Danyal-Faheem , much appreciated.

Danyal-Faheem added a commit to edly-io/tutor that referenced this issue Jul 3, 2024
fixes overhangio#1089
For tutor instances that were created with tutor 15 and earlier and then upgraded to tutor 18, the launch process would fail as MySQL connection could not be made. This is because mysql-native-password was removed in MySQL 8.4.0. We turn it on temporarily to fix failing connections
@DawoudSheraz DawoudSheraz moved this from Pending Triage to In review in Tutor project management Jul 4, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in Tutor project management Jul 4, 2024
@DawoudSheraz DawoudSheraz mentioned this issue Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
2 participants