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

[Docker] Docker lib version 6.1.0 breaks Glances #2366

Closed
nicolargo opened this issue May 6, 2023 · 10 comments
Closed

[Docker] Docker lib version 6.1.0 breaks Glances #2366

nicolargo opened this issue May 6, 2023 · 10 comments
Labels
breaking change dependencies Pull requests that update a dependency file
Milestone

Comments

@nicolargo
Copy link
Owner

After an upgrade from Docker lib version 6.0.1 to 6.1.0, Glances do not start anymore.

Workaround waiting merge of #1985 : Pin Docker to 6.0.1

@nicolargo nicolargo added breaking change dependencies Pull requests that update a dependency file labels May 6, 2023
@nicolargo nicolargo added this to the Glances 3.4.0 milestone May 6, 2023
@nicolargo
Copy link
Owner Author

nicolargo commented May 6, 2023

Additional info

With Docker 6.0.1:

>>> import docker
>>> c = docker.from_env()
>>> for i in c.containers.list():
...     i.stats(decode=True)
... 
<generator object APIClient._stream_helper at 0x7f236f354eb0>

With Docker 6.1.0:

>>> import docker
>>> c = docker.from_env()
>>> for i in c.containers.list():
...     i.stats(decode=True)
... 
Never return anything...

@nicolargo
Copy link
Owner Author

Solve by forcing a stream=True option on the stats() method.

@RazCrimson
Copy link
Collaborator

@nicolargo
I can't seem to reproduce the working behavior of docker lib with 6.1.0 even with stream=True
Ref: docker/docker-py#3118 (comment)

Could you just verify that it works fine once more on your end, before making the release?

@nicolargo
Copy link
Owner Author

@RazCrimson I confirm it works on my side with the stream=True option.

@RazCrimson
Copy link
Collaborator

Weird, not sure now it's failing on my end.

Anyways it's fine if it's working then. 🙂

@nicolargo
Copy link
Owner Author

nicolargo commented May 7, 2023

Strange it works when i start Glances from my host (make run).

But it fails when i run it from a container (make run-docker-alpine-dev)... If i disable the Docker plugin, it work:

docker run --rm -e TZ="" -e GLANCES_OPT="" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-alpine-dev
=> Never display the Curse UI

docker run --rm -e TZ="" -e GLANCES_OPT="--disable-plugin docker" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-alpine-dev
==> OK

@nicolargo nicolargo reopened this May 7, 2023
@nicolargo
Copy link
Owner Author

Inside the glances:local-alpine-dev container:

docker exec -it cc811eea9170 /bin/sh
/glances # python
Python 3.10.11 (main, Apr  6 2023, 01:16:54) [GCC 12.2.1 20220924] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker
>>> docker.__version__
'6.1.0'
>>> c = docker.from_env()
>>> c.version()
{'Platform': {'Name': 'Docker Engine - Community'}, 'Components': [{'Name': 'Engine', 'Version': '23.0.1', 'Details': {'ApiVersion': '1.42', 'Arch': 'amd64', 'BuildTime': '2023-02-09T19:46:56.000000000+00:00', 'Experimental': 'false', 'GitCommit': 'bc3805a', 'GoVersion': 'go1.19.5', 'KernelVersion': '5.15.0-58-generic', 'MinAPIVersion': '1.12', 'Os': 'linux'}}, {'Name': 'containerd', 'Version': '1.6.19', 'Details': {'GitCommit': '1e1ea6e986c6c86565bc33d52e34b81b3e2bc71f'}}, {'Name': 'runc', 'Version': '1.1.4', 'Details': {'GitCommit': 'v1.1.4-0-g5fd4c4d'}}, {'Name': 'docker-init', 'Version': '0.19.0', 'Details': {'GitCommit': 'de40ad0'}}], 'Version': '23.0.1', 'ApiVersion': '1.42', 'MinAPIVersion': '1.12', 'GitCommit': 'bc3805a', 'GoVersion': 'go1.19.5', 'Os': 'linux', 'Arch': 'amd64', 'KernelVersion': '5.15.0-58-generic', 'BuildTime': '2023-02-09T19:46:56.000000000+00:00'}
>>> for i in c.containers.list():
...     i.stats(decode=True)
...
>>> NEVER RETURNED... 

@nicolargo
Copy link
Owner Author

My bad !

I use the version 6.0.1 on my host, it is why it is working !

So the issue is not resolved by the use of stream=True :(

@nicolargo
Copy link
Owner Author

So waiting for docker/docker-py#3118 correction, we have to pin the Docker-Py version to 6.0.1...

@RazCrimson
Copy link
Collaborator

Closing this as we have a newer release with the required patch in 6.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants