lando / core

Current Lando v3 runtime
https://docs.lando.dev/core/v3
GNU General Public License v3.0
9 stars 22 forks source link

"Unsupported config option for services" after update #153

Closed alex-r-redfern closed 4 months ago

alex-r-redfern commented 4 months ago

Lando version: v3.21.0-beta.15 Host: Ubuntu/Mint - Linux 6.5.0-27

Issue: After updating Lando core, rebuilds and destroys all fail. Manually deleting containers/images/volumes in docker does not resolve this, nor does manually removing configuration files in ~/.lando/compose. The projects all started / rebuild successfully prior to this update.

Terminal output:

lando destroy -yv
  lando loading app projectnamehere from config files 0=/media/alex/Data/projectnamehere/.lando.yml +411ms
  lando loading app projectnamehere from config files 0=/media/alex/Data/projectnamehere/.lando.yml +426ms
Preparing to consign projectnamehere to the dustbin of history...
  projectnamehere destroying app...  +1ms
  projectnamehere stopping app...  +103ms
ERROR: The Compose file '/home/alex/.lando/compose/projectnamehere/globals-0.yml' is invalid because:
Unsupported config option for services: 'database'
  lando ERROR Error
    at /home/alex/.lando/plugins/@lando/core/lib/shell.js:158:44
From previous event:
    at Shell.sh (/home/alex/.lando/plugins/@lando/core/lib/shell.js:150:6)
    at dc (/home/alex/.lando/plugins/@lando/core/utils/setup-engine.js:6:16)
    at compose (/home/alex/.lando/plugins/@lando/core/utils/setup-engine.js:26:35)
    at /home/alex/.lando/plugins/@lando/core/lib/router.js:132:28
    at /home/alex/.lando/plugins/@lando/core/lib/router.js:23:74
From previous event:
    at retryEach (/home/alex/.lando/plugins/@lando/core/lib/router.js:23:42)
    at exports.stop (/home/alex/.lando/plugins/@lando/core/lib/router.js:131:43)
    at run (/home/alex/.lando/plugins/@lando/core/lib/engine.js:19:59)
    at /home/alex/.lando/plugins/@lando/core/lib/router.js:31:15
From previous event:
    at exports.eventWrapper (/home/alex/.lando/plugins/@lando/core/lib/router.js:31:4)
    at Engine.engineCmd (/home/alex/.lando/plugins/@lando/core/lib/engine.js:19:104)
    at Engine.stop (/home/alex/.lando/plugins/@lando/core/lib/engine.js:489:17)
    at /home/alex/.lando/plugins/@lando/core/lib/app.js:546:29
    at process.processImmediate (node:internal/timers:476:21)
From previous event:
    at App.stop (/home/alex/.lando/plugins/@lando/core/lib/app.js:546:6)
    at /home/alex/.lando/plugins/@lando/core/lib/app.js:243:22
    at async Object.run (/home/alex/.lando/plugins/@lando/core/tasks/destroy.js:21:9)  +554ms

Lando file for project:

name: projectnamehere
excludes:
  - node_modules
  - modules/contrib
recipe: laravel
config:
  php: '8.2'
  webroot: public
  via: nginx
  xdebug: true
  config:
    php: .lando_config/php.ini
  composer_version: "2.5.5"
  build_as_root:
    - docker-php-ext-install sockets
  overrides:
    environment:
      PHP_IDE_CONFIG: "serverName=lando"
services:
  redis:
    api: 3
    type: redis:4.0.12
    persist: true
    portforward: 32840
    password: womprat-slayer
  mailhog:
    api: 3
    type: mailhog:v1.0.0
  database:
    api: 3
    type: mysql:8.0.20
    portforward: 13315
    creds:
      user: laravel
      password: laravel
      database: projectnamehere
    configs:
      - skip-name-resolve
  meilisearch:
    api: 3
    type: lando
    app_mount: false
    services:
      image: getmeili/meilisearch:v1.3
      command: tini -- /bin/sh -c /bin/meilisearch
      environment:
        - MASTER_KEY=REDACTED
      ports:
        - '7700'
    volumes:
      meilsearch:
    overrides:
      volumes:
        - meilisearch:/meili_data2

I'm unsure how to proceed in diagnosing this further and would hugely appreciate any further advice.

Thanks, Alex

alex-r-redfern commented 4 months ago

To add: docker version: Docker version 26.0.1, build d260a54

alex-r-redfern commented 4 months ago

Further point of interest: Running rebuilds back to back errors out on different services each time:

lando rebuild -y
Rising anew like a fire phoenix from the ashes! Rebuilding app...
ERROR: The Compose file '/home/alex/.lando/compose/projectnamehere/globals-0.yml' is invalid because:
Unsupported config option for services: 'redis'
ERROR ==> 

lando rebuild -y
Rising anew like a fire phoenix from the ashes! Rebuilding app...
ERROR: The Compose file '/home/alex/.lando/compose/projectnamehere/globals-0.yml' is invalid because:
Unsupported config option for services: 'meilisearch'
ERROR ==> 

lando rebuild -y
Rising anew like a fire phoenix from the ashes! Rebuilding app...
ERROR: The Compose file '/home/alex/.lando/compose/projectnamehere/globals-0.yml' is invalid because:
Unsupported config option for services: 'appserver'
ERROR ==> 

lando rebuild -y
Rising anew like a fire phoenix from the ashes! Rebuilding app...
ERROR: The Compose file '/home/alex/.lando/compose/projectnamehere/globals-0.yml' is invalid because:
Unsupported config option for services: 'appserver'
ERROR ==> 
alex-r-redfern commented 4 months ago

