microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
384 stars 247 forks source link

Error response from daemon: hcsshim::CreateComputeSystem #2303

Closed ivanrlg closed 2 years ago

ivanrlg commented 2 years ago

PLEASE DO NOT INCLUDE ANY PASSWORDS OR TOKENS IN YOUR ISSUE!!!

Describe the issue I'm using Azure Devops to build the unit tests, and recently I started getting the following error without making any changes to the settings:

DockerDo : docker: Error response from daemon: hcsshim::CreateComputeSystem ce024f4ac5f37b6b6a8966dc3b1a6a4f1d9e7fb2788c2b1dadf4bc289116f88d: The virtual machine could not be started because a required feature is not installed.

Scripts used to create container and cause the issue

New-BcContainer `
    -accept_eula `
    -imagename...

Full output of scripts

2022-02-09T15:24:34.5079528Z ##[section]Starting: Run Pipeline
2022-02-09T15:24:34.5292166Z ==============================================================================
2022-02-09T15:24:34.5292554Z Task         : PowerShell
2022-02-09T15:24:34.5292842Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2022-02-09T15:24:34.5293097Z Version      : 2.198.0
2022-02-09T15:24:34.5293321Z Author       : Microsoft Corporation
2022-02-09T15:24:34.5293665Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2022-02-09T15:24:34.5294055Z ==============================================================================
2022-02-09T15:24:35.8625082Z Generating script.
2022-02-09T15:24:35.8704198Z Formatted command: . 'D:\a\1\s\scripts\DevOps-Pipeline.ps1' -environment "AzureDevOps" -version "ci" -appBuild 110 -appRevision 0
2022-02-09T15:24:35.9271433Z ========================== Starting Command Output ===========================
2022-02-09T15:24:35.9697717Z ##[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a\_temp\ca1aa26b-e10d-4bfe-b9fc-3221c98edd7e.ps1'"
2022-02-09T15:24:36.5635688Z Set artifact = ///us/Current
2022-02-09T15:24:36.5747985Z Set pipelineName = DockerforPlurE19.AppSource-ci
2022-02-09T15:24:36.5867830Z Set containerName = hostedagent-dockerforplure19appsource-ci
2022-02-09T15:24:36.6167716Z Set installApps = ''
2022-02-09T15:24:36.6256043Z Set previousApps = 'https://www.dropbox.com/s/tta58byt1at9inj/Plur-e.com_Plur-e%20For%20Microsoft%20Dynamics%20365%20Business%20Central_1.0.0.0.app?dl=1'
2022-02-09T15:24:36.6325518Z Set appSourceCopMandatoryAffixes = 'PLU'
2022-02-09T15:24:36.6345261Z Set appSourceCopSupportedCountries = 'us,dk,gb'
2022-02-09T15:24:36.6425115Z Set appFolders = 'app'
2022-02-09T15:24:36.6444272Z Set testFolders = 'test'
2022-02-09T15:24:36.6499429Z Set memoryLimit = '6G'
2022-02-09T15:24:36.6539734Z Set additionalCountries = ''
2022-02-09T15:24:36.6565718Z Set genericImageName = ''
2022-02-09T15:24:36.6629941Z Set vaultNameForLocal = 'BuildVariablesTDD'
2022-02-09T15:24:36.6716840Z Set bcContainerHelperVersion = 'dev'
2022-02-09T15:24:36.6782075Z Set installTestRunner = True
2022-02-09T15:24:36.6846328Z Set installTestFramework = True
2022-02-09T15:24:36.6883203Z Set installTestLibraries = True
2022-02-09T15:24:36.6936800Z Set installPerformanceToolkit = False
2022-02-09T15:24:36.6970917Z Set enableCodeCop = False
2022-02-09T15:24:36.7079395Z Set enableAppSourceCop = True
2022-02-09T15:24:36.7115487Z Set enablePerTenantExtensionCop = False
2022-02-09T15:24:36.7292887Z Set enableUICop = True
2022-02-09T15:24:36.7315275Z Set useDefaultAppSourceRuleSet = False
2022-02-09T15:24:36.7382204Z Set doNotSignApps = True
2022-02-09T15:24:36.7446816Z Set doNotRunTests = False
2022-02-09T15:24:36.7475088Z Set cacheImage = True
2022-02-09T15:24:36.7530439Z Set CreateRuntimePackages = True
2022-02-09T15:24:36.8325472Z Downloading https://github.com/microsoft/navcontainerhelper/archive/dev.zip
2022-02-09T15:25:05.4572782Z BcContainerHelper version 3.0.2-dev
2022-02-09T15:25:05.4693150Z BcContainerHelper emits usage statistics telemetry to Microsoft
2022-02-09T15:25:11.2838868Z Determining artifacts to use
2022-02-09T15:25:23.7079822Z   _____                               _                
2022-02-09T15:25:23.7101142Z  |  __ \                             | |               
2022-02-09T15:25:23.7119814Z  | |__) |_ _ _ __ __ _ _ __ ___   ___| |_ ___ _ __ ___ 
2022-02-09T15:25:23.7133545Z  |  ___/ _` | '__/ _` | '_ ` _ \ / _ \ __/ _ \ '__/ __|
2022-02-09T15:25:23.7144333Z  | |  | (_| | | | (_| | | | | | |  __/ |_  __/ |  \__ \
2022-02-09T15:25:23.7158883Z  |_|   \__,_|_|  \__,_|_| |_| |_|\___|\__\___|_|  |___/
2022-02-09T15:25:23.7163500Z 
2022-02-09T15:25:23.7185642Z Pipeline name               DockerforPlurE19.AppSource-ci
2022-02-09T15:25:23.7195985Z Container name              hostedagent-dockerforplure19appsource-ci
2022-02-09T15:25:23.7207184Z Image name                  
2022-02-09T15:25:23.7222265Z ArtifactUrl                 https://bcartifacts.azureedge.net/sandbox/19.3.34541.35905/us
2022-02-09T15:25:23.7238507Z SasToken                    Not Specified
2022-02-09T15:25:23.7248218Z BcAuthContext               Not Specified
2022-02-09T15:25:23.7256845Z Environment                 
2022-02-09T15:25:23.7282216Z ReUseContainer              False
2022-02-09T15:25:23.7314193Z KeepContainer               False
2022-02-09T15:25:23.7343005Z Auth                        UserPassword
2022-02-09T15:25:23.7746273Z Credential                  admin/Wepy8351
2022-02-09T15:25:23.8340505Z CompanyName                 
2022-02-09T15:25:23.8367123Z MemoryLimit                 6G
2022-02-09T15:25:23.8398252Z Enable Task Scheduler       False
2022-02-09T15:25:23.8430005Z Assign Premium Plan         False
2022-02-09T15:25:23.8490592Z Install Test Runner         True
2022-02-09T15:25:23.8526835Z Install Test Framework      True
2022-02-09T15:25:23.8554528Z Install Test Libraries      True
2022-02-09T15:25:23.8584763Z Install Perf. Toolkit       False
2022-02-09T15:25:23.8616255Z CopySymbolsFromContainer    False
2022-02-09T15:25:23.8647728Z enableCodeCop               False
2022-02-09T15:25:23.8680730Z enableAppSourceCop          True
2022-02-09T15:25:23.8719645Z enableUICop                 True
2022-02-09T15:25:23.8747920Z enablePerTenantExtensionCop False
2022-02-09T15:25:23.8820988Z doNotPerformUpgrade         False
2022-02-09T15:25:23.8879702Z uninstallRemovedApps        False
2022-02-09T15:25:23.8912404Z escapeFromCops              False
2022-02-09T15:25:23.8943734Z doNotBuildTests             False
2022-02-09T15:25:23.8974271Z doNotRunTests               False
2022-02-09T15:25:23.9004308Z doNotRunBcptTests           False
2022-02-09T15:25:23.9088296Z useDefaultAppSourceRuleSet  False
2022-02-09T15:25:23.9110181Z rulesetFile                 
2022-02-09T15:25:23.9143078Z azureDevOps                 True
2022-02-09T15:25:23.9175062Z gitLab                      False
2022-02-09T15:25:23.9203206Z gitHubActions               False
2022-02-09T15:25:23.9234637Z License file                Specified
2022-02-09T15:25:23.9270512Z CodeSignCertPfxFile         Not specified
2022-02-09T15:25:23.9307700Z CodeSignCertPfxPassword     Not specified
2022-02-09T15:25:23.9407507Z CodeSignCertIsSelfSigned    False
2022-02-09T15:25:23.9430903Z KeyVaultCertPfxFile         Not specified
2022-02-09T15:25:23.9449139Z KeyVaultCertPfxPassword     Not specified
2022-02-09T15:25:23.9478389Z KeyVaultClientId            
2022-02-09T15:25:23.9514300Z TestResultsFile             D:\a\1\s\TestResults.xml
2022-02-09T15:25:23.9548443Z BcptTestResultsFile         D:\a\1\s\bcptTestResults.json
2022-02-09T15:25:23.9634478Z TestResultsFormat           JUnit
2022-02-09T15:25:23.9651664Z AdditionalCountries         
2022-02-09T15:25:23.9708051Z PackagesFolder              D:\a\1\s\.packages
2022-02-09T15:25:23.9765157Z OutputFolder                D:\a\1\s\.output
2022-02-09T15:25:23.9797485Z BuildArtifactFolder         D:\a\1\a
2022-02-09T15:25:23.9838190Z CreateRuntimePackages       True
2022-02-09T15:25:23.9862908Z AppVersion                  
2022-02-09T15:25:23.9897323Z AppBuild                    110
2022-02-09T15:25:23.9959522Z AppRevision                 0
2022-02-09T15:25:23.9987847Z Mandatory Affixes           PLU
2022-02-09T15:25:24.0079824Z Supported Countries         us,dk,gb
2022-02-09T15:25:24.0094089Z Install Apps
2022-02-09T15:25:24.0109145Z - None
2022-02-09T15:25:24.0124174Z Install Test Apps
2022-02-09T15:25:24.0141273Z - None
2022-02-09T15:25:24.0213581Z Previous Apps
2022-02-09T15:25:24.0238069Z - https://www.dropbox.com/s/tta58byt1at9inj/Plur-e.com_Plur-e%20For%20Microsoft%20Dynamics%20365%20Business%20Central_1.0.0.0.app?dl=1
2022-02-09T15:25:24.0253086Z Application folders
2022-02-09T15:25:24.0287869Z - D:\a\1\s\app
2022-02-09T15:25:24.0303940Z Test application folders
2022-02-09T15:25:24.0325276Z - D:\a\1\s\test
2022-02-09T15:25:24.0339419Z BCPT Test application folders
2022-02-09T15:25:24.0354597Z - None
2022-02-09T15:25:24.0370500Z Custom CodeCops
2022-02-09T15:25:24.0385929Z - None
2022-02-09T15:25:24.0478118Z 
2022-02-09T15:25:24.0494103Z   _____       _ _ _                                          _        _                            
2022-02-09T15:25:24.0508643Z  |  __ \     | | (_)                                        (_)      (_)                           
2022-02-09T15:25:24.0523207Z  | |__) |   _| | |_ _ __   __ _    __ _  ___ _ __   ___ _ __ _  ___   _ _ __ ___   __ _  __ _  ___ 
2022-02-09T15:25:24.0536919Z  |  ___/ | | | | | | '_ \ / _` |  / _` |/ _ \ '_ \ / _ \ '__| |/ __| | | '_ ` _ \ / _` |/ _` |/ _ \
2022-02-09T15:25:24.0550769Z  | |   | |_| | | | | | | | (_| | | (_| |  __/ | | |  __/ |  | | (__  | | | | | | | (_| | (_| |  __/
2022-02-09T15:25:24.0564631Z  |_|    \__,_|_|_|_|_| |_|\__, |  \__, |\___|_| |_|\___|_|  |_|\___| |_|_| |_| |_|\__,_|\__, |\___|
2022-02-09T15:25:24.0578911Z                            __/ |   __/ |                                                 __/ |     
2022-02-09T15:25:24.0593060Z                           |___/   |___/                                                 |___/      
2022-02-09T15:25:24.0598749Z 
2022-02-09T15:25:24.5910921Z Pulling mcr.microsoft.com/businesscentral:10.0.20348.524
2022-02-09T15:33:56.1294744Z 
2022-02-09T15:33:56.1582973Z Pulling generic image took 511 seconds
2022-02-09T15:33:56.1583434Z 
2022-02-09T15:33:56.1585063Z    _____                _   _                               _        _                 
2022-02-09T15:33:56.1585703Z   / ____|              | | (_)                             | |      (_)                
2022-02-09T15:33:56.1586223Z  | |     _ __ ___  __ _| |_ _ _ __   __ _    ___ ___  _ __ | |_ __ _ _ _ __   ___ _ __ 
2022-02-09T15:33:56.1587086Z  | |    | '__/ _ \/ _` | __| | '_ \ / _` |  / __/ _ \| '_ \| __/ _` | | '_ \ / _ \ '__|
2022-02-09T15:33:56.1601198Z  | |____| | |  __/ (_| | |_| | | | | (_| | | (__ (_) | | | | |_ (_| | | | | |  __/ |   
2022-02-09T15:33:56.1601814Z   \_____|_|  \___|\__,_|\__|_|_| |_|\__, |  \___\___/|_| |_|\__\__,_|_|_| |_|\___|_|   
2022-02-09T15:33:56.1602207Z                                      __/ |                                             
2022-02-09T15:33:56.1602536Z                                     |___/                                              
2022-02-09T15:33:56.1602669Z 
2022-02-09T15:33:58.8671548Z WARNING: Container name should not exceed 15 characters
2022-02-09T15:33:59.6384842Z BcContainerHelper is version 3.0.2-dev
2022-02-09T15:33:59.6400760Z BcContainerHelper is running as administrator
2022-02-09T15:33:59.6441890Z Host is Microsoft Windows Server 2022 Datacenter - ltsc2022
2022-02-09T15:33:59.8862371Z Docker Client Version is 20.10.7
2022-02-09T15:33:59.9142219Z Docker Server Version is 20.10.7
2022-02-09T15:34:00.9030764Z Downloading application artifact /sandbox/19.3.34541.35905/us
2022-02-09T15:34:00.9349433Z Downloading C:\Users\VssAdministrator\AppData\Local\Temp\b22f3fc6-3b78-41e1-ae1c-8b640b27054a.zip
2022-02-09T15:34:12.8333042Z Unpacking application artifact to tmp folder using 7zip
2022-02-09T15:34:22.1401979Z Downloading platform artifact /sandbox/19.3.34541.35905/platform
2022-02-09T15:34:22.1478597Z Downloading C:\Users\VssAdministrator\AppData\Local\Temp\913acd4c-8ea3-48f4-8f38-3c23ebec60b1.zip
2022-02-09T15:34:34.0490427Z Unpacking platform artifact to tmp folder using 7zip
2022-02-09T15:35:02.8076949Z Downloading Prerequisite Components
2022-02-09T15:35:02.8364389Z Downloading c:\bcartifacts.cache\sandbox\19.3.34541.35905\platform\Prerequisite Components\Open XML SDK 2.5 for Microsoft Office\OpenXMLSDKv25.msi
2022-02-09T15:35:04.2279780Z Downloading c:\bcartifacts.cache\sandbox\19.3.34541.35905\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi
2022-02-09T15:35:05.8024010Z Downloading c:\bcartifacts.cache\sandbox\19.3.34541.35905\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe
2022-02-09T15:35:09.8423661Z Fetching all docker images
2022-02-09T15:35:11.2478030Z Fetching all docker volumes
2022-02-09T15:35:11.6927743Z Using image mcr.microsoft.com/businesscentral:10.0.20348.524
2022-02-09T15:35:12.5452302Z Creating Container hostedagent-dockerforplure19appsource-ci
2022-02-09T15:35:12.5455055Z Style: sandbox
2022-02-09T15:35:12.5466852Z Multitenant: Yes
2022-02-09T15:35:12.5542073Z Version: 19.3.34541.35905
2022-02-09T15:35:12.5574456Z Platform: 19.0.34506.35781
2022-02-09T15:35:12.5581608Z Generic Tag: 1.0.2.1
2022-02-09T15:35:12.5715779Z Container OS Version: 10.0.20348.524 (ltsc2022)
2022-02-09T15:35:12.5786129Z Host OS Version: 10.0.20348.473 (ltsc2022)
2022-02-09T15:35:12.6002139Z Using hyperv isolation
2022-02-09T15:35:12.6124314Z Using locale en-US
2022-02-09T15:35:12.6206879Z Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
2022-02-09T15:35:12.7452259Z Downloading C:\ProgramData\BcContainerHelper\Extensions\hostedagent-dockerforplure19appsource-ci\Microsoft.VisualStudio.Services.VSIXPackage.vsix
2022-02-09T15:35:13.4587423Z Using license file https://www.dropbox.com/s/zu6mqk521jt6ihb/4845731.flf
2022-02-09T15:35:13.4639019Z Downloading C:\ProgramData\BcContainerHelper\Extensions\hostedagent-dockerforplure19appsource-ci\my\license.flf
2022-02-09T15:35:14.2781593Z Additional Parameters:
2022-02-09T15:35:14.2803641Z --volume "D:\a\1\s:c:\sources"
2022-02-09T15:35:14.2855454Z --env customNavSettings=EnableTaskScheduler=False
2022-02-09T15:35:14.2874452Z Files in C:\ProgramData\BcContainerHelper\Extensions\hostedagent-dockerforplure19appsource-ci\my:
2022-02-09T15:35:14.3254424Z - AdditionalOutput.ps1
2022-02-09T15:35:14.3273227Z - license.flf
2022-02-09T15:35:14.3292622Z - MainLoop.ps1
2022-02-09T15:35:14.3306366Z - SetupVariables.ps1
2022-02-09T15:35:14.3328249Z - updatehosts.ps1
2022-02-09T15:35:14.3343743Z Creating container hostedagent-dockerforplure19appsource-ci from image mcr.microsoft.com/businesscentral:10.0.20348.524
2022-02-09T15:35:15.4199232Z ce024f4ac5f37b6b6a8966dc3b1a6a4f1d9e7fb2788c2b1dadf4bc289116f88d
2022-02-09T15:35:18.0760126Z New-BcContainer Telemetry Correlation Id: 9cd220d1-02ec-4f4c-90ea-8983fe871ac6
2022-02-09T15:35:19.0038151Z Removing hostedagent-dockerforplure19appsource-ci from container hosts file
2022-02-09T15:35:19.1663920Z Removing hostedagent-dockerforplure19appsource-ci-* from container hosts file
2022-02-09T15:35:19.2170969Z Removing C:\ProgramData\BcContainerHelper\Extensions\hostedagent-dockerforplure19appsource-ci
2022-02-09T15:35:19.8192065Z Run-AlPipeline Telemetry Correlation Id: 254e7b2c-2caf-4009-aa5b-53d38b77d63b
2022-02-09T15:35:21.5063894Z ##[error]DockerDo : docker: Error response from daemon: hcsshim::CreateComputeSystem 
ce024f4ac5f37b6b6a8966dc3b1a6a4f1d9e7fb2788c2b1dadf4bc289116f88d: The virtual machine could not be started because a 
required feature is not installed.
ExitCode: 125
Commandline: docker run --volume "c:\bcartifacts.cache:c:\dl" --label nav= --env isBcSandbox=Y --label 
version=19.3.34541.35905 --label platform=19.0.34506.35781 --label country=US --env 
artifactUrl=https://bcartifacts.azureedge.net/sandbox/19.3.34541.35905/us --env multitenant=Y --env 
licenseFile="c:\run\my\license.flf" --name hostedagent-dockerforplure19appsource-ci --hostname 
hostedagent-dockerforplure19appsource-ci --env auth=NavUserPassword --env username="admin" --env ExitOnError=N --env 
locale=en-US --env databaseServer="" --env databaseInstance="" --volume 
"C:\ProgramData\BcContainerHelper:C:\ProgramData\BcContainerHelper" --volume 
"C:\ProgramData\BcContainerHelper\Extensions\hostedagent-dockerforplure19appsource-ci\my:C:\Run\my" --isolation hyperv 
--restart unless-stopped --env filesOnly=False --memory 6G --env enableApiServices=Y --env useSSL=N --volume 
"c:\windows\system32\drivers\etc:C:\driversetc" --env securePassword=76492d1116743f0423413b16050a5345MgB8AEoAWQB3AGQALw
B6ADUAawBsAGsAbgBaAGcASQBCAG4ASQBkAFMAagA2AFEAPQA9AHwANQBjADgANgBjADAAYgBmADgANAAzAGMAOABlADEAMgBmADAAMQBiAGEAZABkAGYAZ
QA3ADAANwBjAGEAZABiADAAMgA4ADUAYgBhAGEAMgA4ADgAMQBlADQAYwAxADIAOABhADQANABjADYAZgBiADAANQBkAGEANAA4ADYAZAA= --env 
passwordKeyFile="c:\run\my\aes.key" --env removePasswordKeyFile=Y --volume "D:\a\1\s:c:\sources" --env 
customNavSettings=EnableTaskScheduler=False --env accept_eula=Y --env accept_outdated=Y --detach 
mcr.microsoft.com/businesscentral:10.0.20348.524
At C:\Users\VssAdministrator\AppData\Local\Temp\8cf9c45c-87ea-4977-a972-3240c449c2e4\ContainerHandling\New-NavContainer
.ps1:1828 char:15
+ ...       if (!(DockerDo -accept_eula -accept_outdated:$accept_outdated - ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DockerDo
2022-02-09T15:35:21.5712643Z ##[error]PowerShell exited with code '1'.
2022-02-09T15:35:22.3449298Z ##[section]Finishing: Run Pipeline

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
...

Screenshots If applicable, add screenshots to help explain your problem.

Additional context

freddydk commented 2 years ago

what is 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

On the output I can see that you are running BcContainerHelper - do you also have NavContainerHelper installed? In that case you should uninstall that. I don't think that is the problem here though.

The problem is that the Get-BestGenericImageName returns an image which is newer than your host version and because of that, New-BcContainer uses HyperV isolation, which isn't installed on the machine.

I will fix this by never returning a generic image which is newer than the host OS. A new BcContainerHelper pre-release should be ready later today and you can test that.

You can also fix the issue by installing hyperv on the host machine.

ivanrlg commented 2 years ago

Hello Freddy, sorry I forgot to remove this from your template

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

Actually this is configured to run to "Azure Devops" via the commit trigger and your CI.yml, I wouldn't know how to see the above information.

freddydk commented 2 years ago

Then I would expect it to start working again when the next build of ContainerHelper is out.

freddydk commented 2 years ago

fixed in 3.0.4