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.x]: Couldn't backup db #15090

Closed
Vandemonica opened this issue May 28, 2024 · 8 comments
Closed

[4.x]: Couldn't backup db #15090

Vandemonica opened this issue May 28, 2024 · 8 comments
Assignees

Comments

@Vandemonica
Copy link

Vandemonica commented May 28, 2024

What happened?

I'm preparing to upgrade my project into 5.x, however after I performed update to 4.9.5 the backup always failed whether it was the one on migrate/all or when I ran db/backup command

Backing up the database ... error: The shell command "mysqldump "--defaults-file"="C:\Users\Nircahya\AppData\Local\Temp\cvgbekafgzcc.cnf" "--add-drop-table" "--comments" "--create-options" "--dump-date" "--no-autocommit" "--routines" "--default-character-set"="utf8" "--set-charset" "--triggers" "--no-tablespaces" "--column-statistics"="0" "--no-data" "--result-file"="D:\Workspace\www\myproject\storage\backups\craftcms-myproject--2024-05-28-222447--v4.9.5.sql" "my_project_db" && mysqldump "--defaults-file"="C:\Users\Nircahya\AppData\Local\Temp\cvgbekafgzcc.cnf" "--add-drop-table" "--comments" "--create-options" "--dump-date" "--no-autocommit" "--routines" "--default-character-set"="utf8" "--set-charset" "--triggers" "--no-tablespaces" "--column-statistics"="0" "--no-create-info" "--ignore-table"="my_project_db.cs_assetindexdata" "--ignore-table"="my_project_db.cs_cache" "--ignore-table"="my_project_db.cs_imagetransformindex" "--ignore-table"="my_project_db.cs_resourcepaths" "--ignore-table"="my_project_db.cs_phpsessions" "--ignore-table"="my_project_db.cs_sessions" "my_project_db" >> 'D:\Workspace\www\myproject\storage\backups\myproject--2024-05-28-222447--v4.9.5.sql'" failed with exit code 1.
Aborting.

I couldn't find anything interesting in the logs but another thing to take a note is I was able to do backup normally on 4.7.1, let me know if I need to show something

Craft CMS version

Craft Solo 4.9.5

PHP version

8.2.19

Operating system and version

WINNT 10.0

Webserver and version

Nginx 1.22.1

Database type and version

MySQL 8.0.32

Image driver and version

GD 8.2.19

Installed plugins and versions

  • Admin Bar: 4.3.0
  • Asset Rev: 7.0.0
  • AsyncQueue: 3.2.1
  • Blitz Recommendations: 2.2.1
  • CP Field Inspect: 1.4.4
  • Disqus: 4.0.0
  • Dumper: 5.0.1
  • Environment Label: 4.0.3
  • FastCGI Cache Bust: 4.0.1
  • Feed Me: 5.5.0
  • Field Manager: 3.0.8
  • Google Cloud Storage: 2.2.0
  • Logs: 4.0.1
  • Navigation: 2.0.27
  • Ray: 2.1.1
  • Redactor: 3.0.4
  • Retcon: 2.7.5
  • SEOMate: 2.2.1
  • Sherlock: 4.5.0
  • Sprig: 2.8.1
  • Super Table: 3.0.14
  • Template Select: 3.0.0
  • Typed link field: 2.1.5
  • Wordsmith: 4.4.0
@timkelty
Copy link
Contributor

@Vandemonica are you running this via DDEV, or something else?

@Vandemonica
Copy link
Author

no, just the normal craft command, ran with windows 10 CMD

this one

php craft db/backup

@angrybrad
Copy link
Member

angrybrad commented May 30, 2024

@Vandemonica Sorry... does that mean Craft is installed on your native Windows host OS and you've installed Apache or are using IIS and MySQL on the host machine? i.e. no WSL, Lando, WAMP, etc.

I'm unable to reproduce with DDEV on Windows, so trying to get as close to your setup as possible.

@angrybrad angrybrad self-assigned this May 30, 2024
@Vandemonica
Copy link
Author

Kinda, I used Laragon with Nginx 1.22.1 as webserver

@mmc501
Copy link

mmc501 commented Jun 3, 2024

I have just upgraded to 4.9.5 from 4.8.something and I am getting the same issue when I try to run a backup.
I also got the same on a Craft 5 installation.

2024-06-03 13:38:33 [web.ERROR] [yii\base\Exception] yii\base\Exception: Could not create backup: The shell command "mysqldump "--defaults-file"="C:\windows\TEMP\hoxexocbnxig.cnf" "--add-drop-table" "--comments" "--create-options" "--dump-date" "--no-autocommit" "--routines" "--default-character-set"="utf8" "--set-charset" "--triggers" "--no-tablespaces" "--single-transaction" "--column-statistics"="0" "--no-data" "--result-file"="C:\Websites\Sitename\storage\backups\iakoe--2024-06-03-123833--v4.9.5.sql" "sitename" && mysqldump "--defaults-file"="C:\windows\TEMP\hoxexocbnxig.cnf" "--add-drop-table" "--comments" "--create-options" "--dump-date" "--no-autocommit" "--routines" "--default-character-set"="utf8" "--set-charset" "--triggers" "--no-tablespaces" "--single-transaction" "--column-statistics"="0" "--no-create-info" "--ignore-table"="sitename.craft_assetindexdata" "--ignore-table"="sitename.craft_cache" "--ignore-table"="sitename.craft_imagetransformindex" "--ignore-table"="sitename.craft_resourcepaths" "--ignore-table"="sitename.craft_phpsessions" "--ignore-table"="sitename.craft_sessions" "sitename" >> 'C:\Websites\Sitename\storage\backups\iakoe--2024-06-03-123833--v4.9.5.sql'" failed with exit code 1. in C:\Websites\Sitename\vendor\craftcms\cms\src\controllers\UtilitiesController.php:226

Also running on windows, but just the default IIS & MySQL.
I think this may be the issue:

"--defaults-file"="C:\windows\TEMP\hoxexocbnxig.cnf"
I don't see that file existing.

When I remove that from the command and run it in a Command Window it backs up fine.

@brandonkelly
Copy link
Member

Thanks @mmc501! We were able to reproduce, and have fixed it for the next release.

You can test by changing your craftcms/cms requirement in composer.json to 4.x-dev as 4.9.6 and running composer update.

@mmc501
Copy link

mmc501 commented Jun 5, 2024

Thanks @brandonkelly, tried that and issue is resolved. Thanks

@brandonkelly
Copy link
Member

Thanks for confirming, @mmc501! Craft 4.9.7 and 5.1.9 are out now with that fix.

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

5 participants