After a tip from Steve on the Slack, I ran lando setup --skip-common-plugins and it shows that docker compose is no longer installed:

 THING                                   STATUS          COMMENT                             
 ─────────────────────────────────────── ─────────────── ─────────────────────────────────── 
 @lando/build-engine (docker-engine)     ✔ Installed     Dialed                              
 @lando/build-engine-group (alex@docker) ✔ Installed     Dialed                              
 @lando/orchestrator (docker-compose)    ⚠ Not Installed Will install docker-compose v2.26.1

This resolved the issue. I'm happy for this to be closed, but feel free to re-open if this is an actual underlying bug and not an os/platform issue.

alex-r-redfern commented 4 months ago

Just a thought, but might be worth adding a startup check to ensure engine and compose are installed as to avoid ambiguous error messages.

reynoldsalec commented 4 months ago

Yeah I've been seeing a steady trickle of people missing the requirement to install the prereqs now that we're not using installers on Mac/Windows. If you try to run Lando and don't have Docker, you get an error relating to Lando's inability to spin up Docker, which is fairly definitive, but I think there are other cases like yours that can show up.

In your case, do you know what version of Lando you updated from? Wondering if you had an older version that used Docker Compose v1, and that the update to 3.21 created a mismatch between the version of Docker Compose installed and what was needed.

alex-r-redfern commented 4 months ago

Ah, so it will be about 4 weeks old, but interestingly the terminal I use is very short (phpstorm built in) so content can be scrolled past easily, and if I recall correctly there was some additional output other than the warning after the update which may have pushed it up and out of view. Apologies, I didn't screenshot this at the time. I wouldn't sweat this issue too much as I'm sure if anyone ends up in the same boat they'll find this ticket hopefully. Thanks to you and the rest of the team at Lando for the amazing work :)

reynoldsalec commented 4 months ago

Thanks @alex-r-redfern, appreciate the kind words!

xurizaemon commented 4 months ago

Hmm, I'm on Linux and seeing this, if that's of interest (looking at https://github.com/lando/core/issues/153#issuecomment-2075529898).

AFAICT the previous lando setup command did not have any warning about @lando/orchestrator, nor did it attempt to update it.

$ lando update
Generating plugin/cli update matrix... done [see table below]

 PACKAGE              STATUS             COMMENT                                                   
 ──────────────────── ────────────────── ───────────────────────────────────────────────────────── 
 @lando/acquia        ✔ Up to date       All good                                                  
 @lando/apache        ✔ Up to date       All good                                                  
 @lando/backdrop      ✔ Up to date       All good                                                  
 @lando/cli           ⚠ Update available https://github.com/lando/cli/releases/tag/v3.21.0-beta.14 
 @lando/compose       ✔ Up to date       All good                                                  
 @lando/core          ✔ Up to date       All good                                                  
 @lando/dotnet        ✔ Up to date       All good                                                  
 @lando/drupal        ✔ Up to date       All good                                                  
 @lando/elasticsearch ✔ Up to date       All good                                                  
 @lando/go            ✔ Up to date       All good                                                  
 @lando/healthcheck   ✔ Up to date       All good                                                  
 @lando/joomla        ✔ Up to date       All good                                                  
 @lando/lagoon        ✔ Up to date       All good                                                  
 @lando/lamp          ✔ Up to date       All good                                                  
 @lando/laravel       ✔ Up to date       All good                                                  
 @lando/lemp          ✔ Up to date       All good                                                  
 @lando/mailhog       ✔ Up to date       All good                                                  
 @lando/mariadb       ✔ Up to date       All good                                                  
 @lando/mean          ✔ Up to date       All good                                                  
 @lando/memcached     ✔ Up to date       All good                                                  
 @lando/mongo         ✔ Up to date       All good                                                  
 @lando/mssql         ✔ Up to date       All good                                                  
 @lando/mysql         ✔ Up to date       All good                                                  
 @lando/networking    ✔ Up to date       All good                                                  
 @lando/nginx         ✔ Up to date       All good                                                  
 @lando/node          ✔ Up to date       All good                                                  
 @lando/pantheon      ✔ Up to date       All good                                                  
 @lando/php           ✔ Up to date       All good                                                  
 @lando/phpmyadmin    ✔ Up to date       All good                                                  
 @lando/platformsh    ⚠ Cannot update    Please update manually.                                   
 @lando/postgres      ⚠ Cannot update    Please update manually.                                   
 @lando/proxy         ✔ Up to date       All good                                                  
 @lando/python        ✔ Up to date       All good                                                  
 @lando/redis         ✔ Up to date       All good                                                  
 @lando/ruby          ✔ Up to date       All good                                                  
 @lando/scanner       ✔ Up to date       All good                                                  
 @lando/sharing       ✔ Up to date       All good                                                  
 @lando/solr          ✔ Up to date       All good                                                  
 @lando/symfony       ✔ Up to date       All good                                                  
 @lando/tomcat        ✔ Up to date       All good                                                  
 @lando/varnish       ✔ Up to date       All good                                                  
 @lando/wordpress     ✔ Up to date       All good                                                  

Lando would like to update 1 package(s) listed above.
DO YOU CONSENT?: y
✔ Updated @lando/cli to 3.21.0-beta.14
Updated 1 of 1 packages successfully!
You are now up to date! with the latest and greatest!

However, running the command from https://github.com/lando/core/issues/153#issuecomment-2069783541 did address the issue it seems.

lando setup --skip-common-plugins