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

Recurring Couldn't Get Process Limits Error #40

Open
faust64 opened this issue Apr 18, 2021 · 1 comment
Open

Recurring Couldn't Get Process Limits Error #40

faust64 opened this issue Apr 18, 2021 · 1 comment

Comments

@faust64
Copy link

faust64 commented Apr 18, 2021

Hi,

Checking logs for a systemd-exporter - that works perfectly fine, ... out of curiosity - I'm finding about the following logs:

Apr 18 08:28:01 xxx systemd_exporter[16389]: time="2021-04-18T08:28:01+02:00" level=warning msg="couldn't get unit's metrics: couldn't get process limits: couldn't parse value 18446744073708503040 18446744073708503040 bytes: strconv.ParseInt: parsing \"18446744073708503040 18446744073708503040 bytes\": invalid syntax" source="systemd.go:332" unit=ntp.service
Apr 18 08:28:11 xxx systemd_exporter[16389]: time="2021-04-18T08:28:11+02:00" level=warning msg="couldn't get unit's metrics: couldn't get process limits: couldn't parse value 18446744073708503040 18446744073708503040 bytes: strconv.ParseInt: parsing \"18446744073708503040 18446744073708503040 bytes\": invalid syntax" source="systemd.go:332" unit=ntp.service
Apr 18 08:28:21 xxx systemd_exporter[16389]: time="2021-04-18T08:28:21+02:00" level=warning msg="couldn't get unit's metrics: couldn't get process limits: couldn't parse value 18446744073708503040 18446744073708503040 bytes: strconv.ParseInt: parsing \"18446744073708503040 18446744073708503040 bytes\": invalid syntax" source="systemd.go:332" unit=ntp.service

Looking into the systemd.go file, I figured out we're trying to read the /proc//limits file corresponding to my ntpd.
I could find back the value it's trying to parse:

# ps ax | grep ntp
 3416 ?        Ssl   27:56 /usr/bin/node_exporter --collector.interrupts --collector.ntp --collector.tcpstat --collector.processes --collector.systemd --web.listen-address=:9142
18793 ?        Ssl    0:06 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -c /run/ntp.conf.dhcp -u 110:116
20191 pts/0    S+     0:00 grep ntp
# cat /proc/18793/limits 
Limit                     Soft Limit           Hard Limit           Units     
Max cpu time              unlimited            unlimited            seconds   
Max file size             unlimited            unlimited            bytes     
Max data size             unlimited            unlimited            bytes     
Max stack size            204800               unlimited            bytes     
Max core file size        0                    unlimited            bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             64010                64010                processes 
Max open files            1024                 524288               files     
Max locked memory         18446744073708503040 18446744073708503040 bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       64010                64010                signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us        

I'm not certain: is that issue due to the exporter expecting to find a single value and parse it?!?
Or... looking at those values: are we overflowing some variable in memory?

Checking the procfs library, they do appear to use some uint64 for those ( https://github.com/prometheus/procfs/blob/master/proc_limits.go ).

Although this seems to be a recent contribution: prometheus/procfs@f159672#diff-7d0cfb3195c0b0408bfcd91c47e8f9d8df3b4f27894687fec6068707d8b8b672

The version shipping with the systemd-exporter being 0.0.11 (https://github.com/povilasv/systemd_exporter/blob/master/go.mod#L14), we could probably update it.

Let me know if I missed something, or if I can help in any way.
Sorry I'm not familiar enough with Go to submit a proper PR ...

faust64 added a commit to Worteks/systemd_exporter that referenced this issue May 3, 2021
flaktack pushed a commit to flaktack/systemd_exporter that referenced this issue Jul 12, 2021
@SuperQ
Copy link
Contributor

SuperQ commented Jul 19, 2022

Fixed with #50.

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