-
Notifications
You must be signed in to change notification settings - Fork 259
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 in Win32: The system cannot find the path specified. (0x3) on Docker Desktop for Windows Community edition 2.3.0.3(45519) #835
Comments
I'd read the similar issues:
But they didn't help us. Our situation is freshly installed and docker-ci-zap execution didn't help.... |
I am experiencing exactly the same issue as @cosmo0920 when trying to create a docker container that uses |
This issue also happens on edge channel.
(added) This issue also happens on Windows 10 Pro 2004 with Docker Desktop for Windows Community edition 2.3.0.3(45519). |
I'm experiencing this exact issue on a Windows Server 2019 (10.0.17763) instance running Docker 19.03.5, too. |
I am also seeing this issue
and the contents of the choco.ps1 is
|
I am experiencing 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 In my case, installing 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. |
The same as @kempniu Re-install the Docker and re-pull the base image can not solve this problem. |
Not sure if this related in some way or not but I have the issue on windows server 2019 with |
I had this problem and solved it with the following steps: |
Same problem for me.
|
@kempniu @farzonl @schribl I run into same problem trying build an image with Cygwin. It seems that it is hardlinks which Cygwin uses a lot are not handled correctly by Docker. After I got rid of the hardlinks in Cygwin installation I was able to commit the image without problems. To get rid of the hardlinks I have zipped and unzipped Cygwin folder. |
I am encountering the same issue. I am using the |
For the Cygwin folks, my workaround looks like this:
This forces Cygwin to use legacy (.lnk) based links, then recursively goes through Cygwin's directory tree & recreates every symlink (some of which are NTFS junction points), such that there are no junction points on disk when docker tries to commit the RUN step's changes. It works for me locally. Sadly, I'm getting the same hcsshim error trying to install MSVC build tools on Server Core (but NOT on regular server) images. I checked, and there are no stray junction points created. |
with regards cygwin - exatcly my findings. My approch was before sending cygwin to docker - install it on host, and zip instalation folder (to avoid hardlinks), send zip to docker context and unzip in the container.
this dockerfile works for me to install build tools on server core
|
I've built a cygwin image successfully with the above script in combination with, before installing cygwin, setting the |
I am having exact same issue on Windows Server 20H2. None of the proposed workarounds work for me. This happens when trying to commit a fairly large layer (compile qt with vcpkg) at build time. I've also changed the default container size to 500GB.
|
I've encountered this issue a number of times recently, like others installing VS Buildtools or any other large program seems to cause it. I was doing a lot of builds, that where failing as I was getting the Dockerfile right and also ctrl+c to kill. This resulted in a number of images (and sometimes containers) labelled NONE (hanging). As per Stack Exchange comments, pruning the containers and images so only my base Windows image remained allowed me to re try and build successfully. I did have the issue a couple times at the end of script creating and I would go back a couple commands in the Dockerfile, add a RUN echo hi to force new cache layers etc, stop at the issue (buildtools) go and remove the RUN echo hi and let it run again. This seem to work too (but I also had far less hanging images from pruning), so at least in my case, I would be suspicious that the cache and/or layers are corrupt or something since clean builds after pruning or forcing some layers to be rebuilt fixed the issue. FYI I also changed storage-opts to 120GB and ran the build with -m 4GB, but the issue still occurred. |
For me, I had two commands
I changed it to
It's stupid, doesn't make sense, and I have no idea why it happens. All I can say is, it doesn't happen when I copy all the build-context files at once. |
I solved this problem by allocating a 64 GB disk for my VMware Workstation Pro and initializing it as drive F:. In the DockerEngine settings, I provided Docker with a place to do its work with the data-root entry. |
I got to a point where I had an image that kept dying at build time after a few steps even though I had just about enough free space as the last final image size from the previous build, but it seems a lot of extra space is necessary while building and while running. Neither hcsshim nor Docker Desktop for Windows gave any comprehensive errors that space was an issue. 🤷♂️ As pointed above, I too solved this error by pointing |
I've encountered this with Engine 20.10.9 on Windows Server 2019 while building Boost libraries with VS Build Tools and Windows PowerShell. The data root is set to a directory on a secondary drive that's dedicated to Docker and has plenty of free space. Increasing the storage-opts, pruning or a complete reinstall (including removal of files under Program Files, ProgramData and the data root) didn't help. Both the dockerd process and data root are excluded from Defender scans. What helped, was adding a wait at the end of the RUN script:
Why does that work, I have no idea. There shouldn't be anything interfering with the filesystem. Paradoxically the VS Build Tools and Chocolatey + CMake installation in one of the previous steps is not a problem. |
@maranov: Facing exeactly the same problem. Did you solve this differently??? |
Docker ran out of disk space in the working directory. I allocated a new disk and set the data-root to the new space. Resolved.
Sent from MailDroid
…-----Original Message-----
From: "Gabriel Nützi" ***@***.***>
To: microsoft/hcsshim ***@***.***>
Cc: Mark Edwards ***@***.***>, Comment ***@***.***>
Sent: Wed, 12 Apr 2023 3:20
Subject: Re: [microsoft/hcsshim] hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) on Docker Desktop for Windows Community edition 2.3.0.3(45519) (#835)
@maranov: Facing exeactly the same problem. Did you solve this differently???
--
Reply to this email directly or view it on GitHub:
#835 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
Run in CMD/PS as admin docker build -t test:v1 . -m 4GB with below configs { base image is during intermediate run I think the size crosses 20GB Gets below error - re-exec error: exit status 1: output: hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) Very annoying is there a fix for this? |
A bigger data-root will probably fix it.
Sent from MailDroid
Mark C. Edwards
779 Monika Ct
Chubbuck, ID 83202
…-----Original Message-----
From: mpashaasu ***@***.***>
To: microsoft/hcsshim ***@***.***>
Cc: Mark Edwards ***@***.***>, Comment ***@***.***>
Sent: Thu, 21 Dec 2023 17:34
Subject: Re: [microsoft/hcsshim] hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) on Docker Desktop for Windows Community edition 2.3.0.3(45519) (#835)
Run in CMD/PS as admin
docker build -t test:v1 . -m 4GB
with below configs
{
"experimental": false,
"storage-opts": [
"size=150GB"
],
"data-root": "C:\\docker-root"
}
base image is
mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022
during intermediate run I think the size crosses 20GB
Gets below error -
re-exec error: exit status 1: output: hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3)
Very annoying is there a fix for this?
--
Reply to this email directly or view it on GitHub:
#835 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
data-root has around 450GB of space on the disk |
"C:\\docker-root"
Add a backslash in the JSON value
Sent from MailDroid
Mark C. Edwards
779 Monika Ct
Chubbuck, ID 83202
…-----Original Message-----
From: mpashaasu ***@***.***>
To: microsoft/hcsshim ***@***.***>
Cc: Mark Edwards ***@***.***>, Comment ***@***.***>
Sent: Thu, 21 Dec 2023 17:34
Subject: Re: [microsoft/hcsshim] hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) on Docker Desktop for Windows Community edition 2.3.0.3(45519) (#835)
Run in CMD/PS as admin
docker build -t test:v1 . -m 4GB
with below configs
{
"experimental": false,
"storage-opts": [
"size=150GB"
],
"data-root": "C:\\docker-root"
}
base image is
mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022
during intermediate run I think the size crosses 20GB
Gets below error -
re-exec error: exit status 1: output: hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3)
Very annoying is there a fix for this?
--
Reply to this email directly or view it on GitHub:
#835 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
\\ is already present in my config, the parser will anyway warn you in the docker desktop UI. |
Does |
I'm having a similar issue with the PrepareLayer but it all started with the msg box, "Docker Service is not running". Using the data-root parameter, I pointed my config.json to a drive with space however, the file not found seems to be "c:\bcartifacts.cache:c:\dl". The system cannot find the path specified. (0x3). FORGOT TO ADD THIS: Please kindly let me know if I should post separately? More infos available if needed. win 10 pro Edit: gave it a proper issue of its own: |
I had the same issue, for me it was due to memory/cpu usage ( I was running an virtual machine as well). When I drop the vm, it builded good. |
We're still randomly facing this issue when building images based servercore:ltsc2022 images on EC2 build agents. None of the workarounds listed in this thread seem to have helped. What we tried:
This error does pop up randomly (about 30% of times) and we really can't figure out what's causing it. |
https://github.com/adamrehn/ue4-docker/actions/runs/11844564082/job/33008088032#step:5:656 Just got the same issue on GitHub Actions
Could this error message be improved so at least we would know what path it cannot find? |
If you're running on azure hosted agents there is a 10 GB limit per 1 job, The issue appeared even though the limit wasn't exceeded,
This ^^ (see above) seems to be doing the trick so far, Summary: |
Anyway, this error message is too cryptic and should better indicate what is the root of the problem. At least it should say what file it cannot find. |
I'm also experiencing this issue intermittently while trying to build a C++ buildtools image based on I've tried all the workarounds listed in this thread, assigning a larger data-root, increasing the storage-opts size, specifying a higher memory limit for the docker build, adding a sleep command, calling docker prune, allocating more resources to the VM, etc. Nothing seems to reliably resolve the problem, but all the abovementioned changes sometimes will appear to work, giving a false sense of having finally solved the problem.. only for the same error to occur again during the next image rebuild a few days later. From me its a definite +1 to the idea of changing the error message to be less cryptic, or at least a way to inspect a detailed log of the conditions that lead to the error. |
@skaravos It helped me and I am outraged that this is not described anywhere in the documentation |
I noticed something about it, these commands don't clean it completely
That is, in:
There are still layers that lead to the error
That is, it is impossible to reliably do the cleaning I think it would be more correct to format the disk instead of cleaning through docker.
ATTENTION, after this procedure, all data on disk E will be permanently deleted
I reproduced the error and after cleaning, everything worked |
@skaravos #835 (comment) |
Why stop on that? Let's reinstall Windows or even buy a new computer each time we want to build an image with VS Build Tools! The goal is not to find a workaround. One of them is simply switching to Linux. The goal is to get adequate error reporting and to figure out why things cannot Just Work. |
in my experience the thing the unreal images used to do and the vs2022 image you are sharing does where it tries to copy DLLs from a My recommendation is to simply skip that step, always use a regarding building vs2022 specifically I think you ought to use chocolatey to install it:
|
I know you weren't replying to me but I know that at least in my case I'm using
I don't think its safe to make that claim. That's why this issue is still open and why people are still here commenting on it. If there was actually a solution that worked 100% of the time, there wouldn't be a bunch of people posting different "workarounds". |
This solution is working for VS Build Tools: https://github.com/FirebirdSQL/firebird/blob/master/builds/docker/windows/Dockerfile |
@slonopotamus |
https://learn.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2022
That is, do not use windows/servercore:ltsc2022 mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022 - It looks preferable |
okay I guess I am saying that I have a large build farm of Windows machines using Docker and test this stuff regularly, in an automated way and in the regular desktop user way, and I have encountered all the issues in this thread and others, and my recommendation is to use the |
You're missing the point of this issue again. It's not about finding a workaround (I can just switch to Linux, or become a doctor instead of a programmer, or whatever). It's about fixing the thing. There is no indication that what people do is wrong. It's underlying machinery that fails to handle an adequate task. |
based on my investigation this error appears in five situations:
hope this helps. for anyone still monitoring this thread, the most consistent solution to these five bugs is to quit docker desktop, stop the docker windows service, docker-ci-zap your docker build root, and use the wget https://github.com/moby/docker-ci-zap/raw/refs/heads/master/docker-ci-zap.exe
Stop-Service -Name "com.docker.service"
docker-ci-zap.exe -folder 'C:\ProgramData\Docker\'
Start-Service -Name "com.docker.service" |
I am/we are encountering "
hcsshim::ImportLayer
failed in Win32: The system cannot find the path specified. (0x3)" on Windows 10 Pro 1909 with Docker Community 19.03.8:It happens during msys2 installation of the minimal reproducible Dockerfile:
This issue is also happen with using
mcr.microsoft.com/windows/servercore:1909
andmcr.microsoft.com/windows/servercore:1903
base images.We also hit this issue with this Dockerfile.
And I didn't solve this issue with using https://github.com/jhowardmsft/docker-ci-zap and delete all docker related data.
How should we avoid this issue?
The text was updated successfully, but these errors were encountered: