"drush sql-sync" failing with Illegal string offset 'site' backend.inc:1030 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.

&lt;?php

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

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

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

?&gt;


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&gt;&amp;1' 2&gt;&amp;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.
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' =&gt; array(
  '%drush-script' =&gt; '/{your_path}/drush.php',
)