Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

[BUG] Deployed daemon is always unable to send report due to error while fetching partitions with FileNotFoundError #214

Closed
Pyxsys opened this issue Mar 12, 2022 · 1 comment · Fixed by #218
Assignees
Labels
bug Something isn't working daemon Issue is related to daemons
Milestone

Comments

@Pyxsys
Copy link
Owner

Pyxsys commented Mar 12, 2022

Describe the bug

The daemon when deployed on a pi x64 environment, it always fails while fetching disk partition information.
It fails with error:
FileNotFoundError: [Errno 2] No such file or directory: '/dev/root'

To Reproduce

Steps to reproduce the behavior:

  1. Deploy the daemon on a PiOS x64 environment
  2. Start the daemon using celebid -s
  3. Wait 30s
  4. Open the daemon log
  5. See error

Or

  1. Deploy the daemon on a PiOS x64 environment
  2. Run the tests via python3 -m unittest -v
  3. See that the following tests fail:
  • testFetchingPartition
  • testAddingDiskUsageInfo

Expected behavior

The tests pass and the daemon is capable of fetching the partition information.

Device (please complete the following information):

  • type: Raspberry Pi
  • model: Raspberry Pi 3 Model B Plus Rev 1.3
  • OS: Debian GNU/Linux 11 (bullseye)
  • version: 11

Additional context

Error as it appears in the failed tests:

======================================================================
ERROR: testAddingDiskUsageInfo (test.test_report_module.TestSystemReportClass)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pi/ttg-healthcheck/daemon/test/test_report_module.py", line 99, in testAddingDiskUsageInfo
    self.test_report.add_disk_usage_info()
  File "../daemon/src/system_report.py", line 148, in add_disk_usage_info
    disk_usage['partitions'] = SysScrubber.fetch_disk_partition_status()
  File "../daemon/src/system_report.py", line 476, in fetch_disk_partition_status
    disk_buffer = psutil.disk_usage(partition_path.device)
  File "/usr/lib/python3/dist-packages/psutil/__init__.py", line 1995, in disk_usage
    return _psplatform.disk_usage(path)
  File "/usr/lib/python3/dist-packages/psutil/_psposix.py", line 169, in disk_usage
    st = os.statvfs(path)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/root'
======================================================================
ERROR: testAddingDiskUsageInfo (test.test_report_module.TestSystemReportClass)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pi/ttg-healthcheck/daemon/test/test_report_module.py", line 99, in testAddingDiskUsageInfo
    self.test_report.add_disk_usage_info()
  File "../daemon/src/system_report.py", line 148, in add_disk_usage_info
    disk_usage['partitions'] = SysScrubber.fetch_disk_partition_status()
  File "../daemon/src/system_report.py", line 476, in fetch_disk_partition_status
    disk_buffer = psutil.disk_usage(partition_path.device)
  File "/usr/lib/python3/dist-packages/psutil/__init__.py", line 1995, in disk_usage
    return _psplatform.disk_usage(path)
  File "/usr/lib/python3/dist-packages/psutil/_psposix.py", line 169, in disk_usage
    st = os.statvfs(path)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/root'
@Pyxsys Pyxsys added bug Something isn't working daemon Issue is related to daemons labels Mar 12, 2022
@Pyxsys Pyxsys added this to the Sprint 8 milestone Mar 12, 2022
@Pyxsys
Copy link
Owner Author

Pyxsys commented Mar 12, 2022

This is known psutil issue.
giampaolo/psutil#1999
DataDog/datadog-agent#10544

Need to update required psutil version to 5.9.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working daemon Issue is related to daemons
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants