Core: Glances Task exception - Platform glances does not generate unique IDs

Created on 29 Feb 2020  路  13Comments  路  Source: home-assistant/core

The problem

Since home assistant 0.106.x and glances 0.7.0 I鈥檓 getting the following errors on server startup:

2020-02-29 10:30:13 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity raise HomeAssistantError(msg) homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.glances_core_0_temp. Platform glances does not generate unique IDs

Environment

Home assistant version 0.106.2
Glances addon 0.7.0
Running home assistant (hassio) on a docker under Ubuntu linux

  • Home Assistant release with the issue: 0.106.x
  • Last working Home Assistant release (if known): 0.105.5
  • Operating environment (Hass.io/Docker/Windows/etc.): Docker
  • Integration causing this issue: Glances
  • Link to integration documentation on our website:
    https://www.home-assistant.io/integrations/glances/

    Problem-relevant configuration.yaml

{
    "connection_class": "local_poll",
    "data": {
        "host": "localhost",
        "name": "Glances",
        "password": "****",
        "port": 61208,
        "ssl": false,
        "username": "****",
        "verify_ssl": false,
        "version": 3
    },
    "domain": "glances",
    "entry_id": "0b5c742db46e41c887601ed51f535d80",
    "options": {
        "scan_interval": 60
    },
    "source": "user",
    "system_options": {
        "disable_new_entities": false
    },
    "title": "Glances",
    "unique_id": null,
    "version": 1
}

Traceback/Error logs

2020-02-29 10:30:13 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity
    raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.glances_thinkpad_1_temp. Platform glances [does](url) not generate unique IDs
2020-02-29 10:30:13 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity
    raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.glances_core_2_temp. Platform glances does not generate unique IDs
2020-02-29 10:30:13 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity
    raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.glances_core_0_temp. Platform glances does not generate unique IDs 

Additional information

I have tried removing the integration, addon, make sure no entities exists, delete glances.conf file and adding all again.

glances stale

Most helpful comment

@engrbm87

Thanks @Tosko4 , it seems that the repeated sensors have the same details. This looks like a issue related to glances itself. Can you confirm that you have the latest version installed.
These errors should not stop the integration from loading and updating the configured sensors. Can you please confirm.

I did dig future for that few weeks ago, the duplicated names are already at the lm_sensors package which is used to read the sensors data.
However for glances it has no meaning, the glances UI can show the multiple sensors with the same name.
In my opinion when trying to create a unique_id or name for them to add as sensors for home assistant the integration should add 1, 2, 3, etc for sensors which has the same name.

All 13 comments

Please add the relevant configuration.yaml part to the issue in addition to the entity registry snippet, thanks 馃憤
Moreover, have you taken notice of the glances breaking change?

Hey there @fabaff, @engrbm87, mind taking a look at this issue as its been labeled with a integration (glances) you are listed as a codeowner for? Thanks!

Please add the relevant configuration.yaml part to the issue in addition to the entity registry snippet, thanks 馃憤
Moreover, have you taken notice of the glances breaking change?

I have nothing related to glances in configuration.yaml, I added the integrations via the integrations panel under configuration.

I read all the breaking changes, the important breaking change is that the entities are dynamically created, that is why I have tried to remove the integration, make sure no entities with "glances" exists and added the integration again.

Same issue here. Glances seems to report some duplicated sensors and the integration is not handling it properly.

glances_sensors

Same here:
image

same issue here. seems to be different sensors everytime i reboot my HA

Log Details (ERROR)

Logger:聽homeassistant.core
Source:聽helpers/entity_platform.py:425
First occurred:聽2:46:56 PM聽(5聽occurrences)
Last logged:聽2:46:56 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity
    raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.glances_core_3_temp. Platform glances does not generate unique IDs

or

Log Details (ERROR)

Logger: homeassistant.core
Source: helpers/entity_platform.py:425 
First occurred: 7:35:33 PM (5 occurrences) 
Last logged: 7:35:33 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity
    raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.glances_package_id_0_temp. Platform glances does not generate unique IDs

Hello,
Can you enter the below in your browser and send us the json result:
http://IP_ADDRESS:61208/api/3/sensors

@engrbm87

