From 8a0b851b88ab94e6d4e682833c30c09c39647f47 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Mon, 28 Aug 2017 15:36:45 +0200 Subject: [PATCH] server: container_remove: ignore not existent exit file Found out that during OpenShift testing, node was trying to remove containers (probably in a bad state) and was failing the removal with this kind of error: E0828 13:19:46.082710 1235 kuberuntime_gc.go:127] Failed to remove container "e907f0f46b969e0dc83ca82c03ae7dd072cfe4155341e4521223d9fe3dec5afb": rpc error: code = 2 desc = failed to remove container exit file e907f0f46b969e0dc83ca82c03ae7dd072cfe4155341e4521223d9fe3dec5afb: remove /var/run/crio/exits/e907f0f46b969e0dc83ca82c03ae7dd072cfe4155341e4521223d9fe3dec5afb: no such file or directory I believe it's ok to ignore this error as it may happen conmon will fail early before exit file is written. Signed-off-by: Antonio Murdaca --- server/container_remove.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/container_remove.go b/server/container_remove.go index 9004c4aa..45413d2a 100644 --- a/server/container_remove.go +++ b/server/container_remove.go @@ -34,7 +34,7 @@ func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerReq return nil, fmt.Errorf("failed to delete container %s: %v", c.ID(), err) } - if err := os.Remove(filepath.Join(s.config.ContainerExitsDir, c.ID())); err != nil { + if err := os.Remove(filepath.Join(s.config.ContainerExitsDir, c.ID())); err != nil && !os.IsNotExist(err) { return nil, fmt.Errorf("failed to remove container exit file %s: %v", c.ID(), err) }