Uh Oh! We ran into an issue when pushing to WP Engine - mysql Dump Fails

What issue or error are you experiencing?

Can no longer push to WP Engine from Local.

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

Push.


System Details

Version 9.0.5+6706

Windows 10


Local Logs

401 Warnings

{“class”:“CAPIService”,“level”:“warn”,“message”:“Error creating backup: Response returned an error code. 401 Unauthorized”,“name”:“ResponseBodyError”,“response”:{},“responseJson”:{“message”:“Bad Credentials”},“stack”:“ResponseBodyError: Error creating backup: Response returned an error code. 401 Unauthorized\n at %%appPath%%\main\capi\CAPIService.js:1:2030\n at Generator.next ()\n at %%appPath%%\main\capi\CAPIService.js:1:1047\n at new Promise ()\n at __awaiter (%%appPath%%\main\capi\CAPIService.js:1:792)\n at maybeFormatResponseError (%%appPath%%\main\capi\CAPIService.js:1:1943)\n at CAPIService. (%%appPath%%\main\capi\CAPIService.js:1:6927)\n at Generator.throw ()\n at a (%%appPath%%\main\capi\CAPIService.js:1:900)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)”,“thread”:“main”,“timestamp”:“2024-07-10T20:10:07.166Z”}

{“class”:“WPEPushService”,“level”:“warn”,“message”:“Failed to backup to WP Engine. This will not prevent the site from attempting to push. Error creating backup: Response returned an error code. 401 Unauthorized”,“name”:“ResponseBodyError”,“response”:{},“responseJson”:{“message”:“Bad Credentials”},“stack”:“ResponseBodyError: Error creating backup: Response returned an error code. 401 Unauthorized\n at %%appPath%%\main\capi\CAPIService.js:1:2030\n at Generator.next ()\n at %%appPath%%\main\capi\CAPIService.js:1:1047\n at new Promise ()\n at __awaiter (%%appPath%%\main\capi\CAPIService.js:1:792)\n at maybeFormatResponseError (%%appPath%%\main\capi\CAPIService.js:1:1943)\n at CAPIService. (%%appPath%%\main\capi\CAPIService.js:1:6927)\n at Generator.throw ()\n at a (%%appPath%%\main\capi\CAPIService.js:1:900)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)”,“thread”:“main”,“timestamp”:“2024-07-10T20:10:07.167Z”}

Sql Dump Error

{“class”:“WPEPushService”,“error”:{},“level”:“error”,“message”:“Error in WP Engine connect”,“sentryEventId”:“5056c55977bd408d95786888bf4072b0”,“stack”:“Error: mysqldump exited with non-zero exit code: 2\n at SiteDatabaseService. (%%appPath%%\main\sites\database\SiteDatabaseService.js:1:2684)\n at Generator.next ()\n at s (%%appPath%%\main\sites\database\SiteDatabaseService.js:1:849)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)”,“thread”:“main”,“timestamp”:“2024-07-10T20:10:22.046Z”}

How can I debug mysql to figure out why the dump failed?

The 401’s are strange given that most functionality in Local is still working. Can still evaluate file differences for example.

Have tried turnings things off and on, reconnecting credentials etc. Have tried running Local as admin.

Push used to work before this.

Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @jme77

As a test and to get you back up and running can you try downgrading back to 9.0.4 and see if that works?

Hi @Nick-B,

I first noticed this issue on 9.0.4.
I tried upgrading to 9.0.5 as part of my troubleshooting.

Edit:

I just tried downgrading to 9.0.2 and get the same.

{"class":"addIpcAsyncListener","level":"warn","message":"Duplicate callback appears to be getting added to connectManifestWpeService:create","stringifiedCallback":"(e,t,i,n,s,r,a,o)=>this.create(e,t,i,n,s,r,a,o)","thread":"main","timestamp":"2024-07-10T20:47:12.120Z"}
{"level":"warn","linuxEdition":null,"localVersion":"9.0.5+6706","message":"Electron Event ready","osArch":"x64","osPlatform":"win32","osRelease":"10.0.19045","timestamp":"2024-07-10T20:47:12.676Z","windowsEdition":"Microsoft Windows 10 Pro"}
{"class":"addIpcAsyncListener","level":"warn","message":"Duplicate callback appears to be getting added to connectManifestWpeService:create","stringifiedCallback":"(e,t,i,n,s,r,a,o)=>this.create(e,t,i,n,s,r,a,o)","thread":"main","timestamp":"2024-07-11T12:52:55.067Z"}
{"level":"warn","linuxEdition":null,"localVersion":"9.0.5+6706","message":"Electron Event ready","osArch":"x64","osPlatform":"win32","osRelease":"10.0.19045","timestamp":"2024-07-11T12:52:56.889Z","windowsEdition":"Microsoft Windows 10 Pro"}
{"class":"Process","level":"warn","message":"2024-07-11T12:55:42.623205Z 0 [System] [MY-010116] [Server] %%userDataPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqld.exe (mysqld 8.0.16) starting as process 16992","process":"mysql","thread":"main","timestamp":"2024-07-11T12:55:44.882Z"}
{"class":"Process","level":"warn","message":"2024-07-11T12:55:42.647898Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","process":"mysql","thread":"main","timestamp":"2024-07-11T12:55:44.882Z"}
{"class":"Process","level":"warn","message":"2024-07-11T12:55:44.187319Z 0 [System] [MY-010229] [Server] Starting crash recovery...","process":"mysql","thread":"main","timestamp":"2024-07-11T12:55:44.882Z"}
{"class":"Process","level":"warn","message":"2024-07-11T12:55:44.192265Z 0 [System] [MY-010232] [Server] Crash recovery finished.","process":"mysql","thread":"main","timestamp":"2024-07-11T12:55:44.883Z"}
{"class":"Process","level":"warn","message":"2024-07-11T12:55:44.837979Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","process":"mysql","thread":"main","timestamp":"2024-07-11T12:55:44.883Z"}
{"class":"Process","level":"warn","message":"2024-07-11T12:55:44.882278Z 0 [System] [MY-010931] [Server] %%userDataPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqld.exe: ready for connections. Version: '8.0.16'  socket: ''  port: 10032  MySQL Community Server - GPL.","process":"mysql","thread":"main","timestamp":"2024-07-11T12:55:44.884Z"}
{"class":"addIpcAsyncListener","level":"warn","message":"Duplicate callback appears to be getting added to connectManifestWpeService:create","stringifiedCallback":"(e,t,i,n,s,r,a,o)=>this.create(e,t,i,n,s,r,a,o)","thread":"main","timestamp":"2024-07-11T13:29:59.068Z"}
{"level":"warn","linuxEdition":null,"localVersion":"9.0.2+6676","message":"Electron Event ready","osArch":"x64","osPlatform":"win32","osRelease":"10.0.19045","timestamp":"2024-07-11T13:29:59.697Z","windowsEdition":"Microsoft Windows 10 Pro"}
{"class":"Process","level":"warn","message":"2024-07-11T13:30:50.168506Z 0 [System] [MY-010116] [Server] %%userDataPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqld.exe (mysqld 8.0.16) starting as process 1824","process":"mysql","thread":"main","timestamp":"2024-07-11T13:30:51.808Z"}
{"class":"Process","level":"warn","message":"2024-07-11T13:30:50.173568Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","process":"mysql","thread":"main","timestamp":"2024-07-11T13:30:51.808Z"}
{"class":"Process","level":"warn","message":"2024-07-11T13:30:51.088016Z 0 [System] [MY-010229] [Server] Starting crash recovery...","process":"mysql","thread":"main","timestamp":"2024-07-11T13:30:51.808Z"}
{"class":"Process","level":"warn","message":"2024-07-11T13:30:51.093500Z 0 [System] [MY-010232] [Server] Crash recovery finished.","process":"mysql","thread":"main","timestamp":"2024-07-11T13:30:51.808Z"}
{"class":"Process","level":"warn","message":"2024-07-11T13:30:51.767523Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","process":"mysql","thread":"main","timestamp":"2024-07-11T13:30:51.809Z"}
{"class":"Process","level":"warn","message":"2024-07-11T13:30:51.808475Z 0 [System] [MY-010931] [Server] %%userDataPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqld.exe: ready for connections. Version: '8.0.16'  socket: ''  port: 10032  MySQL Community Server - GPL.","process":"mysql","thread":"main","timestamp":"2024-07-11T13:30:51.809Z"}
{"class":"CAPIService","level":"warn","message":"Error creating backup: Response returned an error code. 401 Unauthorized","name":"ResponseBodyError","response":{},"responseJson":{"message":"Bad Credentials"},"stack":"ResponseBodyError: Error creating backup: Response returned an error code. 401 Unauthorized\n    at %%appPath%%\\main\\capi\\CAPIService.js:1:2030\n    at Generator.next (<anonymous>)\n    at %%appPath%%\\main\\capi\\CAPIService.js:1:1047\n    at new Promise (<anonymous>)\n    at __awaiter (%%appPath%%\\main\\capi\\CAPIService.js:1:792)\n    at maybeFormatResponseError (%%appPath%%\\main\\capi\\CAPIService.js:1:1943)\n    at CAPIService.<anonymous> (%%appPath%%\\main\\capi\\CAPIService.js:1:6927)\n    at Generator.throw (<anonymous>)\n    at a (%%appPath%%\\main\\capi\\CAPIService.js:1:900)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","thread":"main","timestamp":"2024-07-11T13:33:03.206Z"}
{"class":"WPEPushService","level":"warn","message":"Failed to backup to WP Engine. This will not prevent the site from attempting to push. Error creating backup: Response returned an error code. 401 Unauthorized","name":"ResponseBodyError","response":{},"responseJson":{"message":"Bad Credentials"},"stack":"ResponseBodyError: Error creating backup: Response returned an error code. 401 Unauthorized\n    at %%appPath%%\\main\\capi\\CAPIService.js:1:2030\n    at Generator.next (<anonymous>)\n    at %%appPath%%\\main\\capi\\CAPIService.js:1:1047\n    at new Promise (<anonymous>)\n    at __awaiter (%%appPath%%\\main\\capi\\CAPIService.js:1:792)\n    at maybeFormatResponseError (%%appPath%%\\main\\capi\\CAPIService.js:1:1943)\n    at CAPIService.<anonymous> (%%appPath%%\\main\\capi\\CAPIService.js:1:6927)\n    at Generator.throw (<anonymous>)\n    at a (%%appPath%%\\main\\capi\\CAPIService.js:1:900)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","thread":"main","timestamp":"2024-07-11T13:33:03.206Z"}
{"class":"WPEPushService","error":{},"level":"error","message":"Error in WP Engine connect","sentryEventId":"9df8f5eb201b4616a5623097a875d9d1","stack":"Error: mysqldump exited with non-zero exit code: 2\n    at SiteDatabaseService.<anonymous> (%%appPath%%\\main\\sites\\database\\SiteDatabaseService.js:1:2684)\n    at Generator.next (<anonymous>)\n    at s (%%appPath%%\\main\\sites\\database\\SiteDatabaseService.js:1:849)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","thread":"main","timestamp":"2024-07-11T13:33:03.523Z"}

