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

ERROR: netclass collector failed after 0.001211s: could not get net class info #1465

Closed
brushek opened this issue Aug 29, 2019 · 7 comments · Fixed by #1488
Closed

ERROR: netclass collector failed after 0.001211s: could not get net class info #1465

brushek opened this issue Aug 29, 2019 · 7 comments · Fixed by #1488

Comments

@brushek
Copy link

brushek commented Aug 29, 2019

After running node_exporter:

I get following errors:

Aug 29 23:48:26 CC1-TEST node_exporter[24813]: time="2019-08-29T23:48:26+02:00" level=error msg="ERROR: netclass collector failed after 0.001211s: could not get net class info: error obtaining net class info: failed to read file \"/sys/class/net/bond0/lower_enp2s0f0\": is a directory" source="collector.go:132"

Go version: 1.12.9
node_exporter: 0.18.1

command line to run node_exporter:

node_exporter --web.listen-address 10.20.0.100:9100 --collector.ntp.server 127.0.0.1 --collector.ntp --collector.systemd --collector.netstat.fields="^(.*_(InErrors|InErrs|InDiscards|OutDiscards)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*)|Tcp_(ActiveOpens|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts))$"
@wurenny
Copy link

wurenny commented Sep 3, 2019

similar error on master branch (each access /metrics):

ERRO[0005] ERROR: netclass collector failed after 0.014723s: could not get net class info: error obtaining net class info: failed to read file "/sys/class/net/br-35c973968f0c/duplex": invalid argument source="collector.go:132"

env info

compile branch:

master

uname -a

Linux yx3312 3.10.0-327.28.3.el7.x86_64 #1 SMP Thu Aug 18 19:05:49 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

glibc:

glibc-2.17-222.el7.x86_64

analyzed

#ls /sys/class/net/*/duplex | xargs file
/sys/class/net/br1/duplex:             ERROR: cannot read (Invalid argument)
/sys/class/net/br-35c973968f0c/duplex: ERROR: cannot read (Invalid argument)
/sys/class/net/br-6d0e1c7974b6/duplex: ERROR: cannot read (Invalid argument)
/sys/class/net/br-763c26e2c6eb/duplex: ERROR: cannot read (Invalid argument)
/sys/class/net/br-847a59ee600e/duplex: ERROR: cannot read (Invalid argument)
/sys/class/net/br-b1ea6892dc3e/duplex: ERROR: cannot read (Invalid argument)
/sys/class/net/br-bb473a8b9ae8/duplex: ERROR: cannot read (Invalid argument)
/sys/class/net/br-bd6140a9a758/duplex: ERROR: cannot read (Invalid argument)
/sys/class/net/br-f0575229f8f4/duplex: ERROR: cannot read (Invalid argument)
/sys/class/net/docker0/duplex:         ERROR: cannot read (Invalid argument)
/sys/class/net/em1/duplex:             ASCII text
/sys/class/net/em2/duplex:             ERROR: cannot read (Invalid argument)
/sys/class/net/em3/duplex:             ASCII text
/sys/class/net/em4/duplex:             ERROR: cannot read (Invalid argument)
/sys/class/net/lo/duplex:              ERROR: cannot read (Invalid argument)
/sys/class/net/veth11328be/duplex:     ASCII text
/sys/class/net/veth201dc59/duplex:     ASCII text
/sys/class/net/veth45e4727/duplex:     ASCII text
/sys/class/net/veth4a3ed5b/duplex:     ASCII text
/sys/class/net/veth594e7f0/duplex:     ASCII text
/sys/class/net/veth713c958/duplex:     ASCII text
/sys/class/net/veth774fdd0/duplex:     ASCII text

#cat /sys/class/net/br-6d0e1c7974b6/duplex 
cat: /sys/class/net/br-6d0e1c7974b6/duplex: Invalid argument
#
#stat /sys/class/net/br-6d0e1c7974b6/duplex
  File: ‘/sys/class/net/br-6d0e1c7974b6/duplex’
  Size: 4096            Blocks: 0          IO Block: 4096   regular file
Device: 10h/16d Inode: 44374       Links: 1
Access: (0444/-r--r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:sysfs_t:s0
Access: 2019-09-03 09:51:19.152032077 +0800
Modify: 2019-09-03 09:51:19.152032077 +0800
Change: 2019-09-03 09:51:19.152032077 +0800
 Birth: -

references:

https://unix.stackexchange.com/questions/319936/cat-write-error-invalid-argument
https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-net

@pgier
Copy link
Contributor

pgier commented Sep 5, 2019

This seems to be caused by the recent procfs update and should be fixed by prometheus/procfs#213

@brushek
Copy link
Author

brushek commented Sep 11, 2019

After applying this change still get error, but this time it looks like problem is elsewhere:
Sep 11 23:14:26 TEST node_exporter[1590]: time="2019-09-11T23:14:26+02:00" level=error msg="ERROR: netclass collector failed after 0.002598s: could not get net class info: error obtaining net class info: failed to read file \"/sys/class/net/bond0/name_assign_type\": invalid argument" source="collector.go:132"

[root@test /]# file /sys/class/net/bond0/name_assign_type
/sys/class/net/bond0/name_assign_type: ERROR: cannot read `/sys/class/net/bond0/name_assign_type' (Invalid argument)
[root@test /]# cat /sys/class/net/bond0/name_assign_type
cat: /sys/class/net/bond0/name_assign_type: Invalid argument
[root@test /srv/www/common/prometheus/exporters]#

@pgier
Copy link
Contributor

pgier commented Sep 12, 2019

@brushek Yes, I noticed that one also and submitted prometheus/procfs#215
Any chance you can try out that fix and confirm that it resolves the issue?

@brushek
Copy link
Author

brushek commented Sep 13, 2019

@pgier, I don't see last commit, and can't use it in go.mod, don't understand why:
https://github.com/prometheus/procfs/tree/master
vs
https://github.com/prometheus/procfs/tree/ebdc8ebb149a43867a5a1e9277de5376c7a53d18

go.mod doesn't allow to use revision version:

go: errors parsing go.mod:
/root/go/src/github.com/prometheus/node_exporter/go.mod:17: invalid module version "ebdc8ebb149a43867a5a1e9277de5376c7a53d18": unknown revision ebdc8ebb149a43867a5a1e9277de5376c7a53d18
Makefile.common:167: recipe for target 'common-lint' failed
make: *** [common-lint] Error 1

@brushek
Copy link
Author

brushek commented Sep 14, 2019

@pgier - I did manage to compile it with 'replace' directive in go.mod. Now I don't see any errors. Thank You for patches !

pgier added a commit to pgier/node_exporter that referenced this issue Sep 15, 2019
- Fixes (prometheus#1465) failure in netclass collector
- Adds parsing of CPU information

Signed-off-by: Paul Gier <pgier@redhat.com>
@pgier
Copy link
Contributor

pgier commented Sep 15, 2019

@brushek Thanks for testing! I created a new procfs release with the fix, and PR #1488 for the update.

oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this issue Apr 9, 2024
- Fixes (prometheus#1465) failure in netclass collector
- Adds parsing of CPU information

Signed-off-by: Paul Gier <pgier@redhat.com>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this issue Apr 9, 2024
- Fixes (prometheus#1465) failure in netclass collector
- Adds parsing of CPU information

Signed-off-by: Paul Gier <pgier@redhat.com>
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 a pull request may close this issue.

3 participants