Can't Push information on server after uploading Local

I uploaded Local to version Version 8.3.2+6660
I can’t pushing information to server. I got this problem.

local-lightning.log (67.6 KB)
error.log (470.1 KB)

What shood I do ?

Thanks for the report and for sharing your logs, @BlackStar1991.

The logs show that dumping the Local database before pushing it to the remote failed:

"error","message":"Unable to dump database.","stack":"Error: mysqldump exited with non-zero exit code: 2

It’s worth restarting the machine in case this is a temporary file write issue.

If that doesn’t help, is the database big? (You can find out by opening a site shell in Local and running wp db size --size_format=MB to get the database size in MB.) If it’s larger than their available free disk space, freeing space could help

You can also try running: wp db check and wp db repair in case any of the tables are corrupted.

If these ideas don’t help, you may need to try exporting your database locally with another tool and updating it separately to the file push.

I don’t know what is large database for WPEngine.
It’s 78Mb. Is it big for Local ? How to work with it ?

Your database isn’t that large so there could be some other culprit at play.

Is it just this specific site you’re having trouble pushing or is it any site?

Can you try logging out, disconnecting from WP Engine, quitting Local and restarting your machine, and then going back in and starting everything back up and seeing it will connect and push?

I am having the same issue on the same version. Any attempt to push the database results in this error -

 {"class":"WPEPushService","error":{},"level":"error","message":"Error in WP Engine connect","sentryEventId":"1d6f1fe5fb644227a7fb272cb9b71530","stack":"Error: mysqldump exited with non-zero exit code: 2\n   ............

I have tried to disconnect all services, restart, and reconnect all services in the order you described. No change in behavior.

Opening site shell to attemp to run wp db check or repair results in this error -

'mysqlcheck' is not recognized as an internal or external command,
operable program or batch file.

Any help would be appreciated, as I made many changes to this database believing Local would be as smooth with db’s as it is with files :frowning:

Only for this project.
Your recommendations unfortunately did not help

Please could you start your site, click “open site shell” and run the command below, @BlackStar1991 and/or @WillMitchell?

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.

$ mysqldump --verbose --extended-insert=FALSE local
-- Connecting to ::1...
-- MySQL dump 10.13  Distrib 8.0.16, for Win64 (x86_64)
--
-- Host: ::1    Database: local
-- ------------------------------------------------------
-- Server version       8.0.16

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
 SET NAMES utf8mb4 ;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
mysqldump: Got error: 1449: The user specified as a definer ('compudimewsstg'@'127.0.0.1') does not exist when using LOCK TABLES

I saw it

1 Like

Thank you, @BlackStar1991 — it’s helpful to see that error.

Your database seems to contain views, stored procedures, triggers, or events created by a user from another source that Local does not have a matching user for. It’s not common to see these in regular WordPress databases, so they may have been introduced by a plugin, but let’s try to fix this for you…

Please could you try running these commands from the site shell?

  1. Type mysql to connect to MySQL. You should see the mysql> prompt.
  2. Copy and paste these commands after the mysql> prompt, pressing enter after each command:
    CREATE USER 'compudimewsstg'@'127.0.0.1' IDENTIFIED BY 'password';
    
  3. Then this one:
    GRANT ALL PRIVILEGES ON local.* TO 'compudimewsstg'@'127.0.0.1';
    
  4. And finally:
    FLUSH PRIVILEGES;
    
  5. Type exit to leave the MySQL prompt.
  6. Try running the same command as before in the shell (check you exited mysql first, you should no longer be typing this command after mysql>):
    mysqldump --verbose --extended-insert=FALSE local
    

If that now ends with “Dump completed on…”, you could try pushing your database via Local again. If you see further errors please let us know.

2

What do I make wrong ? This command don’t work for me.

Try this instead:

CREATE USER IF NOT EXISTS 'compudimewsstg'@'127.0.0.1' IDENTIFIED BY 'password';

Then continue with step 3.

Deeply appreciate your quick help @nickc .

mysqldump was generating the same error for me as @BlackStar1991 (except with a different user of course). But I had left Local running overnight on my PC, so I went ahead and closed & re-opened it.

Somehow mysqldump command started working. The dump was fully completed with a success message. Wish I knew what fixed it!

Then tried to push from Local to WP Engine again. Now I get a new error -

{"class":"SshService","level":"warn","message":"ERROR 1227 (42000) at line 124897: Access denied; you need (at least one of) the SUPER or SET_USER_ID privilege(s) for this operation\n","thread":"main","timestamp":"2024-03-27T17:58:06.943Z"}
{"class":"WPEPushService","error":{},"level":"error","message":"Error in WP Engine connect","sentryEventId":"bd06c7b47686409aaef69b3f54a59a8d","stack":"Error: ssh process existed with code 1\n    at ChildProcess.<anonymous> 

I’m also getting these errors earlier in the process…

{"class":"SshService","level":"warn","message":"Warning: Permanently added 'startupbros.ssh.wpengine.net' (RSA) to the list of known hosts.\r\n","thread":"main","timestamp":"2024-03-27T17:24:10.912Z"}
{"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:6608)\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-03-27T17:24:44.315Z"}
{"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:6608)\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-03-27T17:24:44.316Z"}
{"class":"SshService","level":"warn","message":"Warning: Permanently added 'startupbros.ssh.wpengine.net' (RSA) to the list of known hosts.\r\n","thread":"main","timestamp":"2024-03-27T17:24:55.181Z"}
{"class":"SshService","level":"warn","message":"Warning: Permanently added 'startupbros.ssh.wpengine.net' (RSA) to the list of known hosts.\r\n","thread":"main","timestamp":"2024-03-27T17:25:11.601Z"}
{"class":"RsyncService","level":"warn","message":"Failed to add the host to the list of known hosts (/cygdrive/c/Users/Will).\r\n","thread":"main","timestamp":"2024-03-27T17:25:23.008Z"}
{"class":"SshService","level":"warn","message":"Warning: Permanently added 'startupbros.ssh.wpengine.net' (RSA) to the list of known hosts.\r\n","thread":"main","timestamp":"2024-03-27T17:25:51.401Z"}

(given the errors above, I reached out to WP Engine to confirm my PHP / WP Versions. WP is 6.4.3 on both, but PHP is 8.2.10 on local and 8.2.14 on WP Engine.)

Since I am able to run mysqldump from site shell, I am assuming this issue has to do with how it’s being pushed to WP Engine. So I went ahead and did 2 hard disconnects/reconnects as thoroughly as I could. The errors remain.

Just for kicks, I also tried to run the commands you recommended for @BlackStar1991 (except with my db username, as pulled from wp-config.php on the live site). This did not change anything.

Here is my full verbose error logs for the entire process. Again, it seems that the database is being handled successfully on the local end - but something is going wrong when importing the database in the remove (WP Engine) environment -

{"level":"debug","message":"Database responded to ping.","service":{},"serviceBinVersion":{},"thread":"main","timestamp":"2024-03-27T19:41:52.672Z"}
{"class":"WordPressInstaller","level":"info","message":"\"WP_ENVIRONMENT_TYPE\" already set to \"local\"","thread":"main","timestamp":"2024-03-27T19:42:03.177Z"}
{"level":"debug","message":"Database responded to ping.","service":{},"serviceBinVersion":{},"thread":"main","timestamp":"2024-03-27T19:42:03.410Z"}
{"class":"CAPIService","level":"info","message":"Creating backup for install 01509c86-d820-4f80-9973-76878ec78fab","thread":"main","timestamp":"2024-03-27T19:42:03.565Z"}
{"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:6608)\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-03-27T19:42:04.115Z"}
{"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:6608)\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-03-27T19:42:04.116Z"}
{"class":"SSHKeyService","level":"info","message":"Retrieving SSH Public Key from disk...","thread":"main","timestamp":"2024-03-27T19:42:04.117Z"}
{"class":"SSHKeyService","level":"info","message":"No SSH Public Key file exists.","thread":"main","timestamp":"2024-03-27T19:42:04.117Z"}
{"class":"SSHKeyService","level":"info","message":"Retrieving SSH Public Key from disk...","thread":"main","timestamp":"2024-03-27T19:42:05.142Z"}
{"class":"CAPIService","level":"info","message":"Creating new SSH public key for WP Engine...","thread":"main","timestamp":"2024-03-27T19:42:05.148Z"}
{"class":"WPEPushService","level":"info","message":"Dumping local database to C:\\Users\\Will Mitchell\\Local Sites\\startupbroscom-main-site\\app\\public\\_wpeprivate\\autoload.sql","thread":"main","timestamp":"2024-03-27T19:42:05.391Z"}
{"class":"WPEPushService","level":"info","message":"Creating backup of remote database at sites/startupbros/_wpeprivate/push-1711568527027.sql","thread":"main","timestamp":"2024-03-27T19:42:07.028Z"}
{"class":"SshService","level":"debug","message":"Running SSH with following args: '-F', '/dev/null', '-o', 'IdentitiesOnly=yes', '-o', 'PubkeyAcceptedKeyTypes=+ssh-rsa', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=30m', '-o', 'ServerAliveInterval=60', '-o', 'ServerAliveCountMax=120', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-i', '%%userDataPath%%\\ssh\\wpe-connect', 'local+db+push+startupbros@startupbros.ssh.wpengine.net', ''wp --skip-plugins --skip-themes db export --no-tablespaces=true sites/startupbros/_wpeprivate/push-1711568527027.sql && echo \"table_prefix=$(wp config get table_prefix)\"''","thread":"main","timestamp":"2024-03-27T19:42:07.028Z"}
{"class":"SshService","level":"warn","message":"Warning: Permanently added 'startupbros.ssh.wpengine.net' (RSA) to the list of known hosts.\r\n","thread":"main","timestamp":"2024-03-27T19:42:07.505Z"}
{"class":"RouterService","level":"debug","message":"Running proxyManager::add","thread":"main","timestamp":"2024-03-27T19:42:09.326Z"}
{"class":"X509CertService","level":"debug","message":"startupbroscom-main-site.local.key already exists. Skipping certificate creation.","thread":"main","timestamp":"2024-03-27T19:42:09.328Z"}
{"class":"Process","level":"verbose","message":"Spawned","pid":19156,"process":"nginx","thread":"main","timestamp":"2024-03-27T19:42:09.333Z"}
{"class":"HostsFileService","level":"debug","message":"Hosts do not need updating","thread":"main","timestamp":"2024-03-27T19:42:10.025Z"}
{"class":"WPEPushService","level":"info","message":"Resetting remote database.","thread":"main","timestamp":"2024-03-27T19:42:28.732Z"}
{"class":"SshService","level":"debug","message":"Running SSH with following args: '-F', '/dev/null', '-o', 'IdentitiesOnly=yes', '-o', 'PubkeyAcceptedKeyTypes=+ssh-rsa', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=30m', '-o', 'ServerAliveInterval=60', '-o', 'ServerAliveCountMax=120', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-i', '%%userDataPath%%\\ssh\\wpe-connect', 'local+db+push+startupbros@startupbros.ssh.wpengine.net', ''wp db reset --yes --skip-plugins --skip-themes''","thread":"main","timestamp":"2024-03-27T19:42:28.732Z"}
{"class":"SshService","level":"warn","message":"Warning: Permanently added 'startupbros.ssh.wpengine.net' (RSA) to the list of known hosts.\r\n","thread":"main","timestamp":"2024-03-27T19:42:29.232Z"}
{"class":"WPEPushService","level":"info","message":"Uploading local database dump...","thread":"main","timestamp":"2024-03-27T19:42:42.765Z"}
{"class":"RsyncService","level":"debug","message":"Running rsync with following args: '-avzum', '--relative', '-e', 'ssh -F /dev/null -o IdentitiesOnly=yes -o PubkeyAcceptedKeyTypes=+ssh-rsa -o ServerAliveInterval=60 -o ServerAliveCountMax=120 -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=\"/cygdrive/c/Users/Will Mitchell/.ssh/known_hosts\"  -i \"%%userDataPath%%\\ssh\\wpe-connect\"', '/cygdrive/c/Users/Will Mitchell/Local Sites/startupbroscom-main-site/app/public/./_wpeprivate/autoload.sql', 'local+rsync+startupbros@startupbros.ssh.wpengine.net:/sites/startupbros/'","thread":"main","timestamp":"2024-03-27T19:42:42.766Z"}
{"class":"RsyncService","level":"warn","message":"Failed to add the host to the list of known hosts (/cygdrive/c/Users/Will).\r\n","thread":"main","timestamp":"2024-03-27T19:42:43.367Z"}
{"class":"WPEPushService","level":"info","message":"Importing database in remote environment, deleting dump file, and replacing local URL.","thread":"main","timestamp":"2024-03-27T19:42:57.574Z"}
{"class":"SshService","level":"debug","message":"Running SSH with following args: '-F', '/dev/null', '-o', 'IdentitiesOnly=yes', '-o', 'PubkeyAcceptedKeyTypes=+ssh-rsa', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=30m', '-o', 'ServerAliveInterval=60', '-o', 'ServerAliveCountMax=120', '-o', 'StrictHostKeyChecking=no', '-o', 'UserKnownHostsFile=/dev/null', '-i', '%%userDataPath%%\\ssh\\wpe-connect', 'local+db+push+startupbros@startupbros.ssh.wpengine.net', ''mysql wp_startupbros < /sites/startupbros/_wpeprivate/autoload.sql && rm /sites/startupbros/_wpeprivate/autoload.sql && wp search-replace //startupbroscom-main-site.local //startupbros.com --skip-columns=guid --precise --skip-plugins --skip-themes --all-tables''","thread":"main","timestamp":"2024-03-27T19:42:57.574Z"}
{"class":"SshService","level":"warn","message":"Warning: Permanently added 'startupbros.ssh.wpengine.net' (RSA) to the list of known hosts.\r\n","thread":"main","timestamp":"2024-03-27T19:42:57.973Z"}
{"class":"SshService","level":"warn","message":"ERROR 1227 (42000) at line 124926: Access denied; you need (at least one of) the SUPER or SET_USER_ID privilege(s) for this operation\n","thread":"main","timestamp":"2024-03-27T19:48:08.786Z"}
{"class":"WPEPushService","error":{},"level":"error","message":"Error in WP Engine connect","sentryEventId":"cad299be29654689bafdfb7c09389caa","stack":"Error: ssh process existed with code 1\n    at ChildProcess.<anonymous> (%%appPath%%\\main\\ssh\\SshService.js:1:1938)\n    at ChildProcess.emit (node:events:513:28)\n    at ChildProcess._handle.onexit (node:internal/child_process:291:12)","thread":"main","timestamp":"2024-03-27T19:48:08.796Z"}
{"level":"debug","message":"Database responded to ping.","service":{},"serviceBinVersion":{},"thread":"main","timestamp":"2024-03-27T19:48:09.044Z"}

I’ll continue troubleshooting and update with any changes. Thanks again @nickc

===============================
UPDATE: It seems the db was successfully pushing after the mysqldump began successfully running, and my final error message is actually related to the Search & Replace function failing to run. I am not sure if anything else other than S&R failed to run. But I went ahead and manually did a Search & Replace on the local>remote site URLs, and everything seems to be working so far.

1 Like

It didn’t help to me. Unfortunately.


These commands had no effect on the base. Perhaps you have some other suggestions.

@BlackStar1991 Thanks for trying that. It’s expected to see “0 rows affected” after granting privileges. Did you try running the mysqldump again from the regular site shell (not the mysql> one) after making those changes?

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

Does it fail with the same error as before, or something new?


@WillMitchell Thanks for the update, I’m glad you were able to push in the end. Agree that it would be nice to figure out what happened, but feel free to check my notes below if you want to hunt for clues.


Both:
It might be worth finding out which plugin is using views/stored procedures and considering if you really need it or not, just to reduce the potential for push/pull failure in the future.

I haven’t yet found a way to adjust Local to ensure sites like yours that use views/procedures with hard-coded definers would just work. (mysqldump doesn’t yet offer a --skip-definer, which would be helpful here.)

Some ideas to find potential plugins using those features:

  • Search your wp-content/plugins folder locally for strings such as “CREATE VIEW” or “CREATE PROCEDURE”.
  • Open AdminerEvo from the Database tab in Local and check the contents of tables listed as “views” for any clues about what data they include to learn what plugin created them.

If you find those plugins, discontinuing use of them and removing any views/procedures from your database if they don’t clean up after themselves during the uninstall process could make pushes more reliable for you in the future. (It would be worth backing up your data via AdminerEvo or similar first if you need to make manual changes to the database.)

I’m sorry not to have a faster solution for you both at the moment.

I didn’t find how to upload my local version DB of site to the server so I make it by using phpMyAdmin and I got this message.


After I compressed the version of my local database using local.sql.gz (25Mb), I uploaded the database to the server, but with problems.

CREATE ALGORITHM=UNDEFINED DEFINER=`compudimewsstg`@`127.0.0.1` SQL SECURITY DEFINER VIEW `mqu_wsm_datewisevisitors` AS select date_format(convert_tz(`mqu_wsm_loguniquevisit`.`visitLastActionTime`,'+00:00','-04:00'),'%Y-%m-%d') AS `recordDate`,count(0) AS `visitors` from `mqu_wsm_loguniquevisit` group by date_format(convert_tz(`mqu_wsm_loguniquevisit`.`visitLastActionTime`,'+00:00','-04:00'),'%Y-%m-%d');

Your support has been fast and stellar. Thanks!

In the past, I have created and saved several views inside of phpmyadmin via WP Engine. They are just to help me quickly find autoloader content during db cleanup.

Would this potentially cause issues? I am going to delete these views just in case.

@BlackStar1991 The import error matches the one you’re seeing from Local, suggesting a view was created by a user that doesn’t exist on the remote (or vice versa). You may need to exclude the mqu_wsm_loguniquevisit view from your export before you can import the SQL file manually.

@WillMitchell Happy to help, and thanks for your perseverance with this. Yes, the custom views could explain the import failure. mysqldump will not exclude these by default, and if the user that created them (the “definer”) is not the same or has differing permissions on the remote and local, import can fail as you’ve seen. Removing them if they’re not needed or can be accomplished in other ways could improve the reliability of pushes/pulls from Local (as well as manual dumps/imports).

1 Like

Thank you, once I uploaded the database to the server with the specified user, the new commits started to upload without any issues.

1 Like