tuned icon indicating copy to clipboard operation
tuned copied to clipboard

Fix running the CPU plugin with procfs from pypi

Open superm1 opened this issue 1 year ago • 4 comments

Using the latest procfs from pypi fails because it doesn't have a cpuinfo() member. Catch these exceptions and try to more gracefully handle them instead of a traceback from the daemon.

Link: https://pypi.org/project/procfs/

superm1 avatar Feb 22 '24 21:02 superm1

BTW - this was on Ubuntu 22.04, I ran into this problem. I didn't have anything natively installed for procfs which is why I went to pypi.

If I sudo apt install python3-linux-procfs that version seems to work.

$ apt policy python3-linux-procfs
python3-linux-procfs:
  Installed: 0.6.3-1.1build1
  Candidate: 0.6.3-1.1build1
  Version table:
 *** 0.6.3-1.1build1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        100 /var/lib/dpkg/status

But nonetheless it's better to be defensive against this problem IMO.

superm1 avatar Feb 22 '24 21:02 superm1

FWIW, the tuned package in Debian (and Ubuntu) depends on python3-linux-procfs. I don't think procfs on pypi is related to the one in that package at all.

evgeni avatar Feb 23 '24 12:02 evgeni

Right I was working from source is why I hit this.

It shares the same namespace tho. And even if I install the right one in Ubuntu if this one from pypi is installed it takes preference and causes the breakage due to search path priority.

superm1 avatar Feb 23 '24 12:02 superm1

I think if we want to handle this, we should detect the wrong library at the import and log error or warning that it's incompatible library.

yarda avatar Mar 25 '24 10:03 yarda