1

When syncing a remote db into my local db, drush 8 fails at The Drush sql-dump command did not report the path to the dump file produced. Try upgrading the version of Drush you are using on the source machine.

This is normally caused when the 2 servers are running different versions of Drush, however both are running 8.0-dev. The remote server does have an older version of Drush installed system wide, but I also have Drush 8.0-dev installed via composer for my specific user and I'm assuming drush uses the updated composer version since it logs in with my credentials. Could it be possible that the old system wide version of Drush is running on the remote server?

The remote server successfully dumps the database into /drush-backups/ but it seems the dump location does not get passed on.

This is a postgres database using the .pgpass option for Drush.

Here's a --verbose --debug of the command starting after the alias checking:

You will destroy data in .... and replace with data from ......
Do you really want to continue? (y/n): y
Returned from hook drush_sqlsync_sql_sync_validate [10.62 sec, 6.8 MB]                                                                                                                                                          [debug]
Calling hook drush_sqlsync_sql_sync [10.62 sec, 6.82 MB]                                                                                                                                                                        [debug]
preg_match() expects parameter 2 to be string, array given environment.inc:627 [10.62 sec, 6.82 MB]                                                                                                                         [warning]
Starting to dump database on Source. [10.62 sec, 6.83 MB]                                                                                                                                                                   [ok]
Backend invoke: ssh -o PasswordAuthentication=no ...@.... 'env COLUMNS=231 drush  --backend=2 --verbose --debug --strict=0 --root=/.....com --uri=.....com  sql-dump   --gzip     [command]
--result-file 2>&1' 2>&1 [10.62 sec, 6.84 MB]
ssh -o PasswordAuthentication=no ...@.... 'env COLUMNS=231 drush  --backend=2 --verbose --debug --strict=0 --root=/.....com --uri=....com  sql-dump   --gzip --result-file        [notice]
2>&1' 2>&1 [10.62 sec, 6.84 MB]
Bootstrap to phase 0. [0.01 sec, 1.71 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 1.82 MB] [bootstrap]
Cache HIT cid: 5.10.0-commandfiles-0-e83b78d19750fe135e1b944620e04d58 [0.02 sec, 1.84 MB]                                                                                                                                       [debug]
Bootstrap to phase 0. [-0.26 sec, 4.3 MB]                                                                                                                                                                                   [bootstrap]
Bootstrap to phase 0. [-0.26 sec, 4.31 MB]                                                                                                                                                                                  [bootstrap]
Found command: sql-dump (commandfile=sql) [-0.26 sec, 4.31 MB]                                                                                                                                                              [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [-0.25 sec, 4.36 MB]                                                                                                                                                 [bootstrap]
Initialized Drupal 7.39 root directory at /.....com [-0.24 sec, 5.2 MB]                                                                                                                                 [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [-0.24 sec, 5.21 MB]                                                                                                                                                 [bootstrap]
Initialized Drupal site .....com at sites/.....com [-0.24 sec, 5.21 MB]                                                                                                                                          [notice]
Cache HIT cid: 5.10.0-commandfiles-2-33c9dd42c31668865dc2b7d939fada15 [-0.23 sec, 5.21 MB]                                                                                                                                      [debug]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [-0.23 sec, 5.21 MB]                                                                                                                                        [bootstrap]
Cache HIT cid: 5.10.0-commandfiles-3-d970728376beb137057865c63baa822f [-0.23 sec, 5.23 MB]                                                                                                                                      [debug]
Calling system(pg_dump  --file /....../drush-backups/....../20151013010137/......_20151013_010137.sql  ...... --host=localhost --port=5432 --username=www-data --clean  && gzip -f /....../drush-backups/....../20151013010137/......_20151013_010137.sql);
Database dump saved to /....../drush-backups/..../20151013010137/....._20151013_010137.sql.gz [0.59 sec, 6.42 MB]                                                                                            [success]
Command dispatch complete [0.59 sec, 6.39 MB]                                                                                                                                                                                  [notice]
 Timer  Cum (sec)  Count  Avg (msec) 
 page   0.818      1      817.66     

Peak memory usage was 6.68 MB [0.59 sec, 6.39 MB]                                                                                                                                                                              [memory]
The Drush sql-dump command did not report the path to the dump file produced.  Try upgrading the version of Drush you are using on the source machine. [13.11 sec, 6.87 MB]                                                 [error]
Returned from hook drush_sqlsync_sql_sync [13.11 sec, 6.84 MB]                                                                                                                                                                  [debug]

Update: I've tried downgrading both servers to Drush 7.* and am receiving the same results.

  • Using Drush 8.x, run drush @remote status. This should report which Drush script you are using on the remote server, which should help you figure out if you are really using Drush 8, or if there might perhaps be an older version of Drush somewhere else on your $PATH. If you are running an older version of Drush, you might not see the Drush script line, but you will be able to see the Drush version, at least. – greg_1_anderson Oct 13 '15 at 2:52
  • Thanks @greg_1_anderson , so it does seem to be using the old version instead of the version installed with composer in my user directory. Running any commands from remote obviously work as intended, is there a way to get it to use the correct remote version when running locally, or would an update of the remote system version be required? – Patrick Ryan Oct 13 '15 at 3:19
4

If Drush is not selecting the correct executable on the remote system, you can specify the full path to Drush via the %drush-script element in the site alias on your local machine.

$aliases['remote'] = array(
    'uri' => 'http://example.com',
    'root' => '/path/to/remote/drupal/root',
    'remote-host' => 'myisp.com',
    'remote-user' => 'www-admin',
    'path-aliases' => array(
      '%drush-script' => '/path/to/drush/drush',
    ),
);

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.