You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The hcsshim on Windows 10 1903 always fails to build Docker image #624
This issue is always reproducible on Windows 10 1903, and on previous version of Windows 10 it doesn't happen. I have tested on other machines that have WIndows 10 1803 and Windows 10 1809, and using the same Docker for Windows Desktop (2.0.0.3), the image build is always finished/done successfully.
got the same issue on win10 release 1903 when trying to copy content from a container to the file system: docker cp [containerName]:[containerPath] [hostFilesystem]
resulting in Error response from daemon: hcsshim::PrepareLayer failed in Win32: Incorrect function. (0x1) path=C:\ProgramData\Docker\windowsfilter\6a7019f5530c15951e6a7441dba27ed40a87c560b4ab5befe324aa26956c498d
Guys, please reply/response soon.
Is this repo actively monitored for issues too? Is it only active for code changes (commits) only?
Because I have seen active commits, but on issues are not having responses at all.
Please confirm, as this issue is now aged more than 3 weeks.... 😞
As for me, I think I'm going to rollback my Windows to be 1809 and I won't update to 1903 to build any docker container on Windows 10 1903 until this issue is solved, and this is quite a showstopper for me and my teams, including other folks that have experienced this issue too.
After debugging for a few hours I stumbled upon a call to AttachVirtualDisk which is used to mount the images.
Some undocumented flags were passed to the function during one of the calls and I found out that removing the undocumented flags resolves the issue for some reason.
I have created a simple program to patch the running dockerd daemon in memory and remove the undocumented flags.
It has been tested on 10.0.18362.175, however, I cannot guarantee that it would work on other builds. USE AT YOUR OWN RISK
Reacted by Chris Yu, zerol, Nicolas Lau, ShadowNev, hongyu69 and Rio Martinez
I'm using the default storage location, and not using storage-opts
Changing the storage location, excluding the storage location and disabling Windows defender won't solve the problem in my case.
EDIT: using storage-opts results in a slightly different error Error response from daemon: hcsshim::PrepareLayer failed in Win32: The parameter is incorrect. (0x57) when using the hack in my earlier comment. when not using the hack, the error is not changed.
After debugging for a few hours I stumbled upon a call to AttachVirtualDisk which is used to mount the images.
Some undocumented flags were passed to the function during one of the calls and I found out that removing the undocumented flags resolves the issue for some reason.
I have created a simple program to patch the running dockerd daemon in memory and remove the undocumented flags.
It has been tested on 10.0.18362.175, however, I cannot guarantee that it would work on other builds. USE AT YOUR OWN RISK
I didn't have storage-opts set at all in my daemon.json. I also tried with "storage-opts": [ "size=20479M" ] but still no luck so I guess I just have to wait for Microsoft to fix the bug.
After debugging for a few hours I stumbled upon a call to AttachVirtualDisk which is used to mount the images.
Some undocumented flags were passed to the function during one of the calls and I found out that removing the undocumented flags resolves the issue for some reason.
I have created a simple program to patch the running dockerd daemon in memory and remove the undocumented flags.
It has been tested on 10.0.18362.175, however, I cannot guarantee that it would work on other builds. USE AT YOUR OWN RISK
how to use it?
First you should compile the program. I created a c++ console application on Visual Studio 2015 but generally any c compiler that targets Win32 should work.
After that, you can use an elevated powershell to run the following command: \path\to\generated\executable.exe p (ps dockerd).id.
You can also revert the changes by running \path\to\generated\executable.exe u (ps dockerd).id.
Using the patch with storage-opt NOT working;
I did try the patch but from error code hcsshim::PrepareLayer - failed failed in Win32: The parameter is incorrect. (0x01) to hcsshim::PrepareLayer - failed failed in Win32: The parameter is incorrect. (0x57)
without the storage-opt setting, docker build works fine!
0x57 is well documented in: #708 has been patched in hcsshim with a work around already for windows 1903. The work around being merged into docker can be found in terms of progress at: moby/moby#40128 once merged in a new release will have to be made. 0x01 error has also already been patched and merged: moby/moby#39679 you will just need a binary newer than that for that fix (or wait for the backport release docker-archive/engine#314 binaries).
Uninstall all of the online drive storage that permeates as having virtual file system, such as Box, Dropbox on your machine that is used to build Docker image.
The only one online drive storage that has nothing to do with this issue is Microsoft OneDrive. (don't ask me why, I really don't know 😞 )
Apparently before I have Windows 10 1903 updates of build 18362.449, this issue still happened. It seems something from Microsoft has fixed this issue (on Windows 10 side).
I have no problem running Docker build on both Windows 10 builds of 18362,449 and 18362.476, as long as I have at least Docker Desktop 2.1.0.4 (detail in the about box above).
Feel free to tell me if my suggestion doesn't work for some or all of you.
I've just updated Windows to 18363.476 and I am now able to build Windows images without setting "storage-opts": [ "size=20G" ]
Edit... actually, no. "docker-compose build" still fails with 0x57 but "docker build ." is able to build a Windows image. So my workaround for "docker-compose build" is "docker build -t ." to build my Windows image first, then run "docker-compose build" which will successfully use docker-compose.yml to create my container.
Bart Plasmeijer (@bplasmeijer) I don't use Box or DropBox but I found that uninstalling OneDrive (which comes preinstalled with Windows 10) fixed the 0x57 error when using docker-compose.
Looks like I spoke too soon, After uninstalling OneDrive then I was able to docker-compose but after rebooting, 0x57 occurs again despite no longer having OneDrive installed.
I have always the same error with or without "storage-opts" and also when using default location.
I am nw on Docker am I need urgently to solve this issue.
Hi,
I tried following the steps above and got as far as compiling this C++ program and then it threw some check integrity error and followed Ahmed Abdelfatah (@giniyat202) instructions on x64dbg but when you get to the last step it doesn't actually say what to do with the information.
I'm on Windows 10 20H2, have run windows update and have the latest docker (4.1.1)
The error I get seems the same. I don't know what to do with this check integrity error from the C++ app so bit lost what i can do now.
Sending build context to Docker daemon 5.632kB
Step 1/2 : FROM mcr.microsoft.com/windows/nanoserver:1809
---> 1dba00abbe16
Step 2/2 : USER ContainerAdministrator
---> Running in 7da904ee3667
hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1)
thanks
*update, I have upgraded to the latest windows 10 version (21H1) and still same issue
I've just uninstalled box as per El-Gor-do suggestion and restarted and it now works
Hi,
The patch works fine for Windows 11 with a new version of vmcompute.dll.
Obviously you need to correctly find the new edx position. Be careful the check_integrity_bytes changed too.
I don't know why that doesn't work with the 376 value and that must be replace by another one but great job
Activity
eriawan commentedon Jun 17, 2019
jhowardmsft Justin (@jterry75) John Starks (@jstarks)
Is this repo active? This issue has been 6 days without any reply.
Please confirm...
jbolduan commentedon Jun 27, 2019
I'm also getting this error since upgrading my machine to 1903 when trying to build any dockerfile (that I've tried so far).
It seems to get to the first config step and then fail.
gatsby0121 commentedon Jun 27, 2019
Was anyone able to fix this? I'm getting it as well.
thaJeztah commentedon Jul 1, 2019
/cc Deep Debroy (@ddebroy)
xuelix commentedon Jul 3, 2019
Just updated my Win 10 to 1903. Seeing the same issue.
moo-ecxio commentedon Jul 4, 2019
got the same issue on win10 release 1903 when trying to copy content from a container to the file system:
docker cp [containerName]:[containerPath] [hostFilesystem]resulting in
Error response from daemon: hcsshim::PrepareLayer failed in Win32: Incorrect function. (0x1) path=C:\ProgramData\Docker\windowsfilter\6a7019f5530c15951e6a7441dba27ed40a87c560b4ab5befe324aa26956c498dDocker version 18.09.2, build 6247962eriawan commentedon Jul 4, 2019
Justin (@jterry75) jhowardmsft
Guys, please reply/response soon.
Is this repo actively monitored for issues too? Is it only active for code changes (commits) only?
Because I have seen active commits, but on issues are not having responses at all.
Please confirm, as this issue is now aged more than 3 weeks.... 😞
As for me, I think I'm going to rollback my Windows to be 1809 and I won't update to 1903 to build any docker container on Windows 10 1903 until this issue is solved, and this is quite a showstopper for me and my teams, including other folks that have experienced this issue too.
giniyat202 commentedon Jul 9, 2019
After debugging for a few hours I stumbled upon a call to AttachVirtualDisk which is used to mount the images.
Some undocumented flags were passed to the function during one of the calls and I found out that removing the undocumented flags resolves the issue for some reason.
I have created a simple program to patch the running
dockerddaemon in memory and remove the undocumented flags.It has been tested on 10.0.18362.175, however, I cannot guarantee that it would work on other builds.
USE AT YOUR OWN RISK
antonkhelou commentedon Jul 11, 2019
After upgrading to 1903, I couldn't build anything. The only thing that fixed it was removing the
storage-ops.thaJeztah commentedon Jul 11, 2019
antonkhelou that's
storage-opsin the daemon configuration? What storage-ops did you have configured?thaJeztah commentedon Jul 11, 2019
Oh, I see a comment in moby/moby#36831 (comment)
If you have a different storage location configured, could you try if things work if you disable Windows defender, or exclude the location? https://support.microsoft.com/en-us/help/4028485/windows-10-add-an-exclusion-to-windows-security
giniyat202 commentedon Jul 12, 2019
I'm using the default storage location, and not using
storage-optsChanging the storage location, excluding the storage location and disabling Windows defender won't solve the problem in my case.
EDIT: using
storage-optsresults in a slightly different errorError response from daemon: hcsshim::PrepareLayer failed in Win32: The parameter is incorrect. (0x57)when using the hack in my earlier comment. when not using the hack, the error is not changed.lowenna commentedon Jul 12, 2019
This is not an hcsshim issue. I'm closing this. See docker/for-win#3884 (comment)
lyling commentedon Aug 6, 2019
how to use it?
18 remaining items
El-Gor-do commentedon Nov 11, 2019
I didn't have storage-opts set at all in my daemon.json. I also tried with "storage-opts": [ "size=20479M" ] but still no luck so I guess I just have to wait for Microsoft to fix the bug.
bplasmeijer commentedon Nov 13, 2019
Using the patch with storage-opt NOT working;
I did try the patch but from error code hcsshim::PrepareLayer - failed failed in Win32: The parameter is incorrect. (0x01) to hcsshim::PrepareLayer - failed failed in Win32: The parameter is incorrect. (0x57)
without the storage-opt setting, docker build works fine!
(https://github.com/imphasing/dockerPatcher)
Ahmed Abdelfatah (@giniyat202) windows version 1903 (18362.418)
mitchcapper commentedon Nov 13, 2019
0x57 is well documented in: #708 has been patched in hcsshim with a work around already for windows 1903. The work around being merged into docker can be found in terms of progress at: moby/moby#40128 once merged in a new release will have to be made. 0x01 error has also already been patched and merged: moby/moby#39679 you will just need a binary newer than that for that fix (or wait for the backport release docker-archive/engine#314 binaries).
eriawan commentedon Nov 13, 2019
Hi guys!
After ensuring these steps:
storage-optsin the Docker configuration,Now I have successful Docker build!
I have this configuration:
Here's my Docker about box:
I have tried to apply the suggested patch from Ahmed Abdelfatah (@giniyat202) , but the patch didn't work for me.
NOTES:
Feel free to tell me if my suggestion doesn't work for some or all of you.
El-Gor-do commentedon Nov 14, 2019
I've just updated Windows to 18363.476 and I am now able to build Windows images without setting "storage-opts": [ "size=20G" ]
Edit... actually, no. "docker-compose build" still fails with 0x57 but "docker build ." is able to build a Windows image. So my workaround for "docker-compose build" is "docker build -t ." to build my Windows image first, then run "docker-compose build" which will successfully use docker-compose.yml to create my container.
bplasmeijer commentedon Nov 18, 2019
deleting/uninstalling online storage desktop (such as Box, DropBox) will solve the problem El-Gor-do
El-Gor-do commentedon Nov 18, 2019
Bart Plasmeijer (@bplasmeijer) I don't use Box or DropBox but I found that uninstalling OneDrive (which comes preinstalled with Windows 10) fixed the 0x57 error when using docker-compose.
El-Gor-do commentedon Nov 24, 2019
Looks like I spoke too soon, After uninstalling OneDrive then I was able to docker-compose but after rebooting, 0x57 occurs again despite no longer having OneDrive installed.
wawa0210 commentedon Nov 28, 2019
After upgrading to 1909 and the docker version is 19.03.5 and the same problem when i run image with storage-opt param,such as
Any one have the same problems?
jseixas01 commentedon Jan 5, 2020
Hello,
Always the same problem: "hcsshim::PrepareLayer - failed failed in win32 : Incorrect function. (0x1)"
Docker Engine 19.03.5
Docker Desktop 2.1.0.5
Windows 10 1903 build 18362.535
Configuration file:
{
"registry-mirrors": [],
"insecure-registries": [],
"debug": true,
"experimental": false,
],
"data-root": "E:\Docker"
}
I have always the same error with or without "storage-opts" and also when using default location.
I am nw on Docker am I need urgently to solve this issue.
Can You help me ?
Thanks.
João
DDieterich commentedon Jan 6, 2020
Windows just did an update and laid down a new copy of this driver.
See: docker/for-win#3884 (comment)
kaidokert commentedon Feb 10, 2020
Running on Windows
Version 10.0.18362, patch provided by Ahmed Abdelfatah (@giniyat202) worked perfectly. Thanks a lot ! Also thanks to I'm phasing (@imphasing) for putting in a VS solutionBhodges94 commentedon Oct 26, 2021
Hi,
I tried following the steps above and got as far as compiling this C++ program and then it threw some check integrity error and followed Ahmed Abdelfatah (@giniyat202) instructions on x64dbg but when you get to the last step it doesn't actually say what to do with the information.
I'm on Windows 10 20H2, have run windows update and have the latest docker (4.1.1)
The error I get seems the same. I don't know what to do with this check integrity error from the C++ app so bit lost what i can do now.
Sending build context to Docker daemon 5.632kB
Step 1/2 : FROM mcr.microsoft.com/windows/nanoserver:1809
---> 1dba00abbe16
Step 2/2 : USER ContainerAdministrator
---> Running in 7da904ee3667
hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1)
thanks
*update, I have upgraded to the latest windows 10 version (21H1) and still same issue
I've just uninstalled box as per El-Gor-do suggestion and restarted and it now works
xakod commentedon Nov 24, 2021
Problem still here
Is there any fix? dockerd patcher cannot work because it doesn't find vmcompute.dll.
Antonin750 commentedon Apr 15, 2022
Hi,
The patch works fine for Windows 11 with a new version of vmcompute.dll.
Obviously you need to correctly find the new edx position. Be careful the check_integrity_bytes changed too.
I don't know why that doesn't work with the 376 value and that must be replace by another one but great job