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

System Monitor - Unique ID for disk sensor #107903

Closed
Anto79-ops opened this issue Jan 12, 2024 · 8 comments · Fixed by #107947
Closed

System Monitor - Unique ID for disk sensor #107903

Anto79-ops opened this issue Jan 12, 2024 · 8 comments · Fixed by #107947

Comments

@Anto79-ops
Copy link

The problem

Hi,

Upon updating to 2024.1.3, I get these erros in the logs.

thanks.

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:610
Integration: Sensor (documentation, issues)
First occurred: 1:27:38 PM (3 occurrences)
Last logged: 1:27:38 PM

Platform systemmonitor does not generate unique IDs. ID disk_use_percent already exists - ignoring sensor.disk_use_percent
Platform systemmonitor does not generate unique IDs. ID disk_free already exists - ignoring sensor.disk_free
Platform systemmonitor does not generate unique IDs. ID disk_use already exists - ignoring sensor.disk_use

What version of Home Assistant Core has the issue?

2024.1.3

What was the last working version of Home Assistant Core?

2024.1.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

System Monitor

Link to integration documentation on our website

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

Diagnostics information

No response

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 @gjohansson-ST, mind taking a look at this issue as it has been labeled with an integration (systemmonitor) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of systemmonitor 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 systemmonitor 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)


systemmonitor documentation
systemmonitor source
(message by IssueLinks)

@DaN66O
Copy link

DaN66O commented Jan 13, 2024

I had exactly the same problem after upgrading to the version 2024.1.3
Then I reinstalled the system monitor.
As a result, I got the error that I had before.

The error was repeated after the update.
The error has become the same again as it is written here:
#107482

Logger: homeassistant.components.systemmonitor.sensor
Source: components/systemmonitor/sensor.py:523
Integration: System Monitor ([documentation](https://www.home-assistant.io/integrations/systemmonitor), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+systemmonitor%22))
First occurred: 00:01:11 (14874 occurrences)
Last logged: 10:20:45

Error updating sensor: disk_free (/run/user/1001)
Error updating sensor: disk_use (/run/user/996)
Error updating sensor: disk_use (/run/user/1001)
Error updating sensor: disk_use_percent (/run/user/996)
Error updating sensor: disk_use_percent (/run/user/1001)
Traceback (most recent call last):
  File "/opt/homeassistant/lib/python3.11/site-packages/homeassistant/components/systemmonitor/sensor.py", line 523, in _update_sensors
    state, value, update_time = _update(type_, data)
                                ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.11/site-packages/homeassistant/components/systemmonitor/sensor.py", line 636, in _update
    state = round(_disk_usage(data.argument).free / 1024**3, 1)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.11/site-packages/homeassistant/components/systemmonitor/sensor.py", line 724, in _disk_usage
    return psutil.disk_usage(path)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.11/site-packages/psutil/__init__.py", line 2012, in disk_usage
    return _psplatform.disk_usage(path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/lib/python3.11/site-packages/psutil/_psposix.py", line 177, in disk_usage
    st = os.statvfs(path)
         ^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/run/user/996'

@glcos
Copy link
Contributor

glcos commented Jan 13, 2024

Same error here, on two different installations. And log file spammed with these errors:

2024-01-13 00:00:06.052 ERROR (SyncWorker_5) [homeassistant.components.systemmonitor.sensor] Error updating sensor: disk_free (/run/user/1000)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/systemmonitor/sensor.py", line 520, in _update_sensors
    state, value, update_time = _update(type_, data)
                                ^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/systemmonitor/sensor.py", line 633, in _update
    state = round(_disk_usage(data.argument).free / 1024**3, 1)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/systemmonitor/sensor.py", line 721, in _disk_usage
    return psutil.disk_usage(path)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/psutil/__init__.py", line 2012, in disk_usage
    return _psplatform.disk_usage(path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/psutil/_psposix.py", line 177, in disk_usage
    st = os.statvfs(path)
         ^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/run/user/1000'
2024-01-13 00:00:06.060 ERROR (SyncWorker_5) [homeassistant.components.systemmonitor.sensor] Error updating sensor: disk_free (/run/user/0)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/systemmonitor/sensor.py", line 520, in _update_sensors
    state, value, update_time = _update(type_, data)
                                ^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/systemmonitor/sensor.py", line 633, in _update
    state = round(_disk_usage(data.argument).free / 1024**3, 1)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/systemmonitor/sensor.py", line 721, in _disk_usage
    return psutil.disk_usage(path)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/psutil/__init__.py", line 2012, in disk_usage
    return _psplatform.disk_usage(path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.11/site-packages/psutil/_psposix.py", line 177, in disk_usage
    st = os.statvfs(path)
         ^^^^^^^^^^^^^^^^

System Monitor was working absolutely fine when it was in YAML file

@gjohansson-ST
Copy link
Member

I had exactly the same problem after upgrading to the version 2024.1.3 Then I reinstalled the system monitor. As a result, I got the error that I had before.

The error was repeated after the update. The error has become the same again as it is written here: #107482

It's not the same issue as the original topic. I would appreciate if you create a separate issue than trying to mixin different issues in the same issue report.

@smarthomefamilyverrips
Copy link

Same here

@jbouwh
Copy link
Contributor

jbouwh commented Jan 13, 2024

I tried to reproduce this from 2024.1.0 to 2024.1.1 to 2024.1.2 to dev. But I am not able to reproduce.
I would advice to remove the complete config entry and re-add it. You will need to enable the sensors you want to use though.

@smarthomefamilyverrips
Copy link

I tried to reproduce this from 2024.1.0 to 2024.1.1 to 2024.1.2 to dev. But I am not able to reproduce. I would advice to remove the complete config entry and re-add it. You will need to enable the sensors you want to use though.

people did try this resulting in a other error

#107903 (comment)

@garry0garry
Copy link

Home Assistant 2024.1.3

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:610
Integration: Sensor (documentation, issues)
First occurred: 6:10:15 PM (1 occurrences)
Last logged: 6:10:15 PM

Platform systemmonitor does not generate unique IDs. ID disk_use_percent already exists - ignoring sensor.disk_use_percent

@github-actions github-actions bot locked and limited conversation to collaborators Feb 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants