Problem/Motivation

Aegir3 should run on MySQL8, support for MySQL8 was added in Drupal 7.76 and 7.77 in early December 2020.

Steps to reproduce

Install of Aegir with MySQL 8, i.e. on Ubuntu 20.04, will fail with:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER' in lock_may_be_available() (line 167 of /var/aegir/hostmaster-7.x-3.186/includes/lock.inc).

Proposed resolution

There is a patch for MySQL 8 support in Drupal 7, but not yet in core. Hostmaster make file should download and deploy this core patch, as workaround.

Remaining tasks

Upgrade aegir to release 7.77

User interface changes

-

API changes

-

Data model changes

-

Comments

doka created an issue. See original summary.

doka’s picture

Please find my patch on drupal-org-core.make

colan’s picture

Status: Active » Needs review
tr’s picture

Status: Needs review » Postponed (maintainer needs more info)

#2978575: Mysql 8 Support on Drupal 7 has been committed, which should solve this issue. Can someone try to reproduce this and see if it is still a problem in Drupal 7.76 or greater?

agaq’s picture

I just tried installing Aegir 3.190 (Drupal 7.76) on a Ubuntu 20.04 machine (running Mysql 8.0.22).

Installation fails with:

Caught drush error, ending drush_provision_hostmaster_install [error]
Array [error]
(
[PROVISION_GRANT_DB_USER_FAILED] => Array
(
[0] => Unable to grant privileges to database users.
)

)

and later:

Could not find the alias @hostmaster [error]
dpkg: error processing package aegir3-hostmaster (--configure):
installed aegir3-hostmaster package post-installation script subprocess returned error exit status 1
Setting up php-composer-semver (1.5.1-1) ...
Setting up php-json-schema (5.2.9-1) ...
Setting up php-composer-spdx-licenses (1.5.3-1) ...
Setting up php (2:7.4+75) ...
Setting up php-symfony-console (4.3.8+dfsg-1ubuntu1) ...
Setting up php-composer-xdebug-handler (1.4.0-1) ...
dpkg: dependency problems prevent configuration of aegir3:
aegir3 depends on aegir3-hostmaster (>= 3.190); however:
Package aegir3-hostmaster is not configured yet.

dpkg: error processing package aegir3 (--configure):
dependency problems - leaving unconfigured
Setting up composer (1.10.1-1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.3) ...
Errors were encountered while processing:
aegir3-hostmaster
aegir3
E: Sub-process /usr/bin/dpkg returned an error code (1)

agaq’s picture

I may have been a bit quick and careless in filing my error report above in this thread.

The error message I get is not the same as that initially reported by @doka.

The error "PROVISION_GRANT_DB_USER_FAILED / Unable to grant privileges to database users" I get is the same as reported in the past for earlier versions of mysql in https://www.drupal.org/project/hostmaster/issues/2942248

That error was caused by Mysql having the validate_password plugin active and password validation policy being set to anything higher than LOW.

In Mysql 8, the validate_password plugin has been replaced by the validate_password component (see https://dev.mysql.com/doc/refman/8.0/en/validate-password.html).

But I just checked and the validate_password component is not active by default in Ubuntu 20.04. It is not active on my machine which returns the "PROVISION_GRANT_DB_USER_FAILED / Unable to grant privileges to database users" error.

And without the component active, there does not seem to be any kind of enforcement on password, as I managed to change it to the 2-letter word 'hi':

mysql> SET PASSWORD FOR root@localhost='hi';
Query OK, 0 rows affected (0.28 sec)

So it looks like that error, and failure to install 3.190 on Ubuntu 20.04 with Mysql 8.0, is not caused by password policy.

tr’s picture

Status: Postponed (maintainer needs more info) » Active

@agaq: Your problem looks like a problem reported with the Provision module with MySQL 8 - see #3145881: User creation has changed in MySQL 8.0. If that's what you're seeing, please try the patch in that issue and comment both there and here!

agaq’s picture

Thanks @TR. I will gather info on how to apply a patch and try that. But I see 4 patches in https://www.drupal.org/project/provision/issues/3145881 and it is not too clear to me which I should try.

joseph.olstad’s picture

Issue summary: View changes
tr’s picture

But I see 4 patches in #3145881: User creation has changed in MySQL 8.0 and it is not too clear to me which I should try.

I don't know either - it seems that the participants in that issue haven't settled on a solution. But that's where the solution to that particular problem is being discussed, and when they do figure it out then perhaps we can close this current problem. So my suggestion is to contribute to that issue if this problem affects you!

colan’s picture

Status: Active » Closed (works as designed)

From #4:

#2978575: Mysql 8 Support on Drupal 7 has been committed, which should solve this issue. Can someone try to reproduce this and see if it is still a problem in Drupal 7.76 or greater?

We've confirmed that it is not. We simply need to cut a new Aegir release to pull in the latest version of Drupal core as we're not pinning the Drupal core version (the patch is no longer required). See #3168480: Include Drupal 7 core support for MySQL 8 for details; that's the open issue for cutting a new release.

And yes, see #3145881: User creation has changed in MySQL 8.0 for the DB issue.