3

I'm using Drupal 8. I have an installation on my local dev machine as well as one on my remote demo machine. I'm attempting to use drush sql-sync so that I can make sure my local dev has the same data as my remote demo.

The command I'm running is:

drush sql-sync @remote.demo @local

The error is:

Illegal string offset 'site' backend.inc:1030

The command could not be executed successfully (returned: env: drush: No such file or directory, code: 127)
Error: no database record could be found for source @remote.demo

My aliases file is ~/.drush/aliases.drushrc.php.

<?php

$local = '/var/www/drupal/';
$aliases['local'] = [
    'root' => $local,
    'path-aliases' => [
        '%dump-dir' => "{$local}drush.dbdumps",
    ]
];

$remote = '/var/www/drupal/';
$aliases['remote'] = [
    'remote-host' => 'x.x.x.x',
    'remote-user' => 'myUsername'
];

$aliases['remote.demo'] = [
    'parent' => '@remote',
    'root' => $remote,
    'path-aliases' => [
        '%dump-dir' => "{$remote}drush.dbdumps"
    ]
];

?>

I know it's being picked up because it shows up in drush status.

This is a snippet of backend.inc (the file referred to in the error):

1028        if ($proc['output']) {
1029            $values = drush_backend_parse_output($proc['output'], $proc['backend-options'], $proc['outputted']);
1030            $values['site'] = $site;
1031            if (is_array($values)) {

It seems to me that drush_backend_parse_output() is parsing something incorrectly but I'm unable to figure this one out. Any idea what I'm doing wrong?

UPDATE I ran the drush command with the verbose flag:

drush -v sql-sync @remote.demo @local

The output is long but the relevant output is:

ssh -o PasswordAuthentication=no myUsername@x.x.x.x 'env COLUMNS=112 drush --backend=2 --verbose --root=/var/www/drupal/  sql-conf   --all 2>&1' 2>&1                       [notice]
Illegal string offset 'site' backend.inc:1030

It seems like the drush command run on the remote machine is generating output that my local drupal is tripping on. Not sure how to resolve this though.

Note: drush --version gives me Drush Version : 8.0-dev on both machines.

  • 1
    Are you sure that your remote drush is (more or less) the same as your local one? I've seen errors similar to this that were caused by using an older drush version on the remote site. – Berdir Aug 20 '15 at 20:24
  • I'm positive. drush --version gives me Drush Version : 8.0-dev on both machines. – Housni Aug 20 '15 at 21:07
  • thanks @Berdir, that solved my issue. Here's a page with info on installing aa different version of Drush: drush.org/en/master/install – Danny Aug 27 '15 at 15:03
  • That's the same page I referred to for my installation but I don't believe that's my issue is related to the version. – Housni Aug 27 '15 at 19:46
  • I'm also having the same issue, despite I made sure that both sites (local and remote) are using same drush version (8.0.2) – ccamara Jan 30 '16 at 19:18
1

I had same issue and fixed it by specifying the %drush-script path for my remote machine alias. Just ssh into your remote machine and run "drush status" to find the correct "Drush script" path and put it in under path-aliases array. So it would look like this:

'path-aliases' => array(
  '%drush-script' => '/{your_path}/drush.php',
)

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.