0

I've been trying for quite some time now to get my drush to play nicely with my Drupal configuration and I'm having some problems. I'm attempting to perform cc all and uli on my Drupal directory and I keep getting the following error:

ssh: connect to host site.dev port 22: Operation timed out

The command I'm running is "drush @site.dev cc all" and "drush @site.dev uli"

Whenever I run uli I get a slightly longer version of the same error:

The external command could not be executed due to an application     [error]
error.
Illegal string offset 'site' backend.inc:1030                        [warning]
The command could not be executed successfully (returned: ssh:       [error]
connect to host site.dev port 22: Operation timed out
, code: 255)
current() expects parameter 1 to be array, null given                [warning]
user.drush.inc:415
parse_url() expects parameter 1 to be string, array given            [warning]
exec.inc:427
 does not appear to be a resolvable hostname or IP, not starting     [warning]
browser. You may need to use the --uri option in your command or site
alias to indicate the correct URL of this site.

I'm not really sure where to start with getting this to work. I've poked around in my Vagrant configuration and I'm able to SSH on port 22, so I don't really know where else to look to correct this error.

This is what my alias configuration looks like:

Vagrant.configure("2") do |config|
  mc_settings = {
    :domain => 'site.dev',
    :docroot => '/home/vagrant/docroot',
    :host_docroot => '../docroot',
    :database_name => 'site_dev',
    :vbox_name => 'site_dev'
  }
  • First things first: are you able to connect to your server using ssh? And, when drush is telling you to try --uri, have you tried it? Did it make any difference? – Mołot Aug 24 '15 at 19:46
2

It's really hard to answer specifically, since it really depends on how you have set your vagrant up.

Long story short

You need to setup your drush alias so that it's using SSH settings to access your vagrant box. The issue is probably that your vagrant box doesn't expect connections on port 22 or that you haven't setup the correct IP/domain for SSH connection in your alias.

If you want to use Vagrant for Drupal development I can recommend parrot. It has all you want for Drupal developetment, uses puppet, which makes it pretty easy to change PHP versions etc, and has Varnish, Solr etc.

If you are using parrot you should be able to access the Vagrant box by doing.

ssh vagrant@site.dev

Assuming that your site is located on the site.dev url.

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.