lando / pantheon

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

Pantheon recipe is incompatible with v3.21.0 #228

Closed cobadger-aten closed 1 month ago

cobadger-aten commented 2 months ago

Expected Behavior

When executing lando start or lando rebuild on a project using the pantheon recipe and Lando version 3.21.0, lando starts successfully and completes installation of pantheon-specific elements such as terminus.

Current Behavior

Both lando start and lando rebuild fail, throwing php warnings and fatal errors:

Pantheon pre-run scripting
Generating RSA private key, 2048 bit long modulus (2 primes)
...............+++++
...............+++++
e is 65537 (0x010001)
Signature ok
subject=C = US, ST = California, L = San Francisco, O = Lando, OU = Bespin, CN = unionedu
Getting CA Private Key
PHP Warning:  Unknown: Failed to open stream: No such file or directory in Unknown on line 0

Warning: Unknown: Failed to open stream: No such file or directory in Unknown on line 0
PHP Fatal error:  Failed opening required '/srv/includes/prepend.php' (include_path='.:/usr/local/lib/php') in Unknown on line 0

Fatal error: Failed opening required '/srv/includes/prepend.php' (include_path='.:/usr/local/lib/php') in Unknown on line 0

Once Lando completes its start or rebuild process, terminus cannot be used either inside the container or outside of it:

lando terminus --version
OCI runtime exec failed: exec failed: unable to start container process: exec: "terminus": executable file not found in $PATH: unknown

or

lando ssh
www-data@60a8bf5ce668:/app$ terminus --version
bash: terminus: command not found

Steps to Reproduce

  1. Install lando v3.21.0
  2. Attempt to either lando start or lando rebuild a project using the pantheon recipe
reynoldsalec commented 2 months ago

That prepend.php should be shared into the container as part of the config. @cobadger-aten it could be worth checking that prepend.php is making it into your ~/.lando/config/pantheon-php and ~/.lando/config/pantheon directories on your host machine, and then seeing if it exists in the /src/includes location in the appserver container: lando ssh -s appserver -c "ls /srv/includes"

Note I haven't been able to reproduce this myself, I'm guessing it's an instance-specific error, not blanket across all users of the Pantheon recipe, otherwise we'd be hearing A LOT of noise about it, so probably won't need a universal fix, but definitely would like to know what's causing the funk for OP.

reynoldsalec commented 1 month ago

@cobadger-aten you get any further traction on this issue?

cobadger-aten commented 1 month ago

@reynoldsalec I'm experiencing the same issue. Steps to reproduce:

  1. lando destroy the project
  2. remove the .lando/config/pantheon and .lando/config/pantheon-mariadb directories
  3. install v3.21.0-beta.13 using method recommended on https://docs.lando.dev/install/macos.html
  4. lando start

Results:

PHP Warning:  Unknown: Failed to open stream: No such file or directory in Unknown on line 0

Warning: Unknown: Failed to open stream: No such file or directory in Unknown on line 0
PHP Fatal error:  Failed opening required '/srv/includes/prepend.php' (include_path='.:/usr/local/lib/php') in Unknown on line 0

Fatal error: Failed opening required '/srv/includes/prepend.php' (include_path='.:/usr/local/lib/php') in Unknown on line 0

No .lando/config/pantheon-php directory exists after executing lando start. The prepend.php file does exist in the ~/.lando/config/pantheon and ~/.lando/config/pantheon-mariadb-arm directories.

reynoldsalec commented 1 month ago

@cobadger-aten couple more debugging steps to try:

  1. Have you run lando update recently? When you do, does the Pantheon plugin successfully update?
  2. Do you see the Pantheon plugin in ~/.lando/plugins/@lando/pantheon?
  3. When you run lando config | grep pantheon in your Pantheon project, what is the output? You should see the Pantheon plugin getting served from ~/.lando/plugins/@lando/pantheon`.
cobadger-aten commented 1 month ago

@reynoldsalec

  1. When I lando update I get the message As far as lando update can tell you are already up to date! including @lando/pantheon
  2. yes, I do see the Pantheon plugin in ~/.lando/plugins/@lando/pantheon
  3. results of lando config | grep pantheon:
       name: 'pantheon',
            label: 'pantheon',
            name: 'pantheon',
     recipe: 'pantheon',
     { app: '/Users/jordangraham/.lando/plugins/@lando/pantheon/app.js',
       builders: '/Users/jordangraham/.lando/plugins/@lando/pantheon/builders',
       dir: '/Users/jordangraham/.lando/plugins/@lando/pantheon',
       inits: '/Users/jordangraham/.lando/plugins/@lando/pantheon/inits',
       name: '@lando/pantheon',
       path: '/Users/jordangraham/.lando/plugins/@lando/pantheon/index.js',
       scripts: '/Users/jordangraham/.lando/plugins/@lando/pantheon/scripts',
       searchDir: '/Users/jordangraham/.lando/plugins/@lando/pantheon' },
     'pantheon',
        '@lando/pantheon': 'latest',
       label: 'pantheon',
       name: 'pantheon',

And I'm getting the same error as reported above after lando destroy and lando start.

reynoldsalec commented 1 month ago

@cobadger-aten I'd recommend just nuking all your containers and volumes: https://docs.lando.dev/help/purging-containers.html

In addition to deleting the ~/.lando/cache folder, might be good to delete the entirety of ~/.lando/config as well.

cobadger-aten commented 1 month ago

@reynoldsalec thanks for your note in Slack re: not overriding the type component of appserver: https://github.com/lando/lando/issues/3679#issuecomment-2035743137

Removing the type line from my lando config file resolved the problem for me.

I'm not sure if that means that this issue still needs to be addressed, but users with that override will experience this issue when updating Lando to the newer versions. Perhaps a notice in some update documentation?

reynoldsalec commented 1 month ago

@cobadger-aten good call, I added a note on the Pantheon plugin's configuration page and on the core docs regarding overriding. Does that seem good/anything else you'd do for those?

For anyone hitting this on Google, the error you should see is something like service "edge" depends on undefined service appserver_nginx: invalid compose project, see the aforementioned https://github.com/lando/lando/issues/3679#issuecomment-2035743137 for more info.

reynoldsalec commented 1 month ago

Going to close this out but LMK @cobadger-aten if you have more feedback on those doc pages!