Follow-up to #2529188: Provide better error handling for MySQL client and server utf8mb4 incompatibility

Problem/Motivation

Reported in https://www.drupal.org/node/2529188#comment-10264753:

The error message shows the wrong version:

The libmysqlclient driver version 5.6.19-67.0-log is less than the minimum required version. Upgrade to libmysqlclient version 5.5.3 or up, or alternatively switch mysql drivers to MySQLnd version 5.0.9 or up.

Proposed resolution

Show the right version

Remaining tasks

Review patch

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because the wrong version is listed.
Issue priority Follow up to #2529188: Provide better error handling for MySQL client and server utf8mb4 incompatibility. Major because this can cause issues for anyone starting Drupal 8 for the first time.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stefan.r created an issue. See original summary.

stefan.r’s picture

Issue summary: View changes
stefan.r’s picture

Status: Active » Needs review
FileSize
3.03 KB

Status: Needs review » Needs work

The last submitted patch, 3: 2558615-3.patch, failed testing.

cilefen’s picture

Title: Error message in MySQL client version check shows server version » Error message in MySQL client version check shows incorrect server version
stefan.r’s picture

Title: Error message in MySQL client version check shows incorrect server version » Error message in MySQL client version check shows server version instead of client version

Almost ;)

It does show the correct server version, it's just that that's we're not interested in that when we do the client check

stefan.r’s picture

Status: Needs work » Needs review
FileSize
2.55 KB
cilefen’s picture

Good - you can tell I was confused.

stefan.r’s picture

Just a heads up, @ansorg posted in https://www.drupal.org/node/2529188#comment-10269023 that applying this patch fixed his issue.

cilefen’s picture

stefan.r’s picture

That issue introduced a client version check on top of a server version clint check, but the error message it introduced shows the wrong version number in the client check, so it's not very helpful as it shows the server version instead of the client version.

cilefen’s picture

Since this is a follow-up, I supposed we need some test coverage for this message, if that is even possible with the testbots.

stefan.r’s picture

No not possible sadly. Can't be unit tested either, just manually tested.

@ansorg did some manual testing in https://www.drupal.org/node/2529188#comment-10269023

stefan.r’s picture

Just bumping this as @eranmatis just posted this in the issue queue, which illustrates how wrong the current message is and the kind of confusion this is causing:

Well, I don't know if this is the place for this but here I go.

I'm trying to install *Drupal 8 beta 14* On MochaHost shared server.
Currently stuck. but maybe information about the process will help with this
issue.

*First Error: "Database configuration"
*SQLSTATE[HY000] [2019] Can't initialize character set utf8mb4 (path:
/usr/share/mysql/charsets/).
Solved with a patch: https://www.drupal.org/node/2529188 [1]

*Second Error: "Database configuration"
*The libmysqlclient driver version 5.5.42-cll is less than the minimum
required version.
Upgrade to libmysqlclient version 5.5.3 or up, or alternatively switch mysql
drivers to MySQLnd version 5.0.9 or up.

The host guys replay:
The libmysql version on the server is 5.5.42-cll like it is listed in the
error message which is higher than 5.5.3.
This appears to the application installation bug.
Please check this with the support of the application.

The MySQL server version is 5.5.42

eranmatis’s picture

Thanks Stefan,
I applied the patche, and as expected, I'm getting the following message:

The libmysqlclient driver version 5.1.73 is less than the minimum required version. Upgrade to libmysqlclient version 5.5.3 or up, or alternatively switch mysql drivers to MySQLnd version 5.0.9 or up.

stefan.r’s picture

Great, good to hear this is working with the patch applied now!

cilefen’s picture

Status: Needs review » Reviewed & tested by the community

I had to git diff --word-diff=color to get a good look at this. The problem is that for whatever reason, the client $version that is determined above this chunk of code is not used in the error messages. Instead, the server version is used. This is just a straight-up bug. The patch changes exactly what is needed and no more.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: 2558615-7.patch, failed testing.

stefan.r’s picture

Status: Needs work » Reviewed & tested by the community

Back to RTBC assuming this was unrelated

effulgentsia queued 7: 2558615-7.patch for re-testing.

  • catch committed 585f6d9 on 8.0.x
    Issue #2558615 by stefan.r: Error message in MySQL client version check...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.