From c35186b0b906dbda224d94c37794022762fcb374 Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Mon, 22 Aug 2016 22:09:25 -0400 Subject: [PATCH] Fix inspect Dead container Signed-off-by: Lei Jitang --- daemon/inspect.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daemon/inspect.go b/daemon/inspect.go index 6499fb89c6..75ca253a85 100644 --- a/daemon/inspect.go +++ b/daemon/inspect.go @@ -167,7 +167,10 @@ func (daemon *Daemon) getInspectData(container *container.Container, size bool) contJSONBase.GraphDriver.Name = container.Driver graphDriverData, err := container.RWLayer.Metadata() - if err != nil { + // If container is marked as Dead, the container's graphdriver metadata + // could have been removed, it will cause error if we try to get the metadata, + // we can ignore the error if the container is dead. + if err != nil && !container.Dead { return nil, err } contJSONBase.GraphDriver.Data = graphDriverData