core icon indicating copy to clipboard operation
core copied to clipboard

hcsshim::PrepareLayer - failed failed in win32 : Incorrect function. (0x1)

Open jeanhibbert opened this issue 5 years ago • 20 comments

Problem encountered on https://dotnet.microsoft.com/learn/aspnet/microservice-tutorial/docker-image Operating System: windows

Provide details about the problem you are experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

jeanhibbert avatar Nov 13 '19 14:11 jeanhibbert

I have windows 10 enterprise 1903 and I get the error in the title when I attempt to build a docker image. Any help would be appreciated.

jeanhibbert avatar Nov 13 '19 14:11 jeanhibbert

This is still an open issue with Win10 1903, https://github.com/docker/for-win/issues/3884. Looks like uninstalling cloud storage providers with file system filters like Dropbox, Box, etc. as a workaround is an option for some users.

lairdnet avatar Nov 18 '19 11:11 lairdnet

@jeanhibbert did the workaround provided by @lairdnet solve your problem?

carlossanlop avatar Nov 19 '19 23:11 carlossanlop

This is still an open issue with Win10 1903, docker/for-win#3884. Looks like uninstalling cloud storage providers with file system filters like Dropbox, Box, etc. as a workaround is an option for some users.

deinstall cloud storage providers or virus scanners; if you identify which one is not working please share in https://github.com/docker/for-win/issues/3884 @carlossanlop yes; after deinstall, all works fine

bplasmeijer avatar Nov 20 '19 09:11 bplasmeijer

@jeanhibbert didn't get a response from you, but @bplasmeijer confirmed the proposed workaround helped. Closing this issue.

carlossanlop avatar Nov 25 '19 20:11 carlossanlop

This problem is still present today (1/6/2020) - and uninstalling cloud providers / virus scanners is not a reasonable workaround for many. Is there a better fix in the sight?

adriatic avatar Jan 06 '20 16:01 adriatic

Thanks for the information, @adriatic. Reopening the issue. @MichaelSimons would you mind taking a look in case you have some insights on this problem? @Pilchie since this is an ASP docker tutorial, should the issue be moved to the ASP repo?

carlossanlop avatar Jan 06 '20 19:01 carlossanlop

This issue is a core docker on Windows issue, not related to the ASP.NET aspect of the tutorial, so I don't see any reason to move it to AspNetCore.

Pilchie avatar Jan 06 '20 19:01 Pilchie

+1 to @Pilchie's response. This is an issue for the Windows container team.

MichaelSimons avatar Jan 06 '20 19:01 MichaelSimons

Windows just did an update and laid down a new copy of this driver.

  1. Rename the C:\Windows\System32\drivers\cbfs6.sys as something else (or delete it).
  2. Remove the container.
  3. Reboot.

See: https://github.com/docker/for-win/issues/3884#issuecomment-533952921

DDieterich avatar Jan 06 '20 20:01 DDieterich

For me, it was actually C:\Windows\System32\drivers\cbfs4.sys

  • I renamed it
  • Did docker system prune -a (be careful with that)
  • Restarted

kariem2k avatar Jan 29 '20 15:01 kariem2k

And that was my welcome error with Docker :/ I can't even tell if it is a issue with my solution or it's coming from docker - windows.

Severity Code Description Project File Line Suppression State Error CTC1014 Docker command failed with exit code 1. hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1)

orassr avatar Apr 10 '20 03:04 orassr

@shirhatti can you help with this?

mairaw avatar Apr 12 '20 02:04 mairaw

Getting the error. Sending build context to Docker daemon 3.248GB Step 1/16 : FROM mcr.microsoft.com/windows/servercore:ltsc2019 ---> fdf6432edbdc Step 2/16 : LABEL maintainer [email protected] ---> Running in 278d34409243 hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1)

I don't have dropbox or any other mentioned software here.

fltmc output

Filter Name Num Instances Altitude Frame


FsDepends 8 407000 0 mfehidk 9 321300.00 0 storqosflt 0 244000 0 wcifs 0 189900 0 CldFlt 0 180451 0 MfeEERM 0 146800 0 MfeEEFF 4 146200 0 FileCrypt 0 141100 0 luafv 1 135000 0 MfeEpeRp 1 66666 0 npsvctrig 1 46000 0 Wof 2 40700 0 FileInfo 9 40500 0

I don't have the C:\Windows\System32\drivers\cbfs4.sys driver installed on my system. Please suggest how do I fix this issue?

raj-o avatar Apr 22 '20 12:04 raj-o

Looking at the linked issues, as I understand it there are two separate issues in play. Both of these are external to dotnet and are tracked on their appropriate repos. The two issues are:

  1. Specifying --storage-opts via docker run or in the daemon.json causes docker builds to fail on Windows 10 version 1903 and newer
  2. Using a callback-based filter file system driver causes docker builds to fail on Windows 10 version 1903 or newer. The linked issues have identified certain software that bring incompatible drivers with workarounds and it may be worth perusing the linked issues for workarounds

For the purposes of this tutorial that @jeanhibbert originally asked about, I'm going to recommend using linux containers with Docker for Windows until a fix is readily available.

shirhatti avatar Apr 23 '20 15:04 shirhatti

Any updates on this topic? This issue still exists.

anatolii-bohdanov avatar Apr 22 '21 11:04 anatolii-bohdanov

Also asking for an update. Is there a general workaround?

jborut avatar Apr 22 '21 14:04 jborut

Why Microsoft put this as a get-started sample in their Docker site? Kind of humiliating themselves. Never saw anyone provided getting-started but it doesn't work

hybroadcom avatar May 06 '21 23:05 hybroadcom

Same happened to me. Had Box installed. After uninstall and machine restart, it started working.

nuno-barreiro avatar Jul 28 '21 09:07 nuno-barreiro

@shirhatti do we need to make updates to the tutorial or add a note about this?

mairaw avatar Aug 05 '21 22:08 mairaw