lando / docs

The main docs site for Lando
https://docs.lando.dev/
GNU General Public License v3.0
18 stars 56 forks source link

Documentation should clarify the version of Docker Compose needed when installed from source #174

Open Rain-kanyini opened 2 years ago

Rain-kanyini commented 2 years ago

Just rubber ducking this here:

I knew that I shouldn't have installed the new version of lando...I just got SO excited by everyone updating! Does anyone have any insight on this error?

After running lando start I got this :

ERROR ==> Error: (HTTP code 404) no such container - No such container: landoproxyhyperion5000gandalfedition_proxy_1  message=Error: (HTTP code 404) no such container - No such container: landoproxyhyperion5000gandalfedition_proxy_1 , stack=Error: Error: (HTTP code 404) no such container - No such container: landoproxyhyperion5000gandalfedition_proxy_1 
    at /snapshot/cli/lib/docker.js
    at processImmediate (internal/timers.js:464:21)
From previous event:
    at containerOpt (/snapshot/cli/lib/docker.js)
    at Landerode.scan (/snapshot/cli/lib/docker.js)
    at Object.scan (/snapshot/cli/lib/router.js)
    at run (/snapshot/cli/lib/engine.js)
    at /snapshot/cli/lib/router.js
From previous event:
    at Object.eventWrapper (/snapshot/cli/lib/router.js)
    at Engine.engineCmd (/snapshot/cli/lib/engine.js)
    at Engine.scan (/snapshot/cli/lib/engine.js)
    at /snapshot/cli/plugins/lando-networking/app.js
From previous event:
    at AsyncEvents.<anonymous> (/snapshot/cli/plugins/lando-networking/app.js)
    at AsyncEvents.handle (/snapshot/cli/lib/events.js)
    at /snapshot/cli/lib/events.js
    at processImmediate (internal/timers.js:464:21)
From previous event:
    at AsyncEvents.emit (/snapshot/cli/lib/events.js)
    at /snapshot/cli/lib/app.js
From previous event:
    at App.start (/snapshot/cli/lib/app.js)
    at Object.run (/snapshot/cli/plugins/lando-core/tasks/start.js)
    at /snapshot/cli/lib/cli.js
    at processImmediate (internal/timers.js:464:21)
From previous event:
    at /snapshot/cli/lib/cli.js
From previous event:
    at Object.handler (/snapshot/cli/lib/cli.js)
    at Object.runCommand (/snapshot/cli/node_modules/yargs/lib/command.js:238:44)
    at Object.parseArgs [as _parseArgs] (/snapshot/cli/node_modules/yargs/yargs.js:1063:30)
    at Function.get [as argv] (/snapshot/cli/node_modules/yargs/yargs.js:1004:21)
    at Cli.init (/snapshot/cli/lib/cli.js)
    at Cli.run (/snapshot/cli/lib/cli.js)
    at Object.<anonymous> (/snapshot/cli/bin/lando.js)
    at Module._compile (pkg/prelude/bootstrap.js:1751:22)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Function.runMain (pkg/prelude/bootstrap.js:1804:12)
    at internal/main/run_main_module.js:17:47, __stackCleaned__=true

I then ran lando rebuild and got this error :

ERROR ==> database reported as unhealthy. 
ERROR ==> Error: (HTTP code 404) no such container - No such container: landoproxyhyperion5000gandalfedition_proxy_1 

I'm SUPER out of my depth with lando in general (haha). I'm thinking that since I don't really know what I'm doing...Perhaps the best thing for me is to uninstall and re-install the previous version that was working? Any thoughts would be appreciated

P.s - I tried a lando poweroff

and

lando destroy

Rain-kanyini commented 2 years ago

It looks like landoproxyhyperion5000gandalfedition-proxy-1 exists, but its looking like its a hyphen vs underscore issue?

ElijahLynn commented 2 years ago

Seems like it might be related to https://github.com/lando/lando/issues/1297 which suggests that certain versions of docker-compose changed how they create containers. I wonder if there is a Lando cache of the old naming scheme (with underscores). Maybe try clearing out the ~/.lando folder?

ElijahLynn commented 2 years ago

If that doesn't work, this comment https://github.com/lando/lando/issues/1297#issuecomment-953896580 suggest downgrading docker-compose from a 2.x version to a 1.x version.

ElijahLynn commented 2 years ago

I troubleshooted this with Gregg a bit and lando destroy, then docker system prune (forget command at moment ) then a rm -rf ~/.lando and lando start didn't work.

But what appears to have happened is that Arch Linux just updated docker-compose to 2.2.2. We downgraded docker-compose to 1.29.2. The Arch package docker-compose-bin mentioned in https://github.com/lando/lando/issues/1297#issuecomment-953896580 is not available anymore. But we we found https://github.com/gbleux/aur-docker-compose-bin/blob/master/PKGBUILD which we modified to include the right version and SHAs and then ran makepkg and then sudo pacman -U <filename.zst). Which solved the issue.

So it appears that Lando needs to have support to work with Docker Composer 2.x maybe?

ElijahLynn commented 2 years ago

In hindsight, we could have done a ls /var/cache/pacman/pkg/ | grep docker-compose and found the *.zst file for 1.29.2. So then all you have to do is pacman --upgrade /var/cache/pacman/pkg/docker-compose-1.29.2-1-any.pkg.tar.zst to update, which asks you if you want to remove the other version. Then you have to pin it in /etc/pacman.conf by adding a IgnorePkg = docker-compose line.

