DataDog / datadog-agent

Main repository for Datadog Agent
https://docs.datadoghq.com/
Apache License 2.0
2.88k stars 1.21k forks source link

Docker errors "err: open /host/proc/mounts:" and "No such file or directory: '/host/proc/self'" #13677

Open epomatti opened 2 years ago

epomatti commented 2 years ago

Running the docker run command as explained in the getting started documentation is giving me all sorts of errors related to volume mapping.

Why is the provided documentation commands giving all of these erros? Is it because I'm running on WSL2?

Here is the full error stack: https://gist.github.com/epomatti/82d53ee5ab55d93aee5c6c22f3556226

 ERROR | (pkg/logs/internal/launchers/docker/launcher.go:90 in NewLauncher) | Could not access container log files: Error accessing /var/lib/docker/containers: no such file or directory; falling back on tailing from container runtime socket
ERROR | (pkg/util/containers/v2/metrics/system/collector_linux.go:69 in newSystemCollector) | Unable to initialize cgroup provider (cgroups not mounted?), err: open /host/proc/mounts: no such file or directory
Error running check: [{"message": "[Errno 2] No such file or directory: '/host/proc/self'"

This is the command, copy-pasted from the documentation:

docker network create foo-net

docker run --name datadog-agent \
          --network foo-net \
          -v /var/run/docker.sock:/var/run/docker.sock:ro \
          -v /proc/:/host/proc/:ro \
          -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
          -e DD_API_KEY=<***redacted key***> \
          -e DD_APM_ENABLED=true \
          -e DD_APM_NON_LOCAL_TRAFFIC=true \
          datadog/agent:latest

The WSL integration is properly set up for my host:

image

JohEngstrom commented 2 years ago

I'm trying to set up datadog agent on WSL2 as well and I'm also getting all kinds of errors. I have no idea how to fix them.

For example:

2022-10-11 06:28:11 UTC | CORE | WARN | (pkg/collector/corechecks/containers/docker/check_network.go:261 in findDockerNetworks) | Cannot list routes for container id 7d58be81bd5c8e99361d551323e699bed47ebf02b40238c24f8ffcc18de4efc9: unable to read file at: /host/proc/2736/net/route, err: open /host/proc/2736/net/route: no such file or directory, skipping

2022-10-11 06:15:19 UTC | CORE | ERROR | (pkg/util/containers/v2/metrics/system/collector_linux.go:69 in newSystemCollector) | Unable to initialize cgroup provider (cgroups not mounted?), err: open /host/proc/mounts: no such file or directory

thamer824 commented 1 year ago

i am still getting the same issues and the agent is not sending me any traces. Anyone can help me pls

vgpastor commented 1 year ago

This issue it's because Docker Windows WSL don't storage containers in default /var/lib/docker/containers.