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

[4.4.5]: shell / CLI database backup error (mysqldump) #13014

Closed
jeromecoupe opened this issue Mar 30, 2023 · 2 comments
Closed

[4.4.5]: shell / CLI database backup error (mysqldump) #13014

jeromecoupe opened this issue Mar 30, 2023 · 2 comments
Assignees

Comments

@jeromecoupe
Copy link
Contributor

jeromecoupe commented Mar 30, 2023

What happened?

Description

Error when triggering database backups via the CLI (Fortrabbit hosting). Using this as part of a CI process from Github Actions. Seems to be a problem with mysqldump.

mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need (at least one of) the RELOAD privilege(s)

Here are all the commands I run after local update and rsync.

php craft db/backup
php craft migrate/all
php craft project-config/apply
php craft clear-caches/all

Steps to reproduce

Run php craft db/backup before or after an update on the production server via shell/ssh

Expected behavior

Backups should happen without error.

Actual behavior

Shell command errors out with the following message:

The shell command "mysqldump --defaults-file="/tmp/vjgznbtozfzv.cnf" --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --default-character-set=utf8 --set-charset --triggers --no-tablespaces --single-transaction --no-data --result-file="/srv/app/iad/htdocs/storage/backups/*********--v4.4.5.sql" **** && mysqldump --defaults-file="/tmp/vjgznbtozfzv.cnf" --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --default-character-set=utf8 --set-charset --triggers --no-tablespaces --single-transaction --no-create-info --ignore-table=***.assetindexdata --ignore-table=***.imagetransformindex --ignore-table=***.resourcepaths --ignore-table=***.sessions --ignore-table=***.cache iad >> "/srv/app/***/htdocs/storage/backups/*********--v4.4.5.sql"" failed with exit code 2: mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need (at least one of) the RELOAD privilege(s) for this operation (1227)

Whether I run the command as part of the deployment pipeline or while connected to the box via SSH, I get the same error. I can, however, create a dump of the DB via Sequel Ace.

Is there anything I can do to get the situation back to normal ? This used to work flawlessly until now.

mysqldump version

Checked that mysqldump is installed. Here is what I get when running mysqldump --version on the production server.

mysqldump Ver 10.13 Distrib 5.7.41, for Linux (x86_64)

Craft CMS version

4.4.5

PHP version

8.1.17

Operating system and version

Linux 4.15.0-1146-aws

Database type and version

MySQL 5.7.38

Image driver and version

Imagick 3.7.0 (ImageMagick 7.1.1-3)

Installed plugins and versions

  • Feed Me 5.1.1.1
  • Redactor 3.0.4
@jeromecoupe jeromecoupe changed the title [4.4.5]: shell backups error [4.4.5]: shell backups error (php craft db/backup) Mar 30, 2023
@jeromecoupe jeromecoupe changed the title [4.4.5]: shell backups error (php craft db/backup) [4.4.5]: shell / CLI backups error php craft db/backup Mar 30, 2023
@jeromecoupe jeromecoupe changed the title [4.4.5]: shell / CLI backups error php craft db/backup [4.4.5]: shell / CLI database backup error (mysqldump) Mar 30, 2023
@jeromecoupe
Copy link
Contributor Author

jeromecoupe commented Mar 30, 2023

Right. It seems Fortrabbit updated their mysqldump version to 5.7.41 which has a bug. I had the (awesome) support staff over there and, apparently, the workaround in the Craft codebase doesn't correctly detect their affected mysqldump version.

Rollback scheduled on their end.

Fortrabbit service statuses for EU and US.

@angrybrad
Copy link
Member

@jeromecoupe thanks for that - I commented over on the PR, but the tl/dr is I don’t think checking the mysqldump version in our workaround would solve the underlying issue. Going to close this out, as I don’t think there's anything else we can do to work around it, but will keep following along for any feedback.

@angrybrad angrybrad self-assigned this Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants