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

Procfs v0.8.1 does not support kernel version string larger than 256 #267

Closed
charles-typ opened this issue Feb 21, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@charles-typ
Copy link

Bug description

Linux kernel version: 4.19.270. When I tried to run scaphandre (version 0.4.1) with qemu exporter, I got the following error:

Sending ⚡ metrics 
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Other("Failed to parse patch version")', /home/XXX/.cargo/registry/src/github.com-1ecc6299db9ec823/procfs-0.8.1/src/lib.rs:315:34                                
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To Reproduce

Directly compile the code.

Expected behavior

Qemu exporter should be started.

Environment

  • Linux distribution version [Ubuntu 18.04.6 LTS]
  • Kernel version (output of uname -r) [4.19.270]

Additional context

After a deep dive, the procfs version v0.8.1 still uses u8 as the kernel version patch string, and any number larger than 256 with cause a panic. A simple workaround for me was to compile my own procfs-v0.8.1 but change the patch to u16, following this patch. A better solution would be upgrading procfs version to v0.10.0 or newer because the patch was applied to that version and above. It's not a simple fix, as procfs changed the interface from floating point numbers to integers for CPU information. Details can be found here and here.

@charles-typ charles-typ added the bug Something isn't working label Feb 21, 2023
@bpetit
Copy link
Contributor

bpetit commented Mar 20, 2023

Hi !

Thanks for reporting this. We just moved most of what procfs did to sysinfo (except the container information gathering part).

Could you give a try to the current dev branch to see if this problem gets any better ?

@bpetit
Copy link
Contributor

bpetit commented Aug 11, 2023

Closing until someone speaks up :)

@bpetit bpetit closed this as completed Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Previous releases
Development

No branches or pull requests

2 participants