0

I tried running drush sql-sync @dev sql-conf --verbose

with drush 8.1.18 and php 7.3.14 and I get this error:

Begin redispatch via drush_invoke_process().                                                                                                                                                                                         [notice]
Calling proc_open(env COLUMNS=237 /var/www/app/html/vendor/drush/drush/drush.launcher  --root=/var/www/app/html --verbose  sql-sync '@dev' sql-conf 2>&1);
Loaded alias @dev from file /home/mike/.drush/aliases.drushrc.php                                                                                                                                                              [notice]
/usr/bin/php /home/mike/.composer/vendor/drush/drush/drush.php --php=/usr/bin/php  --backend=2 --verbose --uri= --root=/var/www/app/html  sql-conf   --all 2>&1                                                              [notice]
The command could not be executed successfully (returned: Begin redispatch via drush_invoke_process().                                                                                                                            [error]
                                                            [notice]
Calling proc_open(env COLUMNS=237  /var/www/app/html/vendor/drush/drush/drush.launcher  --root=/var/www/app/html --verbose --uri=  sql-conf   --all 2>&1);
Loading outputformat engine.
  [notice]
Array
(
    [default] => Array
        (
            [default] => Array
                (
                    [database] => mydb
                    [username] => root
                    [host] => localhost
                    [port] =>
                    [driver] => mysql
                    [prefix] =>
                    [charset] => utf8mb4
                    [collation] => utf8mb4_general_ci
                )

        )

)

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

I checked my database credentials. I can login to the local db without a problem. How can I debug this further? I tried putting echo statements in ~/.config/composer/vendor/drush/drush/commands/sql/sqlsync.drush.inc
but it is not using that file at all.

Here is how I defined my dev alias:

<?php

$aliases['em.dev'] = array(
    'uri' => '',
    'root' => '/var/www/myapp/html',
    'path-aliases' => array(
        '%drush-script' => '/home/mike/.composer/vendor/drush/drush/drush.php',
        '%dump-dir' => '/tmp',
    ),
);
max
  • 9,708
  • 15
  • 89
  • 144
  • How is @dev configured? Have you also tried more simple commands like flushing cache for example? Maybe add that information to your question. Try to make it a reproducible problem. – leymannx Feb 13 '20 at 18:24
  • I tried drush cache-clear and I got a different error: PHP Fatal error: Uncaught Error: Call to undefined function cache_get(). I'm going to also update the issue with the details about my alias. thanks – max Feb 14 '20 at 00:36

1 Answers1

1

uh, I made a mistake in my alias. The uri was left empty. I just put localhost in there and it's working.

max
  • 9,708
  • 15
  • 89
  • 144