joshmiller83 commented 2 years ago

I'm documenting my efforts to get lando working with this 404 error on the landoproxyhyperion500gandalfeditioin_proxy_1 error above on a Mac Intel that is running the latest version of Lando and version 2.0.0-rc1 of docker composer.

  1. I've tried lando rebuild and got a weird error
  2. I decided to restart Docker and got the 404 error
  3. Requested someone interpret Elijah above on the community slack at Lando and johnouellet helped me understand that Elijah was talking about installing docker compose on a Linux machine
  4. We decided a good lando destroy was called for, to try and rebuild the container that was causing problems.
  5. After destroy, lando came up with the following message:

Recreating ec54b6be2d04_landoproxyhyperion5000gandalfedition_proxy_1 ... Recreating ec54b6be2d04_landoproxyhyperion5000gandalfedition_proxy_1 ... error

ERROR: for ec54b6be2d04_landoproxyhyperion5000gandalfedition_proxy_1 Cannot start service proxy: driver failed programming external connectivity on endpoint landoproxyhyperion5000gandalfedition_proxy_1 (aac937dfcd3722fd33b32ac6d7537bf2f43c62bc89a79f974f5b6fb41bfa8b7e): Bind for 127.0.0.1:8080 failed: port is already allocated

ERROR: for proxy Cannot start service proxy: driver failed programming external connectivity on endpoint landoproxyhyperion5000gandalfedition_proxy_1 (aac937dfcd3722fd33b32ac6d7537bf2f43c62bc89a79f974f5b6fb41bfa8b7e): Bind for 127.0.0.1:8080 failed: port is already allocated ERROR: Encountered errors while bringing up the project.

But it did come up! image

Lando was not able to start the proxy Error The proxy has been disabled for now so you can continue to work. Check out the docs below, resolve your issue and build this app https://docs.lando.dev/config/proxy.html

I think my next attempt will be a full reboot, see if a "clean" docker start will resolve the port issues.

benperiton commented 2 years ago

I found that running lando start, then once it fails renaming the proxy, then starting again seems to work

docker rename landoproxyhyperion5000gandalfedition-proxy-1 landoproxyhyperion5000gandalfedition_proxy_1
pirog commented 2 years ago

Lando DOES NOT support Docker Compose 2 at this time so YMMV if you try it out.

sirdiego commented 2 years ago

Lando DOES NOT support Docker Compose 2 at this time so YMMV if you try it out.

Thanks for letting us know. Would be nice to place this info somewhere prominent in the documentation. Currently the ArchLinux installation is broken, because it installs docker-composer 2 alongside lando.

pirog commented 2 years ago

If you install one of Lando's package installers it should install the correct version of Docker Compose so i'm guessing this is only relevant if you are installing Lando from source. We should update those docs so its clear what version of Docker Compose is required: https://docs.lando.dev/basics/installation.html#from-source

pirog commented 2 years ago

Moving this ticket over to the docs repo so it can be handled there

sirdiego commented 2 years ago

If you install one of Lando's package installers it should install the correct version of Docker Compose so i'm guessing this is only relevant if you are installing Lando from source. We should update those docs so its clear what version of Docker Compose is required: https://docs.lando.dev/basics/installation.html#from-source

That makes sense. We just installed it via package manager, which is also referenced inside the docs. So maybe a hint there would be good as well. I think the installation via package manager will be broken until Docker Compose 2 support is there.

Downgrading the docker-compose package to 1.29.x manually fixes the problems. For everyone needing an old Docker Composer version for ArchLinux, you can download it here: https://archive.archlinux.org/packages/d/docker-compose/

hparadiz commented 2 years ago

Just want to say that if someone actually updated the docs it would have saved me hours of hassle. Just update the docs!

anibalsanchez commented 2 years ago

Same issue here.

Weirdly, this command fixed the issue:

docker rename 230653d52982_landoproxyhyperion5000gandalfedition_proxy_1 landoproxyhyperion5000gandalfedition_proxy_1

After clearing the .lando files, pruning the docker images, and installing these versions, it worked fine.

Client: Docker Engine - Community
 Version:           20.10.14
 API version:       1.41
 Go version:        go1.16.15
 Git commit:        a224086
 Built:             Thu Mar 24 01:47:58 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.14
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.15
  Git commit:       87a90dc
  Built:            Thu Mar 24 01:45:50 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.5.11
  GitCommit:        3df54a852345ae127d1fa3092b95168e4a88e2f8
 runc:
  Version:          1.0.3
  GitCommit:        v1.0.3-0-gf46b6ba
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
docker-compose version
docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019
radmen commented 1 year ago

FYI: Lando doesn't work with docker-compose 2.12.2. I had to downgrade it to 1.29.2 to have it work.

The issue is similar to this thread. The traefik instance is renamed to landoproxyhyperion5000gandalfedition-proxy-1. using the docker rename solution didn't work in my case.

// Edit
Adding more details: OS: NixOS 22.11

Everything works on NixOS 22.05

elvismdev commented 1 year ago

Upgrading to the Lando pre-release v3.8.0 fixed the problem for me: https://github.com/lando/lando/releases/tag/v3.8.0