datadog-agent icon indicating copy to clipboard operation
datadog-agent copied to clipboard

Possible race condition for killed Docker containers

Open benbc opened this issue 8 years ago • 11 comments

I'm running datadog-agent 6.1.0 on Kubernetes 1.8.9 (running on GKE).

I deleted a handful of pods in my cluster and for each corresponding container I saw two logs from datadog-agent:

[ AGENT ] 2018-03-26 09:31:44 UTC | ERROR | (docker_main.go:118 in fetchForDockerID) | Failed to inspect container cfc65ca71e3fc63124d582317f54d07e51d9f4ba2ad6a4593ed7e79362146c45 - Error: No such container: cfc65ca71e3fc63124d582317f54d07e51d9f4ba2ad6a4593ed7e79362146c45
[ AGENT ] 2018-03-26 09:31:44 UTC | WARN | (tagger.go:245 in Tag) | error collecting from docker: Error: No such container: cfc65ca71e3fc63124d582317f54d07e51d9f4ba2ad6a4593ed7e79362146c45

These logs come from https://github.com/DataDog/datadog-agent/blob/e84f7ad7829543acb2f9ac1fe6a4d1a53d3426bc/pkg/collector/corechecks/containers/docker.go#L218 and https://github.com/DataDog/datadog-agent/blob/c98beb40bbaee155152cf43e63ebe794a918625b/pkg/tagger/tagger.go#L245.

This doesn't look like an error condition to me (or even something that should be warned about). Indeed it appears in the second case that the code is trying to handle this condition explicitly in the clause before. (This looks like it's somewhat related to #1345, so perhaps that just isn't working as expected yet.)

benbc avatar Mar 26 '18 10:03 benbc

We're seeing similar behavior on containers that were cleaned up by docker-gc using datadog-agent 6.1.2 on kube.

packetfodder avatar May 09 '18 19:05 packetfodder

We use datadog-agent 6.5.2. The problem still exists. Looks like because of this we don't see certain docker events.

vvbogdanov87 avatar Oct 15 '18 08:10 vvbogdanov87

This is also affecting us. We have an automated system that deletes old containers. We're getting spammed with these "errors" in our logs.

irlevesque avatar Nov 26 '18 14:11 irlevesque

Also seeing this problem, besides our agents are getting restarted and I'm not sure if thisis the reason (probe just fails with 12 unhealthy components after a minute)

eduardohl avatar Dec 13 '18 13:12 eduardohl

All,

Apologies for the delay on this issue. This log can occur in a few scenarios. Especially if the containers churn - As you can see we readjusted the logging in #2485 so we do not log misleading errors that are actually info/debug.

We will be releasing the new version of the agent 6.8.1 shortly, which will embed this fix.

Thank you very much for your patience. Best, .C

CharlyF avatar Dec 17 '18 15:12 CharlyF

Closing as this fix was released. Feel free to reach out if you are still having issues.

CharlyF avatar Mar 19 '19 14:03 CharlyF

I still have Agent 6.10 flooding the logs with these exact same error messages at the same log levels.

joekohlsdorf avatar Apr 04 '19 13:04 joekohlsdorf

I have the same error message and seems that the stats metrics API doesn't work. I am not sure if the error causes the problem.

roysongbb10 avatar Apr 25 '19 14:04 roysongbb10

Same with 6.13.

mbelang avatar Sep 11 '19 13:09 mbelang

v6.14.0 does the same

andreimahu avatar Sep 24 '19 11:09 andreimahu

Confirm it happens in 6.10.1

lgg42 avatar Apr 16 '20 12:04 lgg42