Platform.sh drush alias stops working

 

All of a sudden, on a commit which had nothing to do with drush as far as I can tell, drush stopped working on platform.sh. I got an error like this:

env: drush: No such file or directory

Which is to say, "no drush here." But why? It's added in composer. Nothing changed. I ran platform drush-aliases and refreshed them.

Stop asking why. Here's how I fixed it.

Turns out that drush still exists on the server, even though which drush led to nothing. Not in the path? Unclear.

Here's how I fixed it. Or worked around it.

On my local, at ~/.drush/policy.drush.inc, I added:

function policy_drush_sitealias_alter(&$alias_record) {
  if ($alias_record['#group'] == 'my-group-name') {
    $alias_record['path-aliases']['%drush-script'] = '/app/vendor/drush/drush/drush';
  }
}

Yeah weird. Whatever.

About the Author

Hi. My name is Jeremiah John. I'm a sf/f writer and activist.

I just completed a dystopian science fiction novel. I run a website which I created that connects farms with churches, mosques, and synagogues to buy fresh vegetables directly and distribute them on a sliding scale to those in need.

In 2003, I spent six months in prison for civil disobedience while working to close the School of the Americas, converting to Christianity, as one does, while I was in the clink.