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

Glances V4 Support #117360

Closed
ABEIDO opened this issue May 13, 2024 · 22 comments · Fixed by #117664
Closed

Glances V4 Support #117360

ABEIDO opened this issue May 13, 2024 · 22 comments · Fixed by #117664

Comments

@ABEIDO
Copy link

ABEIDO commented May 13, 2024

The problem

My Unraid Glances docker had updated to v4.0.1 using nicolargo/glances:latest.

After update all sensors from unraid went unavailable and intregration in HA failed.
Reverted back to V3.4.0.5 and all was ok again.

Do i need to reconfig something or is the HA side of it in need of update if so is there any support coming for v4?

What version of Home Assistant Core has the issue?

2024.5.3

What was the last working version of Home Assistant Core?

N/A

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Glances

Link to integration documentation on our website

https://www.home-assistant.io/integrations/glances/

Diagnostics information

2024-05-13 14:06:04.148 DEBUG (MainThread) [homeassistant.components.glances] Failed to connect to Glances API v3: endpoint: 'all' is not valid
2024-05-13 14:06:04.148 WARNING (MainThread) [glances_api] Glances api older than v3 will not be supported in the next release.
2024-05-13 14:06:04.153 DEBUG (MainThread) [homeassistant.components.glances] Failed to connect to Glances API v2: endpoint: 'all' is not valid
2024-05-13 14:06:04.153 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry UNRAID for glances: Could not connect to Glances API version 2 or 3
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/glances/init.py", line 47, in async_setup_entry
api = await get_api(hass, dict(config_entry.data))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/glances/init.py", line 103, in get_api
raise ServerVersionMismatch("Could not connect to Glances API version 2 or 3")
homeassistant.components.glances.ServerVersionMismatch: Could not connect to Glances API version 2 or 3

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/glances/init.py", line 53, in async_setup_entry
raise ConfigEntryError(err) from err
homeassistant.exceptions.ConfigEntryError: Could not connect to Glances API version 2 or 3

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @engrbm87, mind taking a look at this issue as it has been labeled with an integration (glances) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of glances can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign glances Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


glances documentation
glances source
(message by IssueLinks)

@zollak
Copy link

zollak commented May 13, 2024

Same here, my glances version is the following:

root@pve:~# glances --version
Glances version:        4.0.1
Glances API version:    4
PsUtil version:         5.9.8
Log file:               /root/.local/share/glances/glances.log

Proxmox version where I run glances:

root@pve:~# pveversion 
pve-manager/8.1.10/4b06efb5db453f29 (running kernel: 6.5.13-3-pve)

root@pve:~# cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian

HA version where I would add glances as a new integration:

Core 2024.5.3
Supervisor 2024.05.1
Operating System 12.3
Frontend 20240501.1

@ABEIDO
Copy link
Author

ABEIDO commented May 13, 2024

From errorlog: Error setting up entry UNRAID for glances: Could not connect to Glances API version 2 or 3
Feels like the api vers 3 is gone and only a new v4 is alive, but its just my guess

@stefan1495
Copy link

Seems like their Versioning is always breaking-changing 👎
See https://github.com/nicolargo/glances/blob/develop/docs/api.rst (v4) and https://github.com/nicolargo/glances/blob/support/glancesv3/docs/api.rst (v3)

@zollak
Copy link

zollak commented May 13, 2024

I was able to solve it to revert back the earlier version like this:

root@pve:~# pip uninstall glances
root@pve:~# pip install -v glances==3.4.0.5

root@pve:~# glances -w --username --password
Define the Glances webserver username: glances
Bottle module not found. Glances cannot start in web server mode.

root@pve:~# pip install bottle
root@pve:~# glances -w --username --password

root@pve:~# glances --version
Glances v3.4.0.5 with PsUtil v5.9.8
Log file: /root/.local/share/glances/glances.log
root@pve:~# systemctl enable glances.service
root@pve:~# systemctl start glances.service

Of course, it not solve the v4 API related issue. In the Glances HA integration the new v4 API support should be implemented...

@rcastberg
Copy link

A quick workaround until the HomeAssistant plugin has support is to change the repository line in Unraid to:
nicolargo/glances:3.4.0.5
This will downgrade galnces to the last v3.

@latel
Copy link

latel commented May 14, 2024

same here

glances -V

Glances version: 4.0.2
Glances API version: 4
PsUtil version: 5.9.8
Log file: /tmp/glances-root.log

@nohumaninput
Copy link

nohumaninput commented May 15, 2024

I have same problem. Looks like V4 API is not supported by the integration atm.

Glances version: 4.0.4
Glances API version: 4
PsUtil version: 5.9.4

@AnthonyBe
Copy link

I certainly hope that the integration can be updated to support Glances v4 API!

@Tyrian81
Copy link

Same issue , integration need updated API paths
Old paths for v3 is like this API path: /api/3/
Please add an option to version 4

@Marcel0024
Copy link

Might be an straight forward fix. This line needs an 4 added to the loop.

@keniji
Copy link

keniji commented May 17, 2024

A quick workaround until the HomeAssistant plugin has support is to change the repository line in Unraid to: nicolargo/glances:3.4.0.5 This will downgrade galnces to the last v3.

Thanks for posting this workaround.

So put an eye here and hoping the plugin will support v4 soon..

@wittypluck
Copy link
Contributor

Might be an straight forward fix. This line needs an 4 added to the loop.

There's also a breaking change on network sensors, I've submitted a PR here :
home-assistant-ecosystem/python-glances-api#40

@sythesigh
Copy link

Having the same issue here, integration needs updating to accept the new v4. Please notify when this issue is resolved so I can reinstall the integration. Thanks for all your hard work.

@prwood
Copy link

prwood commented May 20, 2024

Same issue here, can't add Glances hosts to HA if they're running Glances 4.x.

@adorobis
Copy link

Can't find information on what is the planned release date, seems it didn't get into 2024.5.5 release, did it?

@wittypluck
Copy link
Contributor

I think it will be released in the next major, so 2024.6 (beginning of June)

@wittypluck
Copy link
Contributor

As a side note there is an issue on CPU temperature sensor on Glances versions 4.0.4 to 4.0.6, so you'll want to upgrade to 4.0.7 if you use this sensor

@adorobis
Copy link

Cool, thanks for info!

@latel
Copy link

latel commented May 29, 2024

when will this awesome upgrade merged into homeassistant core?

@adorobis
Copy link

I think it will be released in the next major, so 2024.6 (beginning of June)

@edenhaus
Copy link
Contributor

I think it will be released in the next major, so 2024.6 (beginning of June)

Correct :)
New features will never be part of patch releases. Patch releases are only fixing bugs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.