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 doesn't remove services even after a destroy and restar #1237

Closed
jcmartinez opened this issue Oct 7, 2018 · 5 comments
Closed

Lando doesn't remove services even after a destroy and restar #1237

jcmartinez opened this issue Oct 7, 2018 · 5 comments

Comments

@jcmartinez
Copy link

Bug Report

Tell us about your setup

What is your lando version and operating system? (note that the older your version the less likely we are to reply)

v3.0.0-beta.47 on Linux Mint 19 Tara

Tell us about your .lando.yml

name: reform
recipe: drupal8
config:
  webroot: html
  via: nginx
  database: mariadb
proxy:
  mailhog:
    - mail.reform.lndo.site
  pma:
    - pma.reform.lndo.site
services:
  jailfree_db:
    type: mariadb
    creds:
      user: jailfree
      password: jailfree
      database: jailfree
  mailhog:
    type: mailhog
    hogfrom:
      - appserver
  pma:
    type: phpmyadmin
    hosts:
      - database
      - jailfree_db
  appserver:
    build:
      - "[ ! -d /app/drush ] && mkdir -p /app/drush"
      - "[ ! -e /app/drush/drushaliases ] && ln -sf /user/.drush/drushaliases /app/drush/drushaliases"

Tell us about the command you were running

lando start

After some time I had to remove a database from the configuration. I edited my lando.yml and removed the second database (jailfree_db) as shown below:

name: reform
recipe: drupal8
config:
  webroot: html
  via: nginx
  database: mariadb
proxy:
  mailhog:
    - mail.reform.lndo.site
  pma:
    - pma.reform.lndo.site
services:
  mailhog:
    type: mailhog
    hogfrom:
      - appserver
  pma:
    type: phpmyadmin
    hosts:
      - database
  appserver:
    build:
      - "[ ! -d /app/drush ] && mkdir -p /app/drush"
      - "[ ! -e /app/drush/drushaliases ] && ln -sf /user/.drush/drushaliases /app/drush/drushaliases"

Then I ran the following command as suggested here https://docs.devwithlando.io/issues/switching-dbs.html

lando destroy && lando start

Tell us about the error you got

Even after destroying, lando will try to load the database that was removed taking longer time to restart and showing an error.

Waiting until nginx service is ready...
Waiting until appserver service is ready...
Waiting until database service is ready...
Waiting until mailhog service is ready...
Waiting until pma service is ready...
Waiting until jailfree_db service is ready...
Waiting until jailfree_db service is ready...
Waiting until nginx service is ready...
Waiting until jailfree_db service is ready...
Waiting until jailfree_db service is ready...
Waiting until jailfree_db service is ready...
Waiting until jailfree_db service is ready...
Waiting until jailfree_db service is ready...
Waiting until jailfree_db service is ready...
...
...
error: Looks like one of your build steps failed...
warn: This **MAY** prevent your app from working
warn: Check for errors above, fix them, and try again

Rerun the command that produced your error in verbose mode. Note that verbose mode is run like this lando command -- -vvv. Paste in the error and the ~100 lines that proceeded it.

lando restart -- -vvvv

....
debug: Engine is up.
debug: Cached true with key engineup for {"persist":false,"ttl":5}
Waiting until jailfree_db service is ready...
info: Waiting until jailfree_db service is ready...
debug: Trying to retrieve from file cache with key engineup
debug: File cache miss with key engineup
debug: About to run 0=/usr/bin/docker, 1=info
verbose: Running exec /usr/bin/docker,info
....

Tell us generally about your bug

I would expect that Lando wouldn't try to continue using a service that has been removed from the lando.yml file.

Please detail the steps we can take to replicate this bug. Be as detailed as possible.

Example:

1. Create a lando.yml file that has two databases.
2. lando start
3. remove one of the databases from the lando.yml file
4. lando destroy && lando start
5. Notice how lando waste long time waiting for the missing database

Tell us more

Could better documentation have prevented this issue? if so what should we change?

Not sure if I'm missing something. I couldn't find anything in the documentation rather than destroying and restarting. If there is any command that I've missed, please document at https://docs.devwithlando.io/issues/switching-dbs.html

Does this bug prevent you from using lando?

Yes, we have to continuously restart the application and this issue takes a lot of extra time to the point that we are considering doing the development outside of lando.

@jcmartinez jcmartinez changed the title Lando tries to star a removed database even after destroy and restar Lando doesn't remove services even after a destroy and restar Oct 20, 2018
@jcmartinez
Copy link
Author

I've edited the title of this issue because initially I thought that it was only related to database but I can see that other services remain and restart even when they are removed from the .lando.yml file.

@cboyden
Copy link

cboyden commented Oct 22, 2018

I am seeing this as well. I tried out an edge_ssl service on one of my projects and then removed it from the .lando.yml. Since then I've destroyed and rebuilt the app many times, removed and reinstalled both Lando and Docker (for other reasons) several times, and I still get

Waiting until edge_ssl service is ready...

on every build until it gives up.

@JoshuaSoileau
Copy link

+1

@betz
Copy link

betz commented Dec 16, 2018

what is the correct command to also remove the cache from that lando build?

@pirog
Copy link
Sponsor Member

pirog commented Jan 13, 2019

Lando will automatically clean up orphaned containers in RC2 which should resolve this

@pirog pirog closed this as completed Jan 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants