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

Lando not finding cert.crt or cert.key, edge_ssl issue and wp-cli commands throw a 'OCI runtime exec failed' error #261

Closed
MattMakesNoise opened this issue Oct 11, 2024 · 8 comments · Fixed by #266

Comments

@MattMakesNoise
Copy link

What is your lando version and operating system?
lando v3.2.2 on MacOS Sonoma 14.5

  • Ran lando destroy and deleted all files
  • uninstalled lando and docker
  • removed ~/.lando and ~/.docker
  • reinstalled lando and docker => docker v4.34.0
  • created an empty folder and ran lando init --source pantheon
  • chose site to import but just hangs
  • cloned project from pantheon into new dir
  • ran lando init --source pantheon again and back to the same three errors

Tell us about your .lando.yml
I've tried numerous things with this such as adding the platform as linux/amd64, direct refs to the key and crt files and adding the wp command to the tooling. The lando.yml should look like this at its most basic

name: publishing-sites
recipe: pantheon
config:
  framework: wordpress_network
  site: publishing-sites
  id: af0ee6e0-d490-440b-9c65-603e119ef44a
proxy:
  edge:
    - network.lndo.site
    - the-ambient.lndo.site
    - getsweatgo.lndo.site
    - trustedreviews.lndo.site
    - wareable.lndo.site
services:
  database:
    portforward: 3307

Tell us about the error you got
Lines of note are...

Pantheon pre-run scripting
cat: /certs/cert.crt: No such file or directory
cat: /certs/cert.key: No such file or directory
ERROR ==>

and

! edge_ssl The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s
[+] Healthchecking 1/1
 ✔ Healthcheck publishingsites_database_1  Passed

  _      __              _           __
 | | /| / /__ ________  (_)__  ___ _/ /
 | |/ |/ / _ `/ __/ _ \/ / _ \/ _ `/_/
 |__/|__/\_,_/_/ /_//_/_/_//_/\_, (_)
                             /___/

Your app is starting up but we have already detected some things you should investigate.
These may or may not prevent your app from working.

  ⚠ One of your v3 build steps failed
    This **MAY** prevent your app from working.
    Check for errors above, fix them in your Landofile, and try again by running:
    Run lando rebuild

When trying to run a basic wp-cli command such as

lando wp plugin list

I get the error

OCI runtime exec failed: exec failed: unable to start container process: exec: "wp": executable file not found in $PATH: unknown

@rtfm-47 rtfm-47 transferred this issue from lando/lando Oct 11, 2024
@dkosbob
Copy link

dkosbob commented Oct 14, 2024

I'm having the same, or very similar, issue, on lando v3.22.1 and mac os 12.4. I'm also using the pantheon recipe.

When starting or rebuilding the app, I'm getting the same warnings/errors as OP.

Commands from the pantheon plugin (lando pull, lando drush) are not recognized but the pantheon plugin seems to be installed.

@MattMakesNoise
Copy link
Author

Tried uninstalling and re-installing again yesterday and the certs folder exists but without the cert.crt and cert.key files aren't created. Tried creating them manually and rebuilding but they're still not recognised.

I've also tried the suggestions in the documentation again. Removing the proxy and rebuilding, deleting and re-adding the Lando CA cert but to no avail.

Going to try another uninstall/reinstall but with an older version and will report back.

@mourogers
Copy link

Same issue here on Sonoma 14.6.1, latest Lando updates and Docker 4.34.0. Seemed to co-occur with a file permission issue that broke composer builds and eventually led me to turn off VirtioFS and move to gRPC FUSE for the time being, but then the timing could just be a coincidence.

@MattMakesNoise
Copy link
Author

MattMakesNoise commented Oct 15, 2024

I've back up and running, mainly. Hopefully this will help @dkosbob @mourogers and anyone else to get up and running again.

Uninstalled both docker and lando, reinstalled lando v3.21.2 and docker v4.30.0 and the certifactes issue is sorted. I still can't get rid of the error

edge_ssl The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

and then I can only access via http despite https having green ticks in the edge urls vitals. Can't log in to admin unless I'm in an incognito window...well I can log in but trying to visit wp-admin gives a 500 error.

@dkosbob
Copy link

dkosbob commented Oct 15, 2024

Thank you @MattMakesNoise

I rolled back to 3.21.2 as well and am up and running again. For what it's worth, I think I had been on 3.22.0-beta7 before the cert issue started, so that version may work as well. It looks like there were some changes to cert functionality introduced in https://github.com/lando/core/releases/tag/v3.22.0 so that would fit.

@AaronFeledy
Copy link
Member

AaronFeledy commented Oct 15, 2024

A fix is in the works, but here's a workaround for now:

Edit ~/.lando/plugins/@lando/pantheon/scripts/pantheon.sh and add the following at line 11, just above /helpers/add-cert.sh --silent

# Set up the service cert and key
export LANDO_SERVICE_CERT=/certs/cert.crt
export LANDO_SERVICE_KEY=/certs/cert.key

mkdir -p /certs
ln -sfn /lando/certs/appserver_nginx.$LANDO_APP_NAME.crt $LANDO_SERVICE_CERT
ln -sfn /lando/certs/appserver_nginx.$LANDO_APP_NAME.key $LANDO_SERVICE_KEY

Then run a lando rebuild.

Here's a patch:

diff --git a/scripts/pantheon.sh b/scripts/pantheon.sh
index 74d7015..bcb8938 100755
--- a/scripts/pantheon.sh
+++ b/scripts/pantheon.sh
@@ -11,6 +11,14 @@ LANDO_MODULE="pantheon"
 # Kick it off
 lando_pink "Pantheon pre-run scripting"
 
+# Set up the service cert and key
+export LANDO_SERVICE_CERT=/certs/cert.crt
+export LANDO_SERVICE_KEY=/certs/cert.key
+
+mkdir -p /certs
+ln -sfn /lando/certs/appserver_nginx.$LANDO_APP_NAME.crt $LANDO_SERVICE_CERT
+ln -sfn /lando/certs/appserver_nginx.$LANDO_APP_NAME.key $LANDO_SERVICE_KEY
+
 /helpers/add-cert.sh --silent
 
 # Set up some new dirs

@dev-bsa
Copy link

dev-bsa commented Oct 16, 2024

@AaronFeledy tried and didnt work still got
cat: /certs/cert.crt: No such file or directory
cat: /certs/cert.key: No such file or directory

@pirog pirog linked a pull request Oct 16, 2024 that will close this issue
9 tasks
@AaronFeledy
Copy link
Member

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

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.

6 participants