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

Docker integration - AttributeError: 'NoneType' object has no attribute 'endswith' #1017

Closed
LotharSee opened this issue Jul 3, 2014 · 3 comments
Assignees
Labels
Milestone

Comments

@LotharSee
Copy link
Contributor

On a Debian Wheezy with a kernel 3.14 from backports:

Traceback (most recent call last):
  File "/opt/datadog-agent/agent/checks/__init__.py", line 501, in run
    self.check(copy.deepcopy(instance))
  File "/opt/datadog-agent/agent/checks.d/docker.py", line 192, in check
    stat_file = os.path.join(mountpoint, metric["file"] % (self.path_prefix, container["Id"]))
  File "/opt/datadog-agent/agent/checks.d/docker.py", line 129, in path_prefix
    stat_file_lxc = os.path.join(mountpoint, "lxc")
  File "/opt/datadog-agent/embedded/lib/python2.7/posixpath.py", line 77, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

Then the Docker integration doesn't work.

@LotharSee
Copy link
Contributor Author

This may happen if some cgroups are missing.

In the case, is is because of the Debian kernel. memory cgroup are built in the kernel but are disabled by default.
More details here: https://wiki.debian.org/LXC

As explained in the Debian Wiki, the solution is to enable it on grub.
Edit /etc/default/grub to add:

GRUB_CMDLINE_LINUX="cgroup_enable=memory

Then run update-grub2.
Reboot.

Now memory cgroup should be mounted with other cgroups!

@remh remh added this to the 5.0 milestone Jul 10, 2014
@remh
Copy link
Contributor

remh commented Jul 10, 2014

@LotharSee could you catch that error so it would give users a better information message ?
A link to this page would be great!

@remh
Copy link
Contributor

remh commented Aug 22, 2014

Fixed with Agent 5.0.0

@remh remh closed this as completed Aug 22, 2014
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

2 participants