docker_state_exporter icon indicating copy to clipboard operation
docker_state_exporter copied to clipboard

unsupported API ?

Open GN01 opened this issue 3 years ago • 4 comments

#docker version Client: Version: 19.03.6-ce API version: 1.40 Go version: go1.13.4 Git commit: 369ce74 Built: Fri May 29 04:01:26 2020 OS/Arch: linux/amd64 Experimental: false

Server: Engine: Version: 19.03.6-ce API version: 1.40 (minimum version 1.12) Go version: go1.13.4 Git commit: 369ce74 Built: Fri May 29 04:01:57 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.3.2 GitCommit: ff48f57fc83a8c44cf4ad5d672424a98ba37ded6 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683

error log: {"address":":8812","message":"Server listening...","severity":"info","timestamp":"2022-01-14T02:42:52.470521503Z"} {"message":"Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40","severity":"error","timestamp":"2022-01-14T02:42:52.911369808Z"}

GN01 avatar Jan 14 '22 02:01 GN01

I have same issue

chris-ryu avatar Mar 16 '22 12:03 chris-ryu

This is because the docker/docker/client library is newer than the docker installation. We should probably enable auto-negotiation of the used api version: https://github.com/moby/moby/blob/master/client/client.go#L208

bodograumann avatar Apr 22 '22 14:04 bodograumann

You can workaround the problem by explicitely defining the api version to use with an environment variable:

DOCKER_API_VERSION=1.40

bodograumann avatar Apr 22 '22 14:04 bodograumann

您可以通过明确定义要与环境变量一起使用的 api 版本来解决此问题:

DOCKER_API_VERSION=1.40

thanks you .As you said, the problem has been solved

sudo docker run -d
-v "/var/run/docker.sock:/var/run/docker.sock"
-p 8080:8080
--env DOCKER_API_VERSION=1.40
karugaru/docker_state_exporter
-listen-address=:8080

GN01 avatar Apr 22 '22 14:04 GN01