Skip to content
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

Extracting layer fails when container is running #155

Closed
sesmith177 opened this issue Jan 8, 2018 · 7 comments
Closed

Extracting layer fails when container is running #155

sesmith177 opened this issue Jan 8, 2018 · 7 comments

Comments

@sesmith177
Copy link
Contributor

When:

  1. A container is running with a given image (e.g made up of layers A,B,C )
  2. A new image is downloaded + extracted that shares a base layer with the given image (e.g. made up of layers A,D,E)

Then extracting the first new layer (layer D in this example) will fail.

To reproduce, run in one terminal:

PS C:\Users\vagrant> docker pull microsoft/windowsservercore:1709_KB4054517
1709_KB4054517: Pulling from microsoft/windowsservercore
5847a47b8593: Already exists
e50cc21fbc56: Already exists
Digest: sha256:65a11ae1d7096b850c02184cfe30b7ef5665357472a34098afdcda94546b91b8
Status: Downloaded newer image for microsoft/windowsservercore:1709_KB4054517
PS C:\Users\vagrant> docker run -it microsoft/windowsservercore:1709_KB4054517 cmd.exe

and then in a second terminal, pull a new version of the container image:

PS C:\Users\vagrant> docker pull microsoft/windowsservercore:1709_KB4056892
1709_KB4056892: Pulling from microsoft/windowsservercore
5847a47b8593: Already exists
9f887ccb8077: Extracting [==================================================>]  689.7MB/689.7MB
failed to register layer: re-exec error: exit status 1: output: remove \\?\C:\ProgramData\docker\windowsfilter\572e75dfac18f1e5a7cf134a584e3376fa75115d17e8508240d2f71a0cb9fa14\UtilityVM\Files\Windows\WinSxS\amd64_microsoft-windows-workstationservice_31bf3856ad364e35_10.0.16299.15_none_ef2643e047f6349e\wkssvc.dll: Access is denied.

From docker info:

Default Isolation: process
Kernel Version: 10.0 16299 (16299.15.amd64fre.rs3_release.170928-1534)
sesmith177 pushed a commit to cloudfoundry-attic/windows2016fs-online-release that referenced this issue Jan 8, 2018
- workaround for microsoft/hcsshim#155
- this is safe because garden + diego have not started yet, and garden
runs with destroy_containers_on_start set to true. So all containers
currently running are going to be killed soon anyways

[#153616126]

Signed-off-by: Sam Smith <sesmith177@gmail.com>
sesmith177 added a commit to cloudfoundry-attic/windows2016fs-release that referenced this issue Jan 8, 2018
- workaround for microsoft/hcsshim#155
- this is safe because garden + diego have not started yet, and garden
runs with destroy_containers_on_start set to true. So all containers
currently running are going to be killed soon anyways

[#153616126]

Signed-off-by: Sunjay Bhatia <sbhatia@pivotal.io>
@darstahl
Copy link
Contributor

darstahl commented Jan 8, 2018

Thanks for the report. It looks to me like this is a platform bug in the layer apply when removing a file that is in the parent. I have a repro, and I am investigating.

@sunjayBhatia
Copy link
Contributor

Thanks @darrenstahlmsft, let us know if you need any more information from our environment

@sunjayBhatia
Copy link
Contributor

@darrenstahlmsft any updates on this?

@darstahl
Copy link
Contributor

darstahl commented Feb 6, 2018

We understand the issue here. It is a combination of a bug preventing deletion of hard links in some cases and a performance optimization that creates hard links that trigger the above bug. We're working on a platform fix to allow the deletion of hard links in this case, but in the mean time, I am looking into a mitigation for hcsshim that can prevent creating the hard links if they are not needed (so we don't have to delete any hard links during layer extraction).

I'll have more info or a fix either this week or next.

@darstahl
Copy link
Contributor

I've submitted #160 to fix this

@sunjayBhatia
Copy link
Contributor

sweet, thanks @darrenstahlmsft

@lowenna
Copy link
Contributor

lowenna commented Nov 8, 2018

See moby/moby#36092 (comment). Fixed in #167

@lowenna lowenna closed this as completed Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants