Skip to content
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

docker : hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1) #1152

Closed
MortenRa opened this issue Jul 22, 2020 · 10 comments
Assignees

Comments

@MortenRa
Copy link

MortenRa commented Jul 22, 2020

Not sure what I´m missing here, trying to build on future release:

docker : hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1)
At C:\Program Files\WindowsPowerShell\Modules\navcontainerhelper\0.7.0.17\ContainerHandling\New-NavImage.ps1:301 char:1

  • docker build --isolation=$isolation --memory $memory --tag $imageName ...
  •   + CategoryInfo          : NotSpecified: (hcsshim::Prepar...function. (0x1):String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    
    

Scripts used to create container and cause the issue

New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -imageName 'mybcimage' `
    -assignPremiumPlan `
    -licenseFile $licenseFile `
    -updateHosts `
    -alwaysPull 

**Full output of scripts**

NavContainerHelper is version 0.7.0.17
NavContainerHelper is running as administrator
Host is Microsoft Windows 10 Enterprise - 1909
Docker Client Version is 19.03.8
Docker Server Version is 19.03.8
Removing C:\ProgramData\NavContainerHelper\Extensions\bc-future
ArtifactUrl and ImageName specified
Image mybcimage:sandbox-17.0.14873.0-us doesn't exist
Building image mybcimage:sandbox-17.0.14873.0-us based on https://bcinsider.azureedge.net/sandbox/17.0.14873.0/us
Pulling latest image mcr.microsoft.com/dynamicsnav:10.0.18363.836-generic
10.0.18363.836-generic: Pulling from dynamicsnav
Generic Tag: 0.1.0.7
Container OS Version: 10.0.18363.836 (1909)
Host OS Version: 10.0.18363.836 (1909)
Copying Platform Artifacts
Copy Database
Copy Licensefile
Copy ConfigurationPackages
Copy Extensions
Copy Applications.*
c:\bcartifacts.cache\tmp637310111203645253
Sending build context to Docker daemon  1.745GB

Step 1/6 : FROM mcr.microsoft.com/dynamicsnav:10.0.18363.836-generic
 ---> a6a2db9cc5a2
Step 2/6 : ENV DatabaseServer=localhost DatabaseInstance=SQLEXPRESS DatabaseName=CRONUS IsBcSandbox=Y artifactUrl=https://bcinsider.azureedge.net/sandbox/17.0.14873.0/us?tokenremoved
 ---> Running in e757b8ab3bb8


**Additional context**
happens everytime but first time trying the new setup to create docker containers
@MortenRa MortenRa changed the title ocker : hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1) docker : hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1) Jul 22, 2020
@freddydk
Copy link
Contributor

This output:

NavContainerHelper is version 0.6.5.7
NavContainerHelper is running as administrator
Host is Microsoft Windows 10 Enterprise - 2004
Docker Client Version is 19.03.8
Docker Server Version is 19.03.8

Doesn't seem to be from your machine???

What containerhelper version are you running?
And does it work without the imagename?

Thanks

@MortenRa
Copy link
Author

MortenRa commented Jul 22, 2020

Sorry I forgot to delete the default example in the git issue(I updated the issue)

, but I´m running

NavContainerHelper is version 0.7.0.17
NavContainerHelper is running as administrator
Host is Microsoft Windows 10 Enterprise - 1909
Docker Client Version is 19.03.8
Docker Server Version is 19.03.8

and running without imagename gives me this error

DockerDo : docker.exe: Error response from daemon: hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1).
ExitCode: 125
Commandline: docker run --volume c:\bcartifacts.cache:c:\dl --label nav= --env isBcSandbox=Y --label version=17.0.14873.0 --label platform=16.0.14638.0 --label country=US --env artifactUrl=https://bcinsider.azureedge.net/sandbox/17.0.14873.0/us?tokenremoved --env licenseFile="c:\run\my\license.flf" --name bc-future --hostname bc-future --env auth=NavUserPassword --env username="
admin" --env ExitOnError=N --env locale=en-US --env databaseServer="" --env databaseInstance="" --volume "C:\ProgramData\NavContainerHelper:C:\ProgramData\NavContainerHelper" --volume "C:\ProgramData\NavContainerHelper\Extensions\bc-future\my:C:\Run\my" --i
solation process --restart unless-stopped --env enableApiServices=Y --env useSSL=N --volume "c:\windows\system32\drivers\etc:C:\driversetc" --env securePassword= --env passwordKeyFile="c:\run\my\aes.key" --env removePasswordKeyFile=Y --en
v accept_eula=Y --env accept_outdated=Y --detach mcr.microsoft.com/dynamicsnav:10.0.18363.836-generic
At C:\Program Files\WindowsPowerShell\Modules\navcontainerhelper\0.7.0.17\ContainerHandling\New-NavContainer.ps1:1494 char:19

  • ... if (!(DockerDo -accept_eula -accept_outdated:$accept_outdated - ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DockerDo

@freddydk
Copy link
Contributor

Please try to do a Reset to factory defaults of your docker desktop installation and retry.

@MortenRa
Copy link
Author

MortenRa commented Jul 22, 2020

I have reset to factory defautls but still same errors
with imagename:
docker : hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1)
At C:\Program Files\WindowsPowerShell\Modules\navcontainerhelper\0.7.0.18\ContainerHandling\New-NavImage.ps1:301 char:1

  • docker build --isolation=$isolation --memory $memory --tag $imageName ...
  •   + CategoryInfo          : NotSpecified: (hcsshim::Prepar...function. (0x1):String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    
    

Without image name:

DockerDo : docker: Error response from daemon: hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1).
ExitCode: 125
Commandline: docker run --volume c:\bcartifacts.cache:c:\dl --label nav= --env isBcSandbox=Y --label version=17.0.14873.0 --label platform=16.0.14638.0 --label country=US --env artifactUrl=https://bcinsider.azureedge.net/sandbox/17.0.14873.0/us? --env licenseFile="c:\run\my\license.flf" --name bc-future --hostname bc-future --env auth=NavUserPassword --env username="
admin" --env ExitOnError=N --env locale=en-US --env databaseServer="" --env databaseInstance="" --volume "C:\ProgramData\NavContainerHelper:C:\ProgramData\NavContainerHelper" --volume "C:\ProgramData\NavContainerHelper\Extensions\bc-future\my:C:\Run\my" --i
solation process --restart unless-stopped --env enableApiServices=Y --env useSSL=N --volume "c:\windows\system32\drivers\etc:C:\driversetc" --env securePassword== --env passwordKeyFile="c:\run\my\aes.key" --env removePasswordKeyFile=Y --en
v accept_eula=Y --env accept_outdated=Y --detach mcr.microsoft.com/dynamicsnav:10.0.18363.836-generic
At C:\Program Files\WindowsPowerShell\Modules\navcontainerhelper\0.7.0.18\ContainerHandling\New-NavContainer.ps1:1502 char:19

  • ... if (!(DockerDo -accept_eula -accept_outdated:$accept_outdated - ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DockerDo

@freddydk
Copy link
Contributor

Error 125 is always something on the host - antivirus, or uninstall/re-install - it is very hard to troubleshoot.
Have you tried -isolation hyperv

@MortenRa
Copy link
Author

Yes I also tried -isolation hyperv

okey I will try systematically to disable stuff to see if I can find the issue

@MortenRa
Copy link
Author

Okey I found the issue through another tread docker/for-win#3884
the issue was related to a driver file cbfs6.sys which is located c:\windows\system32\drivers' folder and which is part of Callback File System signed by EldoS Corporation, seems to be a driver which is shared with docker but no ideas why this driver was not uninstalled it was actually a legacy, which I checked with

C:\Windows\system32> fltmc

So after removing this file my error went away

@freddydk
Copy link
Contributor

Wow - thanks for sharing
I would never have been able to help with that.

@mloskot
Copy link

mloskot commented Mar 29, 2021

Another software that installs the cbfs*.sys driver by the EldoS Corporation seems to be the pCloud. See docker/for-win#3884 (comment)

@SBrodowski
Copy link

SBrodowski commented Jul 1, 2022

Win10 21H2 19044.1766
Docker 4.9.1

I've got the error "...failed in Win32: Incorrect function. (0x1). ExitCode: 125"

After hours of trying, here is the combination I got the positive result:

BC-Docker Image 10.0.19041.1415
BC 20.2.41144.43107

  • Defender was enabled
  • File c:\windows\system32\drivers\cbfs6.sys renamed to ".. .old"
  • "-isolation hyperv" was set

Only in combination with theese settings I've got success!!

With just set "-isolation hyperv" -> ExitCode 125.
With just set "Defender deaktivated" -> Exit Code125.
With just set "cbfs6sys" to "... .old" -> ExitCode 125.

Thanks a lot to all.

Steve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants