lando / pantheon

The Official Lando Pantheon plugin.
https://docs.lando.dev/pantheon
GNU General Public License v3.0
12 stars 18 forks source link

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 closed 1 week ago

MattMakesNoise commented 2 weeks ago

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

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

dkosbob commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

@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

AaronFeledy commented 1 week ago

This should now be fixed in v1.6.0, released today.

AaronFeledy commented 1 week ago

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