I'm new to drush, and just got it working on my W2k8 server. We run a multisite environment, and I'm looking to be able to do things like run cron on all our sites easily.

Everything I've tried with drush works so far, except the following:
drush @sites cron

This returns a host of identical errors (one for each of our sites):
The command could not be executed successfully (returned: 'ssh' is [error]
not recognized as an internal or external command,
operable program or batch file.
, code: 1)

Why would drush be looking for ssh? Is this something I can turn off? Do I need to install additional packages on my server?

Comments

greg.1.anderson’s picture

Status: Active » Postponed (maintainer needs more info)

Drush uses ssh to run commands remotely (e.g. if you have set remote_host in your alias). Try under cygwin to get ssh.

I don't know why drush would look for ssh if your sites are local. Please follow the instructions in http://drupal.org/node/add/project-issue/drush when posting issues.

lwithrow’s picture

Apologies for not posting the issue properly. Here's a sample of the output where the error occurs (I get one of these for each site.mydomain.com)

Bootstrap to phase 0. [0.04 sec, 1.32 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.05 sec, 1.47 MB] [bootstrap]
Load alias @sites [0.05 sec, 1.47 MB]                                   [notice]
You are about to execute 'cron' on all of the following targets:
  E:/inetpub/wwwroot/drupal#writingcenter.mydomain.com
(long list of other sites)

Continue?  (y/n): Running: ssh -o PasswordAuthentication=no "lukew"@"E" "drush
--uri=   [command]
writingcenter.mydomain.com  --root= /inetpub/wwwroot/drupal  cron
--backend" [5.74 sec, 2.97 MB]
Undefined offset:  1 backend.inc:112 [5.74 sec, 2.97 MB]                [notice]
Undefined variable: output backend.inc:119 [5.74 sec, 2.97 MB]          [notice]
The command could not be executed successfully (returned: 'ssh' is       [error]
not recognized as an internal or external command,
operable program or batch file.
, code: 1) [5.74 sec, 2.97 MB]

I tried installing HEAD, but when I did that drush status reported:

Fatal error: Class 'Console_Table' not found in C:\drush\includes\drush.inc on l
ine 973
Drush command could not be completed.                                    [error]

So I rolled back to 4.0-rc1, and I was able to get this status:

E:\inetpub\wwwroot\drupal>drush status
 Drupal version         :  6.17
 Site URI               :  http://default
 Database driver        :  mysqli
 Database hostname      :  localhost
 Database username      :  drupal
 Database name          :  unca_drupal
 Database               :  Connected
 Drupal bootstrap       :  Successful
 Drupal user            :  Anonymous
 Default theme          :  unca
 Administration theme   :  unca
 PHP configuration      :  C:\Program Files\PHP\php.ini
 Drush version          :  4.0-rc1
 Drush configuration    :
 Drush alias files      :
 Drupal root            :  E:/inetpub/wwwroot/drupal
 Site path              :  sites/default
 File directory path    :  sites/default/files

All these sites are, of course, local. I don't know what might be causing it to think they're remote.

greg.1.anderson’s picture

"lukew"@"E" implies that you've set 'remote_user' => 'lukew' and 'remote_host' => 'E' in your site alias.

lwithrow’s picture

lukew is the user account I'm logged into the server with. I don't know where "E" comes from, except that it happens to be the drive letter where Drupal lives.

I don't know how I would have set the remote_user and remote_host; is there an easy way to fix that?

Thanks for your time in helping me through this.

lwithrow’s picture

Is it possible this is related to how I've named my sites? I thought I was following the standard for multisites by having these in my sites directory:
all
default
site1.mydomain.com
site2.mydomain.com
etc.

Also, when I enter hostname at the command prompt, it returns the Windows machine name:
CMS

Is that correct, or is drush expecting that to return "localhost"?

greg.1.anderson’s picture

Category: support » bug

This does look like a Windows-specific bug, just as you suspected in #0. Perhaps some quoting problem is causing drush to become confused and misinterpret things such as the file path as part of the user and host.

Recommended workaround: don't use @sites, make a site list that names your sites explicitly.

Fixing this would require more in-depth debugging on a Windows box. Drush has no maintainer for Windows right now. :(

greg.1.anderson’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)