puppetlabs-toy-chest / lumogon

Get a complete picture of what your applications are made of *without* changing how you currently build and run containers. Just run and report.
Other
198 stars 14 forks source link

No output received when running report, docker API version mismatch #21

Closed sbeaulie closed 7 years ago

sbeaulie commented 7 years ago

Running lumogon returns nothing on my server.

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock puppet/lumogon report

Running with debug shows a version mismatch

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock puppet/lumogon report --debug
[lumogon] 2017/05/11 14:00:59.250697 [Docker Adapter] Creating container runtime client: Docker
[lumogon] 2017/05/11 14:00:59.254990 [Scheduler] Creating scheduler
[lumogon] 2017/05/11 14:00:59.255049 [Docker Adapter] Creating container runtime client: Docker
[lumogon] 2017/05/11 14:00:59.255067 [Scheduler] Running
[lumogon] 2017/05/11 14:00:59.256225 [Docker Adapter] Error listing running containers: Error response from daemon: client is newer than server (client API version: 1.27, server API version: 1.24)
[lumogon] 2017/05/11 14:00:59.256243 [Targets] Unable to list containers, error: Error response from daemon: client is newer than server (client API version: 1.27, server API version: 1.24)
[lumogon] 2017/05/11 14:00:59.256251 [Scheduler] Unable to normalise targets: Error response from daemon: client is newer than server (client API version: 1.27, server API version: 1.24). Exiting...

Here is my docker version

docker version
Client:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:
 OS/Arch:      linux/amd64
remh commented 7 years ago

same here:

$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock puppet/lumogon report --debug
[lumogon] 2017/05/11 15:30:53.347793 [Docker Adapter] Creating container runtime client: Docker
[lumogon] 2017/05/11 15:30:53.348756 [Scheduler] Creating scheduler
[lumogon] 2017/05/11 15:30:53.348775 [Docker Adapter] Creating container runtime client: Docker
[lumogon] 2017/05/11 15:30:53.348783 [Scheduler] Running
[lumogon] 2017/05/11 15:30:53.349415 [Docker Adapter] Error listing running containers: Error response from daemon: client is newer than server (client API version: 1.27, server API version: 1.24)
[lumogon] 2017/05/11 15:30:53.349429 [Targets] Unable to list containers, error: Error response from daemon: client is newer than server (client API version: 1.27, server API version: 1.24)
[lumogon] 2017/05/11 15:30:53.349436 [Scheduler] Unable to normalise targets: Error response from daemon: client is newer than server (client API version: 1.27, server API version: 1.24). Exiting...

using coreos 1381.1.0

$ docker version
Client:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   d5236f0
 Built:        Tue Apr 25 22:19:08 2017
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   d5236f0
 Built:        Tue Apr 25 22:19:08 2017
 OS/Arch:      linux/amd64
garethr commented 7 years ago

@remh @sbeaulie thanks for reporting the issues. We'll both clarify in the docs which versions of Docker are supported at the moment, and also look at expanding that support to older versions too.

finid commented 7 years ago

@garethr, so what's the minimum Docker version needed to run Lumogon?

I'm having the same issue.

johnmccabe commented 7 years ago

@finid @sbeaulie for the moment can you specify the API version your server supports when invoking the report/scan command, for example:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -e DOCKER_API_VERSION=1.24 puppet/lumogon report
sbeaulie commented 7 years ago

@johnmccabe I can confirm adding the docker api version environement variable fixed the issue

finid commented 7 years ago

If anybody is still running Docker 1.x series, I think it's better to delete that and install Docker CE. That fixed it for me.

stahnma commented 7 years ago

@garethr @johnmccabe yeah, without the -e DOCKER_API_VERSION=1.24 the default docker install on EL7 isn't compatible. We may want to document that on the main lumogon page, or update the payload to work there, if that's reasonable.

garethr commented 7 years ago

@stahnma we're working out the best approach at the moment. We'll certainly be improving error messages and updating the README with the workaround. We'll also likely do some autodetection under the hood so Lumogon simply does this for you.

We do however want to keep up with features in recent Docker releases as well, and given Docker's release cycle we'll probably have something that support which follows that.

jfryman commented 7 years ago

This was fixed with https://github.com/puppetlabs/lumogon/commit/7a0d9703c9db526f4b1adce38e16742a1e62b38a#diff-3f2a717db5d6f646b50b72c60b0117f6L47.