0

I've installed two drupal sites on a share hosting (OVH), in two folders :

  • dev.www
  • www

I've installed drush 10.3.1 and create two alias, but when I try use alias (drush @dev status), I have the follow error :

[warning] Drush command terminated abnormally.

I don't know if my drush configuration or aliases are good or bad. Here is my configuration in .drush/sites/the-choices.site.yml:

'@the-choice.dev':
  remote-host: ...
  user: ...
  root: /home/thechoc/dev.www
  uri: 'http://dev.the-choice.org'
  ssh:
    options: '-o PasswordAuthentication=no -i /home/thechoc/dev.www/insecure_private_key'
'@the-choice.prod':
  host: ...
  user: ...
  root: /home/thechoc/www
  uri: 'https://the-choice.org'
  ssh:
    options: '-o PasswordAuthentication=no -i /home/thechoc/www/insecure_private_key'

If someone can help me. Thank in advance.

  • You can run drush with the --debug flag to have more information. – sanzante Jun 24 at 7:05
0

There is no need for the leading @name and try adding the full path to drush for all remote environments:

dev:
  ...
  paths:
    drush-script: /example/path/www/vendor/drush/drush/drush
prod:
  ...
  paths:
    drush-script: /foo/bar/www/vendor/drush/drush/drush

| improve this answer | |
  • Hi @Hudri and @sonfd, tahnk you for your answers. I made a new file with only these lines: dev: remote-host: ... user: ... root: /home/thechoc/dev.www uri: dev.the-choice.org prod: host: ... user: ... root: /home/thechoc/www uri: the-choice.org but when I try to run drush @the-choice.prod status, I have tthe follow error : The command "ssh -t -o PasswordAuthentication=no thechoc@... 'drush status --uri=https://the-choice.org --root=/home/thechoc/www'" failed. – llescp Jun 24 at 11:42
0

I see two issues with what you're doing here.

  1. As Hudri mentioned, you don't want the site name piece of the alias inside your aliases file. That part of the drush alias is determined by the alias file name.
  2. When you use your alias, you should use use it like drush @sitename.env status, using the full alias name.

In your case, remove the @the-choice piece from your environment keys in your .drush/sites/the-choices.site.yml alias file, e.g.

'dev':
  remote-host: ...
  user: ...
  root: /home/thechoc/dev.www
  uri: 'http://dev.the-choice.org'
  ssh:
    options: '-o PasswordAuthentication=no -i /home/thechoc/dev.www/insecure_private_key'
'prod':
  host: ...
  user: ...
  root: /home/thechoc/www
  uri: 'https://the-choice.org'
  ssh:
    options: '-o PasswordAuthentication=no -i /home/thechoc/www/insecure_private_key'

With the above configuration and your alias file named the-choices.site.yml, you'll interact with the two sites like: drush @the-choices.dev status or drush @the-choices.prod status.

| improve this answer | |

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.