[{"label": "acpitz 1", "value": 27, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "acpitz 2", "value": 29, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "Package id 0", "value": 35, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "Core 0", "value": 31, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "Core 1", "value": 31, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "Core 2", "value": 32, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "Core 3", "value": 36, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "Package id 0", "value": 35, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "Core 0", "value": 31, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "Core 1", "value": 31, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "Core 2", "value": 32, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "Core 3", "value": 36, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "SYSTIN", "value": 28, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "PCH_CPU_TEMP", "value": 0, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "CPUTIN", "value": 28, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "AUXTIN0", "value": -61, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "AUXTIN1", "value": -61, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "AUXTIN2", "value": -61, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "AUXTIN3", "value": -61, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "PECI Agent 0", "value": 27, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "PCH_CHIP_CPU_MAX_TEMP", "value": 0, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "PCH_CHIP_TEMP", "value": 0, "unit": "C", "type": "temperature_core", "key": "label"}, {"label": "nct6779 1", "value": 1228, "unit": "R", "type": "fan_speed", "key": "label"}, {"label": "nct6779 2", "value": 1283, "unit": "R", "type": "fan_speed", "key": "label"}, {"label": "nct6779 3", "value": 538, "unit": "R", "type": "fan_speed", "key": "label"}, {"label": "nct6779 4", "value": 1207, "unit": "R", "type": "fan_speed", "key": "label"}, {"label": "nct6779 5", "value": 0, "unit": "R", "type": "fan_speed", "key": "label"}, {"label": "cpu_fan", "value": 0, "unit": "R", "type": "fan_speed", "key": "label"}]

So the response is valid when i run it through a validator and here is the readable format:

[ { "label":"acpitz 1", "value":27, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"acpitz 2", "value":29, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"Package id 0", "value":35, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"Core 0", "value":31, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"Core 1", "value":31, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"Core 2", "value":32, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"Core 3", "value":36, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"Package id 0", "value":35, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"Core 0", "value":31, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"Core 1", "value":31, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"Core 2", "value":32, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"Core 3", "value":36, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"SYSTIN", "value":28, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"PCH_CPU_TEMP", "value":0, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"CPUTIN", "value":28, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"AUXTIN0", "value":-61, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"AUXTIN1", "value":-61, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"AUXTIN2", "value":-61, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"AUXTIN3", "value":-61, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"PECI Agent 0", "value":27, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"PCH_CHIP_CPU_MAX_TEMP", "value":0, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"PCH_CHIP_TEMP", "value":0, "unit":"C", "type":"temperature_core", "key":"label" }, { "label":"nct6779 1", "value":1228, "unit":"R", "type":"fan_speed", "key":"label" }, { "label":"nct6779 2", "value":1283, "unit":"R", "type":"fan_speed", "key":"label" }, { "label":"nct6779 3", "value":538, "unit":"R", "type":"fan_speed", "key":"label" }, { "label":"nct6779 4", "value":1207, "unit":"R", "type":"fan_speed", "key":"label" }, { "label":"nct6779 5", "value":0, "unit":"R", "type":"fan_speed", "key":"label" }, { "label":"cpu_fan", "value":0, "unit":"R", "type":"fan_speed", "key":"label" } ]

Thanks @Tosko4 , it seems that the repeated sensors have the same details. This looks like a issue related to glances itself. Can you confirm that you have the latest version installed.
These errors should not stop the integration from loading and updating the configured sensors. Can you please confirm.

@engrbm87

I am running Glances as an Home Assistant addon ( https://github.com/hassio-addons/addon-glances/releases )

Running release: v0.7.1 which in the release notes show: Updates glances to v3.1.4
On the glances github page it shows that 3.1.4 is actually the latest ( https://github.com/nicolargo/glances/releases )

And yes, I can confirm that it doesn't stop the integration from loading and updating. But nonetheless, would be good to have this solved. But as I understand it's not something you can solve and should be solved by the developer or a contributor for glances software itself?

I went through the open issues on the glances github page and I couldn't find an issue raised for this matter (or at least not able to translate someones issue to reflect the issues mentioned here). Could you please, as I think you have more knowledge and experience with this, raise an issue on their github page on behalf of all of us?

@engrbm87

Thanks @Tosko4 , it seems that the repeated sensors have the same details. This looks like a issue related to glances itself. Can you confirm that you have the latest version installed.
These errors should not stop the integration from loading and updating the configured sensors. Can you please confirm.

I did dig future for that few weeks ago, the duplicated names are already at the lm_sensors package which is used to read the sensors data.
However for glances it has no meaning, the glances UI can show the multiple sensors with the same name.
In my opinion when trying to create a unique_id or name for them to add as sensors for home assistant the integration should add 1, 2, 3, etc for sensors which has the same name.

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 馃憤
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Well just for anyone reaching it in the future, this issue was not resolved, Since there was no solution I switch to something else than glances. If someone still needs a solution please open again.

Was this page helpful?
0 / 5 - 0 ratings