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

IOError: [Errno 2] No such file or directory: '/proc/net/dev' #1175

Closed
remh opened this issue Oct 24, 2014 · 7 comments
Closed

IOError: [Errno 2] No such file or directory: '/proc/net/dev' #1175

remh opened this issue Oct 24, 2014 · 7 comments
Labels
Milestone

Comments

@remh
Copy link

remh commented Oct 24, 2014

On some kernel it looks like /proc/net/dev is unavailable and it's filling up the collector log with that error

2014-10-24 18:33:24 CEST | ERROR | dd.collector | checks.network(__init__.py:552) | Check 'network' instance #0 failed
Traceback (most recent call last):
  File "/opt/datadog-agent/agent/checks/__init__.py", line 543, in run
    self.check(copy.deepcopy(instance))
  File "/opt/datadog-agent/agent/checks.d/network.py", line 78, in check
    self._check_linux(instance)
  File "/opt/datadog-agent/agent/checks.d/network.py", line 175, in _check_linux
    proc = open('/proc/net/dev', 'r')
IOError: [Errno 2] No such file or directory: '/proc/net/dev'

Last seen on an ubuntu 13.10 x64 that might be running a custom kernel.

@remh remh added this to the 5.2.0 milestone Nov 4, 2014
@a13m
Copy link

a13m commented Nov 19, 2014

There is a similar issue on OpenShift, where /proc/net/dev is present but not readable from inside a container.

@LotharSee
Copy link
Contributor

Same issue here (with a workaround using sudo):
#604

@remh
Copy link
Author

remh commented Jan 30, 2015

Adding this to triage for 5.3.0 release.

@remh remh modified the milestones: 5.3.0, 5.2.0 Jan 30, 2015
@remh remh modified the milestones: 5.4.0, 5.3.0 Apr 2, 2015
@elafarge
Copy link
Contributor

elafarge commented May 7, 2015

By any chance, does anyone have the Kernel version number. I tried on a stock ubuntu 13.10 x64 VM but I couldn't reproduce the issue there.

@yannmh yannmh modified the milestones: 5.5.0, 5.4.0 Jun 4, 2015
@yannmh yannmh added the bugfix label Jul 31, 2015
@yannmh
Copy link
Member

yannmh commented Jul 31, 2015

The issue occurs, notably, with Grsecurity kernels.

Let's see how it ends when moving from netstats to ss. cc @olivielpeau

@yannmh yannmh modified the milestones: 5.6.0, 5.5.0 Jul 31, 2015
@remh
Copy link
Author

remh commented Nov 3, 2015

This is a won't fix for now. Let's reopen if needed.

@remh remh closed this as completed Nov 3, 2015
@remh remh modified the milestones: Future, 5.6.0 Nov 3, 2015
@alexbarnsley
Copy link

I know this is closed for now, but thought I would place a workaround here in case anyone needs it. This is based on the workaround in #604 as it has changed slightly:

in /opt/datadog-agent/agent/checks.d/network.py replace:

        proc = open('/proc/net/dev', 'r')
        lines = proc.readlines()
        proc.close()

with:

        proc_net_dev, _, _ = get_subprocess_output(["cat", "/proc/net/dev"], self.log)
        lines = proc_net_dev.splitlines()

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

No branches or pull requests

6 participants