0

I am using Amazon's EC2 for my development environment and Pantheon for my deployment environment. Code changes are pushed to Pantheon using git. And this much works fine.

I would like to use drush to update the local code for my modules. I will then git push origin master to Pantheon.

However, on EC2 I cannot make this work. This was working on my old, dying laptop, but I cannot perceive a configuration difference.

[ec2-user@[redacted] rsda]$ drush pm-updatecode
Command pm-updatecode needs a higher bootstrap level to run - you will need to invoke drush from a more functional [error]
Drupal environment to run this command.
Command pm-updatecode needs the following modules installed/enabled to run: update.                                [error]
The drush command 'pm-updatecode' could not be executed.                                                           [error]
Drush was not able to start (bootstrap) the Drupal database.                                                       [error]
Hint: This may occur when Drush is trying to:
  * bootstrap a site that has not been installed or does not have a configured database. In this case you can select
another site with a working database setup by specifying the URI to use with the --uri parameter on the command
line. See `drush topic docs-aliases` for details.
 * connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a
jailed shell. See http://drupal.org/node/1428638 for details.

Drush was attempting to connect to: 
  Drupal version    : 7.19
  Site URI          : http://default
  Database driver   : mysql
  Database hostname : dbserver.dev.[redacted].drush.in
  Database username : [redacted]
  Database name     : pantheon
  Default theme     : garland
  Administration theme: garland
  PHP configuration : /etc/php.ini
  Drush version     : 5.8
  Drush configuration: 
  Drush alias files : /home/ec2-user/.drush/pantheon.aliases.drushrc.php
  Drupal root       : /home/ec2-user/code/pantheon/rsda
  Site path         : sites/default
  Modules path      : sites/all/modules
  Themes path       : sites/all/themes
  File directory path: sites/default/files
  %paths            : Array


[ec2-user@[redacted] rsda]$

I could use the drush alias, but I don't want to make changes to the remote filesystem.

[ec2-user@[redacted] rsda]$ drush @pantheon.[redacted].dev status
 Drupal version         :  7.19                                                 
 Site URI               :  dev.[redacted].gotpantheon.com                       
 Database driver        :  mysql                                                
 Database hostname      :  10.181.132.28                                        
 Database username      :  [redacted]                                             
 Database name          :  pantheon                                             
 Database               :  Connected                                            
 Drupal bootstrap       :  Successful                                           
 Drupal user            :  Anonymous                                            
 Default theme          :  at_codex                                             
 Administration theme   :  seven                                                
 PHP configuration      :  /srv/bindings/[redacted]/php53 
                           .ini                                                 
                           /srv/bindings/[redacted]/php53 
                           .ini                                                 
 Drush version          :  5.1                                                  
 Drush configuration    :  /srv/bindings/[redacted]/drush
                           rc.php                                               
 Drupal root            :  .                                                    
 Site path              :  sites/default                                        
 File directory path    :  sites/default/files                                  
 Private file           :  sites/default/files/private                          
 directory path                                                                 

[ec2-user@[redacted] rsda]$ 

So it's possible to connect to the remote database--no firewall or DNS problem. The update module is enabled. Also, the referenced d.o issue applies to local databases, not remote ones.

For reference, here is the relevant part of my sites/default/settings.php:

 $databases['default']['default'] = array(
   'driver' => 'mysql',
   'database' => 'pantheon',
   'username' => [redacted],
   'password' => [redacted],
   'host' => 'dbserver.dev.[redacted].drush.in',
   'port' => '10677',
//   'prefix' => '',
//   'collation' => 'utf8_general_ci',
 );

How do I use drush on EC2 to update the local filesystem while using a remote database? What am I missing?

1

Looks like drush didn't like the update module disabled:

Command pm-updatecode needs the following modules installed/enabled to run: update.

Are you sure you are running drush from inside the default site directory (which I'm assuming is your actual site directory)?

You can also set up a local site alias for your dev site so you can point to that using drush and not have to run drush from the site directory. For example, 'drush @localdev status' and 'crush @pantheon.redacted.dev status'.

  • Yes, I am running drush from the root directory of the Drupal installation. I see no difference if I run it there or if I cd sites/default and do it there. And yes, the update module is installed and enabled. – njivy Feb 3 '13 at 21:04
  • Given that I would think that the site has not actually been set up. Can you access the site locally? If you can and are sure that that code is actually serving the site (sometimes I have had another DEV site responding at a local URL) I am stuck as well. – William Feb 4 '13 at 21:58

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.