Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Drush launcher fails sql-sync after upgrade from 0.5.1 -> 0.6.0 #60

Open
dougmorin opened this issue Jun 14, 2018 · 8 comments
Open

Drush launcher fails sql-sync after upgrade from 0.5.1 -> 0.6.0 #60

dougmorin opened this issue Jun 14, 2018 · 8 comments

Comments

@dougmorin
Copy link

This was working before, but the sql-sync now fails after the upgrade. Looking for advice and to see if anybody else has seen this issue?

The command could not be executed successfully (returned: Array                                                                                                        [error]
(
    [default] => Array
        (
            [default] => Array
                (
                    [database] => database_name
                    [username] => database_username
                    [prefix] => Array
                        (
                            [default] => 
                        )

                    [host] => localhost
                    [port] => 3306
                    [namespace] => Drupal\Core\Database\Driver\mysql
                    [driver] => mysql
                )

        )

)

, code: 0)
@dougmorin
Copy link
Author

Tagging @schady4

@ixisandyr
Copy link

I see the same:

drush sql-sync @xxxxportal.d8.aws.master @portal.xxxx.vm7 --create-db --structure-tables-list="cache_*"

The command could not be executed successfully (returned: Array                                                                                                                                  [error]
(
    [default] => Array
        (
            [default] => Array
                (
                    [database] => xxxx_default
                    [username] => xxx
                    [prefix] => Array

@webflo
Copy link
Collaborator

webflo commented Jul 10, 2018

@weitzman Do you have any idea whats causing this?

@ixisandyr @schady4 @dougmorin Could you add the --debug oder --verbose flag to the drush commands and post the full error log? Its hard to tell what is going on from the current error reports.

Thanks!

@ixisandyr
Copy link

Hi, here's the comparison between 0.6.0 and 0.5.1 where drush launcher is installed at /usr/local/bin/drush on the sql-sync target - (alias @portal.xxxxx.vm7)

0.6.0

Andys-MBP~/boxes/yyyyyVM7/www/portal.xxxxx.vm7(develop|✔) % drush -vvv sql-sync @xxxxxportal.d8.aws.master @portal.xxxxx.vm7 --create-db --structure-tables-list="cache_*"
Include /Users/andy/.drush/yyyyy/commands                                                                                                                                        [notice]
Loaded alias @portal.xxxxx.vm7 from file /Users/andy/.drush/vm7.aliases.drushrc.php                                                                                         [notice]
Loaded alias @default.parent from file /Users/andy/.drush/yyyyy/aliases/default.aliases.drushrc.php                                                                              [notice]
Loaded alias @default.prod from file /Users/andy/.drush/yyyyy/aliases/default.aliases.drushrc.php                                                                                [notice]
Loaded alias @xxxxxportal.d8.aws.master from file /Users/andy/.drush/yyyyy/aliases/xxxxxportal.aliases.drushrc.php                                                       [notice]
ssh -o PasswordAuthentication=no arigby@master.portal.xxxxx.zzzz.co.uk 'env COLUMNS=184 drush  --backend=2 --verbose                                                 [notice]
--uri=http://master.portal.xxxxx.zzzz.co.uk --root=/var/www/portal.xxxxx.com/public  sql-conf   --all 2>&1' 2>&1
ssh -o PasswordAuthentication=no -i "/Users/andy/.vagrant.d/insecure_private_key" vagrant@portal.xxxxx.vm7 'env COLUMNS=184 /usr/local/bin/drush  --backend=2 --verbose     [notice]
--uri=portal.xxxxx.vm7 --root=/var/www/portal.xxxxx.vm7/public  sql-conf   --all 2>&1' 2>&1
The command could not be executed successfully (returned: Begin redispatch via drush_invoke_process().                                                                       [error]
                                                            [notice]
Calling proc_open(env COLUMNS=184 /var/www/portal.xxxxx.vm7/vendor/drush/drush/drush.launcher  --root=/var/www/portal.xxxxx.vm7/public --uri=portal.xxxxx.vm7
--verbose  sql-conf   --all 2>&1);
Loading outputformat engine.
  [notice]
Array
(
    [default] => Array
        (
            [default] => Array
                (
                    [database] => xxxxx_default
                    [username] => yyyyy
                    [prefix] => Array
                        (
                            [default] =>
                        )
...<snip>...

)

Command dispatch complete
  [notice]
End redispatch via drush_invoke_process().
  [notice]
, code: 0)
Error: no database record could be found for target @portal.xxxxx.vm7                                                                                                    [error]
Command dispatch complete                                                                                                                                                       [notice]

0.5.1

Andys-MBP~/boxes/yyyyyVM7/www/portal.xxxxx.vm7(develop|✔) % drush -vvv sql-sync @xxxxxportal.d8.aws.master @portal.xxxxx.vm7 --create-db --structure-tables-list="cache_*"
Include /Users/andy/.drush/yyyyy/commands                                                                                                                                        [notice]
Loaded alias @portal.xxxxx.vm7 from file /Users/andy/.drush/vm7.aliases.drushrc.php                                                                                         [notice]
Loaded alias @default.parent from file /Users/andy/.drush/yyyyy/aliases/default.aliases.drushrc.php                                                                              [notice]
Loaded alias @default.prod from file /Users/andy/.drush/yyyyy/aliases/default.aliases.drushrc.php                                                                                [notice]
Loaded alias @xxxxxportal.d8.aws.master from file /Users/andy/.drush/yyyyy/aliases/xxxxxportal.aliases.drushrc.php                                                       [notice]
ssh -o PasswordAuthentication=no arigby@master.portal.xxxxx.zzzz.co.uk 'env COLUMNS=184 drush  --backend=2 --verbose                                                 [notice]
--uri=http://master.portal.xxxxx.zzzz.co.uk --root=/var/www/portal.xxxxx.com/public  sql-conf   --all 2>&1' 2>&1
ssh -o PasswordAuthentication=no -i "/Users/andy/.vagrant.d/insecure_private_key" vagrant@portal.xxxxx.vm7 'env COLUMNS=184 /usr/local/bin/drush  --backend=2 --verbose     [notice]
--uri=portal.xxxxx.vm7 --root=/var/www/portal.xxxxx.vm7/public  sql-conf   --all 2>&1' 2>&1
You will destroy data in portal.xxxxx.vm7/xxxxx_default and replace with data from master.portal.xxxxx.zzzz.co.uk/portal.
Do you really want to continue? (y/n): y
Starting to create database on Destination.                                                                                                                                  [ok]
ssh -o PasswordAuthentication=no -i "/Users/andy/.vagrant.d/insecure_private_key" vagrant@portal.xxxxx.vm7 'env COLUMNS=184 /usr/local/bin/drush  --backend=2 --verbose     [notice]
--strict=0 --uri=portal.xxxxx.vm7 --root=/var/www/portal.xxxxx.vm7/public  sql-create   --create-db --structure-tables-list='\''cache_*'\'' 2>&1' 2>&1
Creating database xxxxx_default. Any possible existing database will be dropped!
Do you really want to continue? (y/n): y
<snip successful sync>

@greg-1-anderson
Copy link
Member

I usually don't use the Drush launcher, but I ran into this recently when targeting a remote system I didn't set up. When sql-sync passed through the Drush Launcher on the remote system, the --backend option was dropped from the commandline.

I worked around the problem by adding a drush-script path in my local alias pointing directly to vendor/bin/drush on the target site. The actual solution would be to ensure that all options are passed through, especially --backend

@webflo
Copy link
Collaborator

webflo commented Feb 4, 2019

We switched from system to proc_open in 0.6.x. #44

I always setup the proper drush-script path in my site aliases. Makes debugging easier and it removes the requirement to have a globally installer drush on the remote system.

@joelpittet
Copy link

@webflo This issue seems to suggest not setting drush-script: drush-ops/drush#3336

This work around did help though
'path-aliases' => [ '%drush-script' => '/var/www/site-name/current/vendor/bin/drush', ],

@greg-1-anderson
Copy link
Member

Note that there's also a bug in Drush sql-sync when mixing Drush 9.6.x with Drush 9.5.x and earlier. Unrelated to this problem, but thought I'd mention it in case people run into that problem while working on this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants