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

Fix running the CPU plugin with procfs from pypi #607

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

superm1
Copy link
Contributor

@superm1 superm1 commented Feb 22, 2024

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/

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
Copy link
Contributor Author

superm1 commented Feb 22, 2024

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.

@evgeni
Copy link
Contributor

evgeni commented Feb 23, 2024

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.

@superm1
Copy link
Contributor Author

superm1 commented Feb 23, 2024

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.

@yarda
Copy link
Contributor

yarda commented Mar 25, 2024

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.

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

Successfully merging this pull request may close these issues.

3 participants