It is strange the 401 error says it failed to create the backup, but the backups are getting created in WP Engine.

Seems like the API is having issues.

That 401 backups message is something of a false positive in the logs so I wouldn’t worry about that specifically.

Did your API Access on the WPE side get disabled by chance?

Is this the only site you have? Curious if it’s happening for a specific site or any site.

Do you utilize a VPN or office network for connecting?

Yeah.

It says it’s still active, but looks like there may be some bug-action with the invalid created date?

I have noticed this is happening on all sites.

No office network or vpn at play here.

The only real lead we have is mysql failing to dump with error code 2.

Error 2 in MySQL is a file-related error indicating that MySQL is unable to locate or open a file specified in a command. This often happens due to incorrect file paths, permission issues, or file existence.

As a workaround for now in place of pushing you could use the WPE Migration plugin for moving sites from Local to WPE. It won’t pull but you could use the direct import feature to get a backup in.

Back to the issue at hand could you try this workflow to test as a refresh?

  • Log out of WPE in Local app
  • Quit Local app
  • Disable API Access in WPE Dashboard
  • Restart machine
  • Enable API Access in WPE
  • Open up Local and log back into WPE account
  • Test again

After that if it still fails the same please share us a full local log here with the Zip file downloaded from the app. If you’d prefer not to share that here I can DM you to collect it!

Thanks, I’ll try the manual migration in the meantime.

I followed the workflow there and we get no change.
I’ll DM you the log zip.

I think we would need to know at what filepath the mysql dump is trying to write to next. Seems like there is an issue there

When you say “we” are you working with others who are all experiencing the same issues?

No, I say “we” as the two of us working on this problem. :slight_smile:

1 Like

@jme77 Could you start your site, click Open Shell and run this command below:

mysqldump --verbose --extended-insert=FALSE local

If you see an error, please share it. If you only see a long list of SQL statements ending with “Dump completed on…”, please also let us know.

1 Like

Sure thing, this is the error.

I fixed it.

There was a view with the undefined user on it.
I edited the view in AdminerEvo and resaved it, which changes the user.
Now it dumps successfully, push is running now.

It would be good if Local can check views when pulling down a database.

1 Like

Great find and thank you for sharing @jme77! I’ll pass this along to the Devs.

1 Like

Awesome, thanks for all your help! Sounds good!

1 Like