Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Provisioning blocked by mysql 8 credentials user error #1111

Closed
1 task done
timmc-edx opened this issue Jun 28, 2023 · 6 comments
Closed
1 task done

Provisioning blocked by mysql 8 credentials user error #1111

timmc-edx opened this issue Jun 28, 2023 · 6 comments
Assignees
Labels
bug Report of or fix for something that isn't working as intended

Comments

@timmc-edx
Copy link
Contributor

timmc-edx commented Jun 28, 2023

Early in the provisioning process, users get the following error:

Ensuring MySQL 8.0 databases and users exist...
+ docker-compose exec -T mysql80 bash -e -c 'mysql -uroot mysql'
ERROR 1396 (HY000) at line 2: Operation CREATE USER failed for 'credentials001'@'%'

Acceptance criteria:

  • Provisioning no longer blocked by this error

Notes:

@timmc-edx
Copy link
Contributor Author

That PR introduces a new SQL file with commented out instructions on how to run it: docker-compose exec -T mysql80 bash -e -c "mysql -uroot mysql" < drop-mysql-user.sql -- running this does appear to allow the provisioning script to proceed. Not sure if/how/when it should be run during provisioning. Alternatively, maybe we are failing to destroy this container when we normally would.

@timmc-edx
Copy link
Contributor Author

If I run make dev.remove-containers dev.up.mysql57+mysql80 and then make dev.shell.mysql57 or make dev.shell.mysql80 I find that the databases already contain the necessary users. And the two provisioning scripts differ in one important way: provision.sql (for 5.7) uses GRANT ALL ON credentials.* TO 'credentials001'@'%' IDENTIFIED BY 'password'; all as one statement, whereas provision-mysql80.sql has two statements:

CREATE USER 'credentials001'@'%' IDENTIFIED BY 'password';
GRANT ALL ON credentials.* TO 'credentials001'@'%';

Implicit vs. explicit user creation?

@timmc-edx
Copy link
Contributor Author

OK yeah, auto-creation of users via GRANT statements was already deprecated as of 5.7, and doesn't exist as of 8.0. So we'll want to switch this over to CREATE USER IF NOT EXISTS.

@timmc-edx timmc-edx self-assigned this Jun 28, 2023
@timmc-edx timmc-edx added the bug Report of or fix for something that isn't working as intended label Jun 28, 2023
@github-actions
Copy link

Follow-up checklist (for Arch-BOM usage)

  • Is the issue flaky or consistent?
  • Does it affect multiple people or multiple types of systems?
  • Update the devstack troubleshooting documentation page if necessary
    • Do we need a new troubleshooting section?
    • Did a troubleshooting section already exist, but it wasn't easy to find given the symptoms?
    • If a recurring issue, should we ticket an automated resolution in place of the doc?

@timmc-edx
Copy link
Contributor Author

#1112 should take care of it, though we may also want to figure out why those users are present in the first place.

@timmc-edx
Copy link
Contributor Author

Answer: I didn't delete the old mysql80_volume, and must have provisioned before. The images (well really, the mounted volumes) do start off without users, but we don't have a way of cleaning up when resetting devstack. Filed an issue for that: #1113

@robrap robrap closed this as completed Jun 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Report of or fix for something that isn't working as intended
Projects
None yet
Development

No branches or pull requests

2 participants