Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can no longer use drush in Pantheon recipe #262

Closed
beau-townsend opened this issue Oct 15, 2024 · 5 comments · Fixed by #266
Closed

Can no longer use drush in Pantheon recipe #262

beau-townsend opened this issue Oct 15, 2024 · 5 comments · Fixed by #266

Comments

@beau-townsend
Copy link

beau-townsend commented Oct 15, 2024

Using the same Pantheon recipe lando file that I've been using for several years, I can no longer use drush. I receive the error "/bin/sh: 1: drush: not found" when I execute lando drush.
image

Attempting to execute lando drush sa result sin the error "OCI runtime exec failed: exec failed: unable to start container process: exec: "drush": executable file not found in $PATH: unknown"
image

I'm using Linux Mint. Here are the contents of my lando file:

name: terminus
recipe: pantheon
services:
  appserver:
    php: 8
    overrides:
      environment:
        TERMINUS_HIDE_GIT_MODE_WARNING: 1
    build_as_root:
      - cd /usr/local/bin
      - curl -L https://github.com/pantheon-systems/terminus/releases/download/3.1.4/terminus.phar --output terminus
      - chmod +x terminus
      - ./terminus self:update
tooling:
  sftp:
    service: appserver
    description: Execute SFTP commands through this lando instance.
    cmd: /usr/bin/sftp
  git:
    service: appserver
    description: Execute git commands through this lando instance.
    cmd: /usr/bin/git
  mysql:
    service: appserver
    description: Execute mysql commands through this lando instance.
    cmd: /usr/bin/mysql

I did SSH into the instance and found that there is no drush command under /usr/bin nor /usr/local/bin.

When executing lando I do see lando drush as an available command..

I did try to destroy and rebuild the instance, but no luck. I don't know if these are related, but rebuild produces several certificate related errors:

Rising anew like a fire phoenix from the ashes! Rebuilding app...

no container to killNo stopped containers
[+] Pulling 5/5
 ✔ database Pulled                                                                                                                                                                                             0.5s 
 ✔ cache Pulled                                                                                                                                                                                                0.6s 
 ✔ appserver Pulled                                                                                                                                                                                            0.6s 
 ✔ edge Pulled                                                                                                                                                                                                 0.6s 
 ✔ index Pulled                                                                                                                                                                                                0.6s 
[+] Running 1/0
 ✔ Container landoproxyhyperion5000gandalfedition_proxy_1  Running                                                                                                                                             0.0s 
[+] Running 3/3
 ✔ Network terminus_default          Created                                                                                                                                                                   0.2s 
 ✔ Volume "terminus_home_appserver"  Created                                                                                                                                                                   0.0s 
 ✔ Container terminus_appserver_1    Started                                                                                                                                                                   0.5s 
Pantheon pre-run scripting
cat: /certs/cert.crt: No such file or directory
cat: /certs/cert.key: No such file or directory
ERROR ==> 
[+] Running 15/15
 ✔ Volume "terminus_home_database"         Created                                                                                                                                                             0.0s 
 ✔ Volume "terminus_home_appserver_nginx"  Created                                                                                                                                                             0.0s 
 ✔ Volume "terminus_data_index"            Created                                                                                                                                                             0.0s 
 ✔ Volume "terminus_home_edge"             Created                                                                                                                                                             0.0s 
 ✔ Volume "terminus_data_database"         Created                                                                                                                                                             0.0s 
 ✔ Volume "terminus_home_cache"            Created                                                                                                                                                             0.0s 
 ✔ Volume "terminus_home_edge_ssl"         Created                                                                                                                                                             0.0s 
 ✔ Volume "terminus_home_index"            Created                                                                                                                                                             0.0s 
 ✔ Container terminus_appserver_1          Running                                                                                                                                                             0.0s 
 ✔ Container terminus_database_1           Started                                                                                                                                                             2.1s 
 ✔ Container terminus_index_1              Started                                                                                                                                                             2.0s 
 ✔ Container terminus_cache_1              Started                                                                                                                                                             1.7s 
 ✔ Container terminus_appserver_nginx_1    Started                                                                                                                                                             1.5s 
 ✔ Container terminus_edge_1               Started                                                                                                                                                             2.5s 
 ✔ Container terminus_edge_ssl_1           Started                                                                                                                                                             2.8s 
[+] Healthchecking 1/1
 ✔ Healthcheck terminus_database_1   Passed
ln: failed to create symbolic link '/var/www/certs/binding.pem': No such file or directory

I recently had another related certificate issues that I was able to resolve here: lando/core#225

My use case is that I frequently use terminus alias, which does still works, in conjunction with lando drush sa in order to execute scripts against multiple sites on Pantheon. Usually in the form of:

sites=($(lando drush sa --pipe)); for site in "${sites[@]}";
do                                     
  if [[ ! $site == @pantheon.* ]]; then
    continue
  fi                      
## Do stuff here ...                                               
done

I appreciate any help on this matter. Is it possible to roll back to a prior version of lando?

Thanks!

@rtfm-47 rtfm-47 transferred this issue from lando/lando Oct 15, 2024
@pirog pirog linked a pull request Oct 16, 2024 that will close this issue
9 tasks
@AaronFeledy
Copy link
Member

Yes, the cert errors are releated. The service's build process stops when it hits those errors, so it never gets to the point where it would normally install drush. A fix is in the works, but you could try this workaround in the mean time: #261 (comment)

@beau-townsend
Copy link
Author

Bingo! Thank you! That worked a treat. I really appreciate the rapid workaround.

@pirog
Copy link
Member

pirog commented Oct 16, 2024

will be shipping out an update momentarily as well!

@AaronFeledy
Copy link
Member

This should now be fixed in v1.6.0. Get it with lando update.

@beau-townsend
Copy link
Author

Updated and it's working. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants