Service 'solution' failed to build: level=error msg="hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified

Trying to build a solution. It builds successfully but ends with an error so I am not able to run the container as it never completes. See error below. I am on windows 11 pro with version 22H2 and build 22621.521. I have been looking at the forums online but nothing has worked for me.

Any help is much appreciated.

48 Warning(s)
0 Error(s)

Time Elapsed 00:02:13.76
ERROR: Service ‘solution’ failed to build: re-exec error: exit status 1: output: time=“2022-09-26T21:14:06+01:00” level=error msg=“hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)” error=“hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)” importFolderPath=“C:\ProgramData\Docker\tmp\hcs861034347” path=“\\?\C:\ProgramData\Docker\windowsfilter\b34083dbe2042a59de9e2a70b2ca36468456a87a5063df36708e55f7b574b5c2”
unexpected EOF

Please, share what you have tried so when people recommend you solutions they don’t recommend what you tried and didn’t help.

Hi Rimelek,

I have tried followings:
Turned off anti virus real time scanning along with firewall
Tried to add the “storage-opts” property in config file
Tried docker system prune

Please note, I have built multiple images e.g. solr, sql but I am not able to compete this .net build solution. I have also managed to complete all the steps successfully with windows version 21H2. I have bought new machine and it comes with new windows build.

I am also seeing following in docker diagnostics even though I run as an administrator

time="2022-09-26T22:02:09+01:00" level=warning msg="[powershell -NoProfile -Command &{ Import-Module Hyper-V; Get-VMNetworkAdapter -VMName DockerDesktopVM | ConvertTo-Json -Depth 1 }]: Get-VMNetworkAdapter : You do not have the required permission to complete this task. Contact the administrator of the authorization policy for the computer 'XXXXXX'.\r\nAt line:1 char:27\r\n+ ... -Module Hyper-V; Get-VMNetworkAdapter -VMName DockerDesktopVM | Conve ...\r\n+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : NotSpecified: (:) [Get-VMNetworkAdapter], VirtualizationException\r\n    + FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.GetVMNetworkAdapter\r\n \r\n" type=cmd
time="2022-09-26T22:02:09+01:00" level=info msg="Executing: [powershell -NoProfile -Command &{ Import-Module Hyper-V; ((get-vm).NetworkAdapters) | ? { $_.SwitchName -eq \"DockerNAT\" } | ConvertTo-Json }]" type=cmd
time="2022-09-26T22:02:10+01:00" level=warning msg="[powershell -NoProfile -Command &{ Import-Module Hyper-V; ((get-vm).NetworkAdapters) | ? { $_.SwitchName -eq \"DockerNAT\" } | ConvertTo-Json }]: get-vm : You do not have the required permission to complete this task. Contact the administrator of the authorization policy for the computer 'XXXXXX'.\r\nAt line:1 char:29\r\n+ &{ Import-Module Hyper-V; ((get-vm).NetworkAdapters) | ? { $_.SwitchN ...\r\n+                             ~~~~~~\r\n    + CategoryInfo          : NotSpecified: (:) [Get-VM], VirtualizationException\r\n    + FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.GetVM\r\n \r\n" type=cmd
1 Like

Please, format your post properly, beacause I wanted to fix your post and the spam filter hid it (it happens too frequently), but I can’t unhid it.

It has been approved and not hidden anymore.

Thanks for the details. I didn’t understand the error in the title, but I saw something in the error log. Do you want to use Hyper-V as a backend instead of WSL2? Is it possible that Docker used the WSL2 backend on the other machine and this is the difference? I have been using WSL2 ever since the first Docker Desktop was released which supported it. Based on the error log, it looks like you are using Hyper-V.

Since docker build also runs containers for each instruction, containers should work. Maybe you run a special command which requires elevated privileges inside the container.

Do you want to run Linux or Windows containers?

While I am writing this message I start to remember that I had some hcsshim error message maybe about a year ago when I manually deleted files created by Docker or Hyper-V. Could something happen with your filesystem?.

I am using windows container.

I have just turned on WSL from windows feature may be it was using Hyper -V.

I will run it again and see if it makes any difference.

I have been deleting files from C:\ProgramData\Docker and have used Docker system prune quite a few times so it could be an issue with filesystem. For this to fix I guess I got uninstall docker and re-install? Which I might have done once previously.

Just got a different error now:

Unhandled Exception: OutOfMemoryException.

ERROR: Service ‘solution’ failed to build: The command ‘powershell -Command $ErrorActionPreference = ‘Stop’; $ProgressPreference = ‘SilentlyContinue’; msbuild .\src\Website\Website.csproj /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\website’ returned a non-zero code: 1

Confronted with same error again :frowning:

level=error msg=“hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)” error=“hcsshim::ImportLayer - failed failed in Win32: The system cannot find the path specified. (0x3)” importFolderPath=“C:\ProgramData\Docker\tmp\hcs621731051” path=“\\?\C:\ProgramData\Docker\windowsfilter\baf803dedb0ed1345262387d5dd23a235b829dfdc636808a361df3648f3dd788”

Very frustrating. I might have to restart again by un-installing the docker desktop and re-installing it

1 Like

I am facing the same issue at the moment. I also tried pruning everything, uninstalling/reinstalling Docker Desktop, changing the storage-opt options to 200GB, changing the data-root directory to an empty 256 Gb Disk, allocating more space to my Azure VM so I have 200 Gb free to build my image.

I’m using a Microsoft Windows Server Core 2019 LTCS base image and I’m downloading a great ton of stuff into my image. I wouldn’t understand why this would be a problem of free space while I have plenty of free space and that the line that is causing this error to fail the build is simply either executing a .MSI, or creating a symlink. For some reason, I can COPY/ADD other files, but some of the new RUN instructions that I’m adding to my Dockerfile makes it crash.

It is also very frustrating as I’ve been playing around this issue for almost a week.

Sorry for not responding. Since I don’t know exactly what the problem is, I don’t know if reinstalling Docker helps.

I could not find mentioning space in this topic before (maybe I missed something in my own post). Why did you think it could be a problem?

Not a solution, just an other question so maybe one of the questions give you an idea. Is the Windows machine is part of a Domain? Do you log in with a Domain user? I don’t know if it matters, I guess it shouldn’t, but the lst issue I saw on Windows (not with Docker) was because of Domain users.

I am sorry I can’t help you more, but I am not as familiar with Windows as with Linux.