glances icon indicating copy to clipboard operation
glances copied to clipboard

Containers plugin not working on v3.4.x on Home Assistant

Open boehser-enkel opened this issue 1 year ago • 12 comments

Describe the bug Connected to Home Assistant i get no info about container (container active, container cpu used, container ram used) anymore. With 3.3.1 no problems

To Reproduce Update glances container

Expected behavior Get the existing data

Environement (please complete the following information) nicolargo/glances:3.3.1.1-full <.> nicolargo/glances:latest-full

To be completed with result of: glances --issue

boehser-enkel avatar May 26 '23 06:05 boehser-enkel

@boehser-enkel Please give more details on the issue.

How is your HomeAssistant setup? Natively or with docker?

Do you have any custom config options passed to glances?

RazCrimson avatar May 26 '23 17:05 RazCrimson

@RazCrimson perhaps the issue came from the Glances API client (https://github.com/home-assistant-ecosystem/python-glances-api) used by Home Assistant to grab the stats from the Glances server. Not sure that the change from Dockers to Containers plugin name has been taken into account.

nicolargo avatar May 27 '23 10:05 nicolargo

+1 Looking into this, ignoring the glances API and just looking at the webpage view, I see the same behavior.

3.3.1.1-full: Screenshot from 2023-06-01 05-38-17

3.4.0-full: Screenshot from 2023-06-01 05-39-09

Any version from 3.4.0 and onwards, including latest tags, show the same behavior.

In both cases, using the following command: docker run -it -d --restart="always" --net=host --privileged -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro --pid host nicolargo/glances:3.X.X.X-full

iliabaranov avatar Jun 01 '23 12:06 iliabaranov

@boehser-enkel Please give more details on the issue.

How is your HomeAssistant setup? Natively or with docker?

Do you have any custom config options passed to glances?

sorry for the late response. Everything in doker. No custom config options for glances

boehser-enkel avatar Jun 01 '23 12:06 boehser-enkel

I had the same issue here on my raspberry pi. Latest version 3.4 didn't show the containers. The 3.3.1.1-full did. Using docker compose.

jslegers73 avatar Jun 19 '23 17:06 jslegers73

@jslegers73 @iliabaranov Could you please test with the latest release 3.4.0.3-full?

I am able to get the containers plugin working with the publish image

RazCrimson avatar Jun 24 '23 13:06 RazCrimson

@RazCrimson I had a try today and unfortunately it doesn't work for me. I also tried the dev tag without success. Rolling back to version 3.3.1.1-full was the only way to solve the issue and getting data for the running containers again.

j-zarp avatar Jun 25 '23 13:06 j-zarp

@RazCrimson perhaps the issue came from the Glances API client (home-assistant-ecosystem/python-glances-api) used by Home Assistant to grab the stats from the Glances server. Not sure that the change from Dockers to Containers plugin name has been taken into account.

This is indeed the problem. I have opened an issue there.

elmigbot avatar Jun 28 '23 16:06 elmigbot

@RazCrimson I can confirm that it now works with version 3.4.0.3 on docker running on a pi. I don't use Home Assistant.

jslegers73 avatar Jun 28 '23 16:06 jslegers73

Ah indeed 3.4.0.3 seems to work correctly in console mode, but somehow no container data shows up in my grafana instance. I need to check if the data is not registered properly into the influxdb2 database or if there is an issue at the grafana level.

I use the following env variable to enable the export: GLANCES_OPT=-q --export influxdb2 --time 10 -C /glances/conf/glances.conf

[influxdb2]
host=localhost
port=8086
protocol=http
org=<my_org>
bucket=glances
token=<my_token>

(this used to work up to now -- I'll continue digging)

EDIT: There is indeed an issue related to the influxdb2 option not logging anything: https://github.com/nicolargo/glances/issues/2459

j-zarp avatar Jun 28 '23 20:06 j-zarp

I can just add that my containers view also disappeared for v.3.4.x.x Back on v3.3.1 they show fine. My Docker setup is running on an Open Media Vault server. So it seems related to this.

Danie10 avatar Jul 02 '23 14:07 Danie10

As already said (https://github.com/nicolargo/glances/issues/2430#issuecomment-1565313476), the issue came from the Glances-API client used by Home Assistant to grab the stats.

A issue is opened (but not implemented) to change the client in order to use container instead of docker in the API: https://github.com/home-assistant-ecosystem/python-glances-api/issues/18

nicolargo avatar Jul 02 '23 14:07 nicolargo

This issue is stale because it has been open for 3 months with no activity.

github-actions[bot] avatar Jun 16 '24 01:06 github-actions[bot]

I'm seeing containers listed again, so all looks good my side.

Danie10 avatar Jun 16 '24 06:06 Danie10

Closing as the issue is fixed.

RazCrimson avatar Jun 16 '24 09:06 RazCrimson