-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't restore image if layer does not exist #36304
Don't restore image if layer does not exist #36304
Conversation
Signed-off-by: John Howard <jhoward@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've hit this problem a few times myself
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ping @tonistiigi PTAL |
This seems ok to fix the broken state on disk but we should look into the actual problem as well instead of just ignoring the error. Have we looked into why this problem is appearing? Looking at Lines 247 to 249 in 1474ec1
|
In my case, I have only ever hit this while developing new features that were broken when I ran a test daemon, and left images without the layers being cleaned up. I've never seen it in a released version or something in master. |
@tonistiigi The two cases where it's been hit here have both been similar to @dnephin while killing/stopping a daemon while under a debugger, and during development. I don't think there's a real-world scenario. |
Signed-off-by: John Howard jhoward@microsoft.com
This was reported internally to me, and now I've run into it myself. If the daemon is under debug mode and killed at the right time, it's possible to leave an image referring to a layer which doesn't exist. During subsequent daemon startup, the daemon terminates and fails to start during image store
restore()
saying layer does not exist.This fix is similar to the check slightly higher in the
restore()
function which doesn't error out ifis.Get()
fails, instead logging it, but now checking explicitly forErrLayerDoesNotExist
when getting the layer from the layerstore.