0

I'm trying to sync the database for my local Craft Nitro to the staging environment using SyncDB.

Here is the error,

[2021-06-04T15:49:51.623536+08:00] sync.NOTICE: Starting database sync [] []
[2021-06-04T15:49:51.624538+08:00] sync.INFO: Beginning remote dump [] []
[2021-06-04T15:49:51.625672+08:00] sync.ERROR: return non-zero: 127 [] []
[2021-06-04T15:49:51.625781+08:00] sync.ERROR: Failed on command: ssh username@mysite.com -p 22 "/usr/bin/php /var/www/html/mysite/craft sync-db/sync/dump normal 1" [] []
[2021-06-04T15:49:51.625841+08:00] sync.ERROR: sh: ssh: not found [] []
[2021-06-04T15:49:51.625921+08:00] sync.INFO: Beginning remote download [] []
[2021-06-04T15:49:51.626935+08:00] sync.ERROR: return non-zero: 127 [] []
[2021-06-04T15:49:51.627036+08:00] sync.ERROR: Failed on command: scp -P 22 username@mysite.com:/var/www/html/mysite/storage/backups/db_dump.sql.tar.gz /app/storage/backups/databases/db_dump.sql.tar.gz [] []
[2021-06-04T15:49:51.627088+08:00] sync.ERROR: sh: scp: not found [] []
[2021-06-04T15:49:51.627156+08:00] sync.INFO: Beginning delete remote file [] []
[2021-06-04T15:49:51.628334+08:00] sync.ERROR: return non-zero: 127 [] []
[2021-06-04T15:49:51.628417+08:00] sync.ERROR: Failed on command: ssh username@mysite.com -p 22 rm /var/www/html/mysite/storage/backups/db_dump.sql.tar.gz [] []
[2021-06-04T15:49:51.628463+08:00] sync.ERROR: sh: ssh: not found [] []
[2021-06-04T15:49:51.628510+08:00] sync.INFO: Beginning extract archive [] []
[2021-06-04T15:49:51.630506+08:00] sync.ERROR: return non-zero: 2 [] []
[2021-06-04T15:49:51.630609+08:00] sync.ERROR: Failed on command: cd /app/storage/backups/databases && tar -xzvf db_dump.sql.tar.gz [] []
[2021-06-04T15:49:51.630662+08:00] sync.ERROR: tar (child): db_dump.sql.tar.gz: Cannot open: No such file or directory [] []
[2021-06-04T15:49:51.630708+08:00] sync.ERROR: tar (child): Error is not recoverable: exiting now [] []
[2021-06-04T15:49:51.630801+08:00] sync.ERROR: tar: Child returned status 2 [] []
[2021-06-04T15:49:51.630847+08:00] sync.ERROR: tar: Error is not recoverable: exiting now [] []
[2021-06-04T15:49:51.630910+08:00] sync.INFO: Beginning import sql [] []
[2021-06-04T15:49:51.633151+08:00] sync.ERROR: return non-zero: 1 [] []
[2021-06-04T15:49:51.633235+08:00] sync.ERROR: Failed on command: mysql -u nitro -h mysql-5.6-3306.database.nitro -P 3306 --password="*****" mysitesite  < /app/storage/backups/databases/db_dump.sql [] []
[2021-06-04T15:49:51.633297+08:00] sync.INFO: Beginning remove local sql file [] []
[2021-06-04T15:49:51.643340+08:00] sync.ERROR: return non-zero: 1 [] []
[2021-06-04T15:49:51.643447+08:00] sync.ERROR: Failed on command: rm /app/storage/backups/databases/db_dump.sql [] []
[2021-06-04T15:49:51.643493+08:00] sync.ERROR: rm: can't remove '/app/storage/backups/databases/db_dump.sql': No such file or directory [] []
[2021-06-04T15:49:51.643539+08:00] sync.INFO: Beginning remove local archive [] []
[2021-06-04T15:49:51.645352+08:00] sync.ERROR: return non-zero: 1 [] []
[2021-06-04T15:49:51.645438+08:00] sync.ERROR: Failed on command: rm /app/storage/backups/databases/db_dump.sql.tar.gz [] []
[2021-06-04T15:49:51.645479+08:00] sync.ERROR: rm: can't remove '/app/storage/backups/databases/db_dump.sql.tar.gz': No such file or directory [] []
[2021-06-04T15:49:51.645515+08:00] sync.NOTICE: Database sync complete [] []
[2021-06-04T15:49:51.645552+08:00] sync.INFO: Craft SyncDB Complete [] []

I manage to access the command

ssh username@mysite.com -p 22

from my terminal, I unsure what is the issue and how can I resolve it?

Here is my local application info,

MySQL 5.6.51
PHP 7.4.16
OS version Linux 5.4.72-microsoft-standard-WSL2
Craft 3.6.13
Sync DB 0.8.0.1

Here is my staging application info,

MySQL 5.5.5
PHP 7.4.18
OS version Linux 5.4.0-1048-aws
Craft 3.6.13
Sync DB 0.8.0.1
6
  • 1
    I haven't used SyncDb before but from the screenshot, you have the Nitro MySQL server set up as Production, and trying to connect via SSH on port 3306. Port 20 is the default SSH port. From the SyncDb README: "Only remote servers (production, staging, etc) should be configured in the configuration file. The local environment is determined by your .env file."
    – CraftQuest
    Jun 2 at 18:54
  • Correction on my typo: port 22 is the default ssh port.
    – CraftQuest
    Jun 3 at 12:26
  • Your dump client path shows its using pg_dump but you are using a mysql db. Try changing the dump path to the path where mysqldump is located. Jun 4 at 5:54
  • I have updated the path for mysqldump, but still getting the error.
    – Lee
    Jun 4 at 8:24
  • What OS is your local system? Jun 5 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.