-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
hcsshim::ImportLayer failed after cygwin and vs2015 build tools installations #41058
Comments
The same issue with vs2015 build tools which also was fine before:
error:
|
Is the problem fixed if you install an older version? (I don't have much experience with chocolatey, but looks like |
@thaJeztah I've tried to specify older version, but it has not changed anything (as cygwin installer downloading packages from the same repository anyway). For cygwin I'm currently using next ugly workaround - I've archived installed cygwin from images created earlier and extracting that archive - but what would I do when I'll need add new packages - I have no idea. VS2015 even worse case - version already was specified in Dockerfile (but again it is only installer which download other stuff too) - and It is not easy to transfer it from older image, as there are multiple locations and registry involved. |
Is it possible your machines have had a Windows (security) update installed? I recall there were some problematic updates a while back; #40525 (comment) |
I've tried 4 different machines, existing and freshly installed, physical and VMs, Windows 10 2004, Windows Server 2004, Windows Server 1903 - but windows update enabled on all machines - and multiple docker versions including master - I see the same failure everywhere. |
(I'm not a Windows user, so mainly trying to narrow-down things). |
@kevpar any ideas? More details that could be obtained to root-cause the problem? |
I've just created new AWS instance based on Windows_Server-2004-English-Core-ContainersLatest-2020.05.27 - ami-0afc0c287d37358a7 (docker 19.03.05 (latest available on servers - docker/for-win#7014) preinstalled) and got the same error there |
After checking kevpar's profile, repeating test on Azure :) |
I am facing the same issue and we have tried on |
I have same problem. (From: mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-1909) |
I have the same problem with Windows Server 2016 as the host system, Docker 19.03.5 (which is the latest version currently available for that system through I believe @thaJeztah's suggestion about the February 2020 Windows update is pertinent to this issue: I still keep an "old" Windows Server 2016 box around which contains a properly generated Docker image with Cygwin; after transferring that image to a "new" server, some binaries (e.g. Things are still working just fine on the "old" server (it was provisioned in January 2020 and has not had any Windows updates installed since). I tried using I would be happy to do any testing that could help resolve this issue as it is currently preventing me from provisioning any new CI server. |
@kempniu, unfortunately it is not the case. I've installed clean servers 1903 and 1909 (en_windows_server_version_1903_x64_dvd_58ddff4b.iso & en_windows_server_version_1909_x64_dvd_894c6446.iso) without any updates - docker build still failing. So I'm still looking for workarounds for cygwin and vs2015 c++ build tools installation |
Cygwin workaround which is working for me - locations and names emulating
So version from May 31st is ok, version from June 1st breaking docker. |
Thanks @isanych, that worked for me! |
I'd wonder if it does work with cygwin version 3.1.4, as with cygwin-3.1.5 this bug was introduced, which turned out to be nontrivial: https://cygwin.com/pipermail/cygwin/2020-June/245226.html |
@haubi, version which can be committed successfully is 3.1.4 from May 31st, version which causing issue is 3.1.4 from June 1st. You can install and use any version of cygwin, issue happens only when you trying to commit docker layer. It is not a cygwin bug, it's a docker bug and it is not cygwin specific, vs2015 has the same issue (and as cygwin it also was successfully installing before). |
…t working on latest docker (moby/moby#41058 (comment))
I'm also seeing this behaviour on Server 2019 with latest patches, and latest Docker installed. The workaround doesn't work for me (anymore?), because it seems as if the repository is gone. |
@maxried which repository is that? |
This cygwin site. It only returns a lot of 404s when I use it with cygwin, which then gives up. http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/64bit/2020/05/31/142136/ |
@maxried site still working for me, maybe it was temporary glitch. |
I also had to investigate a failing docker build that uses the cygwin package from chocolatey. To me it looks like the reason why it fails with cygwin 3.1.5 and later is because the cygwin postinstall scripts now create WSL symlinks (IO_REPARSE_TAG_LX_SYMLINK) by default. If I manually install the latest cygwin into an empty container and then try to commit the modified container into a new image, the commit fails with the described hcsshim::ImportLayer error. The commit is successful if I manually install cygwin 3.1.4 from the time machine http://www.crouchingtigerhiddenfruitbat.org. Note: The chocolatey package will always install the latest cygwin, so it is useless if your goal is to explicitly install an older cygwin version. I also found no way to specify the -X argument which seems to be required to use the time machine as install site. After the installation of cygwin 3.1.4 the symlinks in dev will be created as plain files.
After installing cygwin 3.1.5 the same directory looks like this:
There are other directories which will contain symlinks. The links are IO_REPARSE_TAG_LX_SYMLINK, e.g.
If I would delete all of the IO_REPARSE_TAG_LX_SYMLINK created by cygwin after the installation and then commit the container, it will succeed. So far I have not found a way to tell cygwin to create symlinks using plain files during the installation, the CYGWIN environment variable seems to be ignored when running the postinstall scripts. |
@taylorb-microsoft and @jstarks The above is pretty good information and strongly implies an issue with the FS filter. Could one of you please forward this info to Scott and the relevant folks in the FS team? I don't believe there's anything that can be fixed here in OSS code. Thanks guys :) |
Any update on this? I'm also getting the same issue |
Docker on Windows does have problems with WSL symlink created by Cygwin since version 3.1.5. See also moby/moby#41058 (comment)
Docker on Windows does have problems with WSL symlink created by Cygwin since version 3.1.5. See also moby/moby#41058 (comment)
Use CYGWIN=winsymlinks:lnk and -B option to prevent additional elevation. See moby/moby#41058.
See the discussion on the Cygwin mailing list for a possible patch to |
My colleague and I tested servercore:1809 with a variety of cygwin versions and installations and they all lead to the same ImportLayer/container commit problem. We tried to install version 3.0.0 to 3.1.5 and we tried to install directly using setup.exe and through chocolatey, nothing works! The only installation that works for us is the installation posted above with the site URL http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/64bit/2020/05/31/142136/. So my question is, what is the difference between the cygwin packages on this site and the "official" cygwin packages? |
@eembsen - these are official cygwin packages, just older version of them - site is a time machine for cygwin, but it run by enthusiast and may stop working at any moment, especially if traffic will grow significantly - so I suggest to create a local mirror by uploading content of C:\tools\cygwin\http%3a%2f%2fctm.crouchingtigerhiddenfruitbat.org%2fpub%2fcygwin%2fcirca%2f64bit%2f2020%2f05%2f31%2f142136%2f and C:\tools\cygwin\cygwinsetup.exe to local web site - that way you'll ensure that your images will continue to build even when site has issues and you'll reduce load on that site |
@isanych Thanks, will do that. |
just older versions - http://www.crouchingtigerhiddenfruitbat.org/Cygwin/timemachine.html#cygwintimemachine |
Currently the WCIFS filter (which is what implements the 'union' file system) does not support reparse points within the container layers that are not symlinks or junctions. All other reparse points (such as IO_REPARSE_TAG_LX_SYMLINK) are turned into IO_REPARSE_TAG_UNHANDLED. This is the case because most other symlinks types are interpreted or handled by filesystem filters that don't run inside the container. |
I've been unable to get the However, I've figured out a workaround that, while gross and should make us all feel bad, does work. The tl;dr is that you can change the symlinks with With a cygwin installation, you can tell which files are WSL symlinks like this:
Within cygwin bash, you can inspect the symlinks to find out how they're mapped. For example, for the files in
This leads to the following workaround:
Other packages that get installed will need similar workarounds, depending on the symlinks they use. For example, here's autoconf:
I've put the code into a gist here. |
Thanks - I have a workaround which should make us all feel even worse! 🙃
Obviously this is horrible, but the symlinks do not seem to be necessary for running non-interactive Cygwin commands inside a Docker container. YMMV. |
I'm not sure who fixed what, but this problem has gone away for me. This docker file https://github.com/SophistSolutions/Stroika/blob/d224e0/DockerBuildContainers/Windows-Cygwin-VS2k22/Dockerfile now builds for me. Using the latest cygwin and choco to install. No promises, but hope this helps! |
Description
I cannot install cygwin during
docker build
anymore (but I still can install and use it during docker run).Steps to reproduce the issue:
Dockerfile:
docker build .
Describe the results you received:
Describe the results you expected:
Image created successfully, as it was happening for a long time.
Additional information you deem important (e.g. issue happens only occasionally):
Something changed in cygwin, as failure observed on hosts where it was installing successfully before and there were no changes in docker on these hosts. I see the same issue on docker 19.03.05, 19.03.08, 19.03.11 and master, on windows server 1903, windows server 2004 and windows 10 2004, using
mcr.microsoft.com/windows:1903
,mcr.microsoft.com/windows:2004
andmcr.microsoft.com/windows/servercore:2004
base images - I could not install cygwin anywhere anymore.Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Physical machines and Proxmox VMs, Windows 10 and Windows Server (SAC)
The text was updated successfully, but these errors were encountered: