0

drush sql-sync @devyau @stageyau returns:

Unable to load class Drupal\Driver\Database\Drush
PHP Fatal error: Call to a member function dump() on a non-object in /root/.composer/vendor/drush/drush/commands/sql/sql.drush.inc on line 275

Drush command terminated abnormally due to an unrecoverable error.

Error: Call to a member function dump() on a non-object in /root/.composer/vendor/drush/drush/commands/sql/sql.drush.inc, line 275

2
  • what verion of Drupal is this (I think I know, but I don't want to 'guess' what the question is actually about ...)? And what version of Drush are you using? Jun 30, 2015 at 7:13
  • I'm using Drupal 7.38 and Drush 7.0.0. Fixed my alsias files and moved Directory /var/www/vhosts/stage.youngamericansunited.net> Options -Indexes +FollowSymLinks -MultiViews AllowOverride All RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FNAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] </Directory> Jul 2, 2015 at 19:23

3 Answers 3

0

First you run this command on console. if command is run successfully after then you check your drush library, I think this is drush library problem.

Second is you can try other command like :-

drush ard

2
  • drush ard returns The external command could not be executed due to an application error. [error] Unable to determine sites directory for devyau Jul 3, 2015 at 21:30
  • How do I fix a drush library problem...have searched all over and can't figure it out. Jul 3, 2015 at 21:48
0

You should ensure that your remote alias is correctly declared:

$aliases['remote'] = array (
  'root' => 'absolute_path_to_your_drupal',
  ...
)

try other commands like

drush @devyau uli
drush @stageyau uli

If doesn't work the path may be the problem.

7
  • I'm working with the devyau stageyau and prodyau directly on the server...not running Drush on my desktop computer Jul 2, 2015 at 19:27
  • drush @devyau uli and stage uli return:PHP Fatal error: Call to a member function db_spec() on boolean in /root/.composer/vendor/drush/drush/includes/environment.inc on line 370 Jul 2, 2015 at 19:29
  • OH, I see...my remote aliases ARE OK. THey are on the server. Jul 2, 2015 at 19:33
  • drush ard returns: Call to undefined function drush_sql_get_class() in /root/.composer/vendor/drush/drush/includes/environment.inc on line 366 Jul 3, 2015 at 21:33
  • echo $PATH returns: /root/.composer/vendor/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin Jul 3, 2015 at 21:33
0

My alias file was the problem:

<?php
$aliases['devyau'] = array(
'uri'=> 'dev.[sitename]',
'root'=> '/var/www/vhosts/dev.[sitename]/',
'db-url' => 'mysql://[username]:[password]/devDBname',
  ); 
?>

My alias file apparently didn't have enough data to function.

See my previous question at: drush sql-sync fails

burnsjeremy provided this model alias file, which answered my question and allowed me to use Drush again! Thanks!

$remote_sites = '/path/to/site'; // usually /var/www/drupal-root-name
$aliases['site.dev'] = array(
 'uri' => 'sitename.com',
 'remote-host' => '{ip to remote}',
 'remote-user' => '{remote ssh user}',
 'root' => $remote_sites,
 'ssh-options' => '-p {if you ssh in on another port like 2222}',
 'path-aliases' => array(
 '%drush-script' => '/root/.composer/vendor/bin/drush', // This is so you can  
 have multiple drush installs and use different ones on different sites.
 'php'=> '/usr/local/bin/php', // Again if you have different php's for 
 different sites.
 '%site' => 'sites/default/', // This is the important part here, it will       
 ensure the proper bootstrap
 '%dump-dir' => '/path/to/drush.dbdumps', // This is where you want to dump 
 your databases, normally /tmp folder I think.
 '%files' => $remote_sites . '/files' // Your sites file folder, incase it is 
 somewhere else.
),
// You may actually need this, especially if you are running D7 since I     
   haven't ever tested the db-url thing on D7 or above. 
 'databases' => array (
   'default' => array (
    'default' => array (
     'driver' => 'mysql',
     'database' => '{db_name}',
     'username' => '{db_user}',
     'password' => '{db_pass}',
   ),
  ),
 ),
);

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.