From b907c4611d2f35e130fef09e47521298ad3d4165 Mon Sep 17 00:00:00 2001 From: Frank Schroeder Date: Thu, 26 Oct 2017 11:56:08 +0200 Subject: [PATCH] docker: ignore "connection reset by peer" The Docker agent closes the connection during read after we have read the body. This causes a "connection reset by peer" even though the command was successful. We ignore that error here since we got the correct status code and a response body. --- agent/checks/docker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/checks/docker.go b/agent/checks/docker.go index 28c42a757..46ff4adf0 100644 --- a/agent/checks/docker.go +++ b/agent/checks/docker.go @@ -155,7 +155,7 @@ func (c *DockerClient) StartExec(containerID, execID string) (*circbuf.Buffer, e uri := fmt.Sprintf("/exec/%s/start", execID) b, code, err := c.call("POST", uri, data) switch { - case err != nil: + case err != nil && !strings.Contains(err.Error(), "connection reset by peer"): return nil, fmt.Errorf("start exec failed for container %s: %s", containerID, err) case code == 200: return b, nil