microsoft / navcontainerhelper

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

Cannot run Containers with SSL using Process isolation on Windows 11 #2203

Closed GreatScott000 closed 8 months ago

GreatScott000 commented 2 years ago

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

Describe the issue Trying to create new container for 19.1 and getting this error:

Cannot find path 'C:\inetpub\wwwroot\http' because it does not exist. at , C:\Run\navstart.ps1: line 266 at , C:\Run\start.ps1: line 363 at , : line 1 Initialization of container bc19cu01 failed

Scripts used to create container and cause the issue

$containerName = 'bc19cu01'
$password = 'P@ssw0rd'
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$credential = New-Object pscredential 'admin', $securePassword
$auth = 'UserPassword'
$artifactUrl = Get-BcArtifactUrl -type 'OnPrem' -version '19.1' -country 'gb' -select 'Latest'
$licenseFile = 'd:\license\bc19license.flf'
New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -licenseFile $licenseFile `
    -dns '192.168.0.1' `
    -usessl -installCertificateOnHost `
    -updateHosts

Full output of scripts

PS C:\WINDOWS\system32> D:\ps\container-bc19.01.ps1
BcContainerHelper is version 2.0.21
BcContainerHelper is running as administrator
Host is Microsoft Windows 11 Pro - 21H2
Docker Client Version is 20.10.10
Docker Server Version is 20.10.10
Removing bc19cu01 from container hosts file
Removing bc19cu01-* from container hosts file
Removing d:\bccontainerhelper\Extensions\bc19cu01
Fetching all docker images
Fetching all docker volumes
Pulling image mcr.microsoft.com/businesscentral:10.0.20348.350
10.0.20348.350: Pulling from businesscentral
8f616e6e9eec: Pulling fs layer
a0eb404f1860: Pulling fs layer
200dad0f7c61: Pulling fs layer
0c4c6fc209a7: Pulling fs layer
79a0108afddc: Pulling fs layer
ef61ecea52b8: Pulling fs layer
c23fa5517282: Pulling fs layer
0c4c6fc209a7: Waiting
79a0108afddc: Waiting
112f333da6a4: Pulling fs layer
c23fa5517282: Waiting
ef61ecea52b8: Waiting
987c555d3fbc: Pulling fs layer
112f333da6a4: Waiting
987c555d3fbc: Waiting
4c5fb7fa01ef: Pulling fs layer
346b4a39d2ea: Pulling fs layer
4c5fb7fa01ef: Waiting
259c0ea67672: Pulling fs layer
346b4a39d2ea: Waiting
b5a1438e829d: Pulling fs layer
259c0ea67672: Waiting
9dd795e807a2: Pulling fs layer
b5a1438e829d: Waiting
c5ba0901ee63: Pulling fs layer
9dd795e807a2: Waiting
c5ba0901ee63: Waiting
200dad0f7c61: Verifying Checksum
200dad0f7c61: Download complete
0c4c6fc209a7: Verifying Checksum
0c4c6fc209a7: Download complete
79a0108afddc: Verifying Checksum
79a0108afddc: Download complete
ef61ecea52b8: Verifying Checksum
ef61ecea52b8: Download complete
c23fa5517282: Verifying Checksum
c23fa5517282: Download complete
112f333da6a4: Verifying Checksum
112f333da6a4: Download complete
987c555d3fbc: Verifying Checksum
987c555d3fbc: Download complete
4c5fb7fa01ef: Verifying Checksum
4c5fb7fa01ef: Download complete
a0eb404f1860: Verifying Checksum
a0eb404f1860: Download complete
259c0ea67672: Verifying Checksum
259c0ea67672: Download complete
b5a1438e829d: Verifying Checksum
b5a1438e829d: Download complete
9dd795e807a2: Verifying Checksum
9dd795e807a2: Download complete
c5ba0901ee63: Verifying Checksum
c5ba0901ee63: Download complete
8f616e6e9eec: Verifying Checksum
8f616e6e9eec: Download complete
8f616e6e9eec: Pull complete
346b4a39d2ea: Verifying Checksum
346b4a39d2ea: Download complete
a0eb404f1860: Pull complete
200dad0f7c61: Pull complete
0c4c6fc209a7: Pull complete
79a0108afddc: Pull complete
ef61ecea52b8: Pull complete
c23fa5517282: Pull complete
112f333da6a4: Pull complete
987c555d3fbc: Pull complete
4c5fb7fa01ef: Pull complete
346b4a39d2ea: Pull complete
259c0ea67672: Pull complete
b5a1438e829d: Pull complete
9dd795e807a2: Pull complete
c5ba0901ee63: Pull complete
Digest: sha256:8f5bc6533c5c99a36fcb4b9a6d0104178ec4f3396beb3e1676eaa1a632600de4
Status: Downloaded newer image for mcr.microsoft.com/businesscentral:10.0.20348.350
mcr.microsoft.com/businesscentral:10.0.20348.350
Using image mcr.microsoft.com/businesscentral:10.0.20348.350
Creating Container bc19cu01
Style: onprem
Multitenant: No
Version: 19.1.31886.32186
Platform: 19.0.31889.32155
Generic Tag: 1.0.1.8
Container OS Version: 10.0.20348.350 (ltsc2022)
Host OS Version: 10.0.22000.318 (21H2)
Using process isolation
Using locale en-GB
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file d:\license\bc19license.flf
Files in d:\bccontainerhelper\Extensions\bc19cu01\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bc19cu01 from image mcr.microsoft.com/businesscentral:10.0.20348.350
137241121a75d304a1c26c72c7dff1725d2a2f59a8771b7e40100153583e83cb
Waiting for container bc19cu01 to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/19.1.31886.32186/gb
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
start...
Starting Internet Information Server
Copying Service Tier Files
c:\dl\onprem\19.1.31886.32186\platform\ServiceTier\Program Files
c:\dl\onprem\19.1.31886.32186\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\19.1.31886.32186\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\19.1.31886.32186\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\onprem\19.1.31886.32186\gb\database\Demo Database BC (19-0).bak
Changing Database Server Collation to Latin1_General_100_CI_AS
Restoring CRONUS Demo Database
Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Copying Web Client Files
c:\dl\onprem\19.1.31886.32186\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\onprem\19.1.31886.32186\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\19.1.31886.32186\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\19.1.31886.32186\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\19.1.31886.32186\platform
c:\dl\onprem\19.1.31886.32186\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\19.1.31886.32186\gb\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\19.1.31886.32186\platform\Test Assemblies
Copying Applications
C:\dl\onprem\19.1.31886.32186\gb\Applications
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 162 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting dbserver.containerhelper.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 172.27.176.1 in container hosts file
Starting Container
Hostname is bc19cu01
PublicDnsName is bc19cu01
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint BF98D6FC55F91BC0DF4272641EBB544B7655BDAE
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
WARNING: SetupWebClient failed, retrying...
Registering event sources
Creating DotNetCore Web Server Instance
Initializing...
Setting host.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting dbserver.containerhelper.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 172.27.176.1 in container hosts file
Restarting Container
PublicDnsName unchanged
Hostname is bc19cu01
PublicDnsName is bc19cu01
Using NavUserPassword Authentication
Starting Local SQL Server
Starting Internet Information Server
Starting Service Tier
Container IP Address: 172.27.179.87
Container Hostname  : bc19cu01
Container Dns Name  : bc19cu01
Web Client          : https://bc19cu01/BC/
Setting bc19cu01 to 172.27.179.87 in host hosts file

Files:
Cannot find path 'C:\inetpub\wwwroot\http' because it does not exist.
at <ScriptBlock>, C:\Run\navstart.ps1: line 266
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1Error
Using artifactUrl https://bcartifacts.azureedge.net/onprem/19.1.31886.32186/gb
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
start...
Starting Internet Information Server
Copying Service Tier Files
c:\dl\onprem\19.1.31886.32186\platform\ServiceTier\Program Files
c:\dl\onprem\19.1.31886.32186\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\19.1.31886.32186\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\19.1.31886.32186\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\onprem\19.1.31886.32186\gb\database\Demo Database BC (19-0).bak
Changing Database Server Collation to Latin1_General_100_CI_AS
Restoring CRONUS Demo Database
Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Copying Web Client Files
c:\dl\onprem\19.1.31886.32186\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\onprem\19.1.31886.32186\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\19.1.31886.32186\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\19.1.31886.32186\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\19.1.31886.32186\platform
c:\dl\onprem\19.1.31886.32186\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\19.1.31886.32186\gb\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\19.1.31886.32186\platform\Test Assemblies
Copying Applications
C:\dl\onprem\19.1.31886.32186\gb\Applications
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 162 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting dbserver.containerhelper.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 172.27.176.1 in container hosts file
Starting Container
Hostname is bc19cu01
PublicDnsName is bc19cu01
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint BF98D6FC55F91BC0DF4272641EBB544B7655BDAE
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
WARNING: SetupWebClient failed, retrying...
Registering event sources
Creating DotNetCore Web Server Instance
Initializing...
Setting host.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting dbserver.containerhelper.internal to 192.168.0.11 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 172.27.176.1 in container hosts file
Restarting Container
PublicDnsName unchanged
Hostname is bc19cu01
PublicDnsName is bc19cu01
Using NavUserPassword Authentication
Starting Local SQL Server
Starting Internet Information Server
Starting Service Tier
Container IP Address: 172.27.179.87
Container Hostname  : bc19cu01
Container Dns Name  : bc19cu01
Web Client          : https://bc19cu01/BC/
Setting bc19cu01 to 172.27.179.87 in host hosts file

Files:
Cannot find path 'C:\inetpub\wwwroot\http' because it does not exist.
at <ScriptBlock>, C:\Run\navstart.ps1: line 266
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1
Initialization of container bc19cu01 failed
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.21\ContainerHandling\Wait-NavContainerReady.ps1:42 char:17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ...bc19cu01 failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container bc19cu01 failed

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

Additional context

TrippyZ commented 2 years ago

Try adding -isolation hyperv

GreatScott000 commented 2 years ago

So how on earth does the isolation level change whether a path inside the container exists or not?

Anyway that prevented it but I WANT to use process isolation. It is better memory management and performance, from what I understand. Used to use it all the time. Since I updated my Win10 machine to 21H2 and now on my Win11 machine I am unable to use this option. What is inherently wrong here?

freddydk commented 2 years ago

This is a duplicate of #2178 - containers cannot use SSL when running process isolation on Windows 11.

freddydk commented 2 years ago

This actually isn't a duplicate of #2178
There was a bug stating that process isolation and SSL doesn't work on Windows 11 - I think that has been deleted. Anyway - currently Windows 11 cannot run containers with SSL under process isolation - Windows Team is investigating this.

ti-jalopez commented 2 years ago

Hi @freddydk , I have the same problem, but the error message is a bit different: Creating DotNetCore Web Server Instance Incorrect function. (Exception from HRESULT: 0x80070001)

SCRIPT

#Crear nuevos contenedores
#=========================
#27/01/2022 Nuevo contedor, version BC19V2SB (19.2) con SSL (https)
$containerName = 'BC19V2SB'
$myLicense = 'C:\licencia\BC.flf'
$navcredential = New-Object System.Management.Automation.PSCredential -argumentList "nav", (ConvertTo-SecureString -String "****" -AsPlainText -Force)
$myArtifactUrl = Get-BCArtifactUrl -type Sandbox -version 19.2 -country es -select Latest
$useSSL = $true

#NUEVO sistema compartir DLLS add-ins, según respuesta @fredydk a petición: 
#https://github.com/microsoft/navcontainerhelper/issues/1673#issuecomment-771475675
$additionalparamaters = @()
#$addinsFolder = "C:\BCAddIns"
if ($addinsFolder) {
  $additionalparamaters += "--volume $($addinsFolder):c:\run\add-ins" 
}

#Fuentes, por defecto añade todas las instaladas en host
$fontsFolder = @("$env:SystemRoot\fonts")

#Nuevo contendor BC - Crear según parametros
Write-Host "ArtifactURL=$myArtifactUrl"
get-date
New-BCContainer -auth NavUserPassword -Credential $navcredential -updateHosts -accept_eula -containername $containerName `
                -artifactUrl $myArtifactUrl -licenseFile $myLicense -accept_outdated `
                -useSSL:$useSSL -installCertificateOnHost:$useSSL `
                -includeAL -includeTestToolkit `
                -addFontsFromPath $fontsFolder -dns 8.8.8.8  `
                -additionalParameters $additionalparamaters -multitenant:$false
Write-Host "Fin "
get-date

ERROR

Creating DotNetCore Web Server Instance
WARNING: SetupWebClient failed, retrying...
Registering event sources
Creating DotNetCore Web Server Instance
Incorrect function. (Exception from HRESULT: 0x80070001)
at New-NavSiteWithBindings, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 674
at New-NavWebSite, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 624
at New-NAVWebServerInstance, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 501
at <ScriptBlock>, C:\Run\SetupWebClient.ps1: line 35
at <ScriptBlock>, C:\Run\navstart.ps1: line 175
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1
New-BCContainer Telemetry Correlation Id: e72525d9-f141-448b-9d86-dfdc5547c621
Initialization of container BC19V2SB failed
En C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.1\ContainerHandling\Wait-NavContainerReady.ps1: 42 Carácter: 17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ...BC19V2SB failed:String) [], RuntimeException

RESULT

ArtifactURL=https://bcartifacts.azureedge.net/sandbox/19.2.32968.35460/es

viernes, 28 de enero de 2022 8:17:42
BcContainerHelper is version 3.0.1
BcContainerHelper is running as administrator
Host is Microsoft Windows 11 Pro - 21H2
Docker Client Version is 20.10.12
Docker Server Version is 20.10.12
Removing container BC19V2SB
Removing BC19V2SB from container hosts file
Removing BC19V2SB-* from container hosts file
Removing C:\ContainerHelper\Extensions\BC19V2SB
Downloading application artifact /sandbox/19.2.32968.35460/es
Downloading C:\Users\myuser\AppData\Local\Temp\4e354046-895b-40f9-8fd6-2ad1f7f43bff.zip
Unpacking application artifact to tmp folder using Expand-Archive
Downloading platform artifact /sandbox/19.2.32968.35460/platform
Downloading C:\Users\myuser\AppData\Local\Temp\4fcabc0d-a09c-4ce1-8cf0-e2d417acf81b.zip
Unpacking platform artifact to tmp folder using Expand-Archive
Could not rename 'c:\bcartifacts.cache\sandbox\19.2.32968.35460\nh4p5cya.nlo' retrying in 5 seconds.
Retrying...
Downloading Prerequisite Components
Downloading c:\bcartifacts.cache\sandbox\19.2.32968.35460\platform\Prerequisite Components\Open XML SDK 2.5 for Microsoft Office\OpenXMLSDKv25.msi
Downloading c:\bcartifacts.cache\sandbox\19.2.32968.35460\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi
Downloading c:\bcartifacts.cache\sandbox\19.2.32968.35460\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe
Fetching all docker images
Fetching all docker volumes
Using image mcr.microsoft.com/businesscentral:10.0.20348.469
Creating Container BC19V2SB
Style: sandbox
Multitenant: No
Version: 19.2.32968.35460
Platform: 19.0.32956.35344
Generic Tag: 1.0.2.1
Container OS Version: 10.0.20348.469 (ltsc2022)
Host OS Version: 10.0.22000.469 (21H2)
Using process isolation
Using locale es-ES
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\license\BC.flf
Additional Parameters:
--volume C:\BCAddIns:c:\run\add-ins
Files in C:\ContainerHelper\Extensions\BC19V2SB\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container BC19V2SB from image mcr.microsoft.com/businesscentral:10.0.20348.469
4e348dc134bccc02bde06600355db9349c8b8332194fa51926b311edf2fce18c
Waiting for container BC19V2SB to be ready
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/19.2.32968.35460/es
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
start...
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
start...
Starting Internet Information Server
Copying Service Tier Files
c:\dl\sandbox\19.2.32968.35460\platform\ServiceTier\Program Files
c:\dl\sandbox\19.2.32968.35460\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\19.2.32968.35460\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\19.2.32968.35460\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\19.2.32968.35460\es\BusinessCentral-ES.bak
Changing Database Server Collation to Modern_Spanish_100_CS_AS
Restoring CRONUS Demo Database
Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Copying Web Client Files
c:\dl\sandbox\19.2.32968.35460\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\sandbox\19.2.32968.35460\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\sandbox\19.2.32968.35460\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\sandbox\19.2.32968.35460\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\sandbox\19.2.32968.35460\platform
c:\dl\sandbox\19.2.32968.35460\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\sandbox\19.2.32968.35460\es\ConfigurationPackages
Copying Test Assemblies
C:\dl\sandbox\19.2.32968.35460\platform\Test Assemblies
Copying Extensions
C:\dl\sandbox\19.2.32968.35460\es\Extensions
Copying Applications
C:\dl\sandbox\19.2.32968.35460\platform\Applications
Copying Applications.ES
C:\dl\sandbox\19.2.32968.35460\es\Applications.ES
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 213 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.0.24 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.0.24 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 172.19.176.1 in container hosts file
Starting Container
Hostname is BC19V2SB
PublicDnsName is BC19V2SB
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint E6BEA89161CE1BF0931B268D78D2D7DC110BB8FE
DNS identity BC19V2SB
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
WARNING: SetupWebClient failed, retrying...
Registering event sources
Creating DotNetCore Web Server Instance
Incorrect function. (Exception from HRESULT: 0x80070001)
at New-NavSiteWithBindings, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 674
at New-NavWebSite, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 624
at New-NAVWebServerInstance, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 501
at <ScriptBlock>, C:\Run\SetupWebClient.ps1: line 35
at <ScriptBlock>, C:\Run\navstart.ps1: line 175
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1Error
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/19.2.32968.35460/es
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
start...
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
start...
Starting Internet Information Server
Copying Service Tier Files
c:\dl\sandbox\19.2.32968.35460\platform\ServiceTier\Program Files
c:\dl\sandbox\19.2.32968.35460\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\19.2.32968.35460\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\19.2.32968.35460\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\19.2.32968.35460\es\BusinessCentral-ES.bak
Changing Database Server Collation to Modern_Spanish_100_CS_AS
Restoring CRONUS Demo Database
Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Copying Web Client Files
c:\dl\sandbox\19.2.32968.35460\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\sandbox\19.2.32968.35460\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\sandbox\19.2.32968.35460\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\sandbox\19.2.32968.35460\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\sandbox\19.2.32968.35460\platform
c:\dl\sandbox\19.2.32968.35460\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\sandbox\19.2.32968.35460\es\ConfigurationPackages
Copying Test Assemblies
C:\dl\sandbox\19.2.32968.35460\platform\Test Assemblies
Copying Extensions
C:\dl\sandbox\19.2.32968.35460\es\Extensions
Copying Applications
C:\dl\sandbox\19.2.32968.35460\platform\Applications
Copying Applications.ES
C:\dl\sandbox\19.2.32968.35460\es\Applications.ES
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 213 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.0.24 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.0.24 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 172.19.176.1 in container hosts file
Starting Container
Hostname is BC19V2SB
PublicDnsName is BC19V2SB
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint E6BEA89161CE1BF0931B268D78D2D7DC110BB8FE
DNS identity BC19V2SB
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
WARNING: SetupWebClient failed, retrying...
Registering event sources
Creating DotNetCore Web Server Instance
Incorrect function. (Exception from HRESULT: 0x80070001)
at New-NavSiteWithBindings, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 674
at New-NavWebSite, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 624
at New-NAVWebServerInstance, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 501
at <ScriptBlock>, C:\Run\SetupWebClient.ps1: line 35
at <ScriptBlock>, C:\Run\navstart.ps1: line 175
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1
New-BCContainer Telemetry Correlation Id: e72525d9-f141-448b-9d86-dfdc5547c621
Initialization of container BC19V2SB failed
En C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.1\ContainerHandling\Wait-NavContainerReady.ps1: 42 Carácter: 17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ...BC19V2SB failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container BC19V2SB failed
freddydk commented 2 years ago

Yeah - it is the same error. Should go away if you use Hyperv isolation. The error is in Windows 11 ContainerD feature - will ping them and ask for an update.

darrenwaller commented 2 years ago

Yeah - it is the same error. Should go away if you use Hyperv isolation. The error is in Windows 11 ContainerD feature - will ping them and ask for an update.

Hi Freddy, is there any update from the windows team on this. cheers

derroh commented 2 years ago

Hi Freddy, I'm using Hyper-V but still failing with similar error to @ti-jalopez 's.

PS C:\WINDOWS\system32> $artifactUrl = Get-BcArtifactUrl -type sandbox -country w1 -select latest
New-BcContainer -accept_eula -artifactUrl $artifactUrl -alwaysPull -assignPremiumPlan -auth UserPassword -includeAL -installCertificateOnHost -licenseFile "D:\License\BTL\BC190 April- July 2022.flf" -memoryLimit 16G -updateHosts -useCleanDatabase -useSSL
BcContainerHelper is version 2.0.22
BcContainerHelper is running as administrator
Host is Microsoft Windows 11 Pro - 21H2
Docker Client Version is 20.10.13
Docker Server Version is 20.10.13
Removing container bcserver
Removing bcserver from container hosts file
Removing bcserver-* from container hosts file
Removing C:\ProgramData\BcContainerHelper\Extensions\bcserver
Fetching all docker images
Fetching all docker volumes
Pulling image mcr.microsoft.com/businesscentral:10.0.20348.587
10.0.20348.587: Pulling from businesscentral
Digest: sha256:c9ebf4f5a6d5d817aa883790f8eaac4a463c1412fc7be73573a81d7858c2e999
Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.20348.587
mcr.microsoft.com/businesscentral:10.0.20348.587
Using image mcr.microsoft.com/businesscentral:10.0.20348.587
Creating Container bcserver
Style: sandbox
Multitenant: Yes
Version: 19.5.36567.38293
Platform: 19.0.36528.38223
Generic Tag: 1.0.2.1
Container OS Version: 10.0.20348.587 (ltsc2022)
Host OS Version: 10.0.22000.556 (21H2)
Using process isolation
Using locale en-US
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file D:\License\BTL\BC190 April- July 2022.flf
Files in C:\ProgramData\BcContainerHelper\Extensions\bcserver\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupNavUsers.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bcserver from image mcr.microsoft.com/businesscentral:10.0.20348.587
713d940e11223c212aecd3154761fd761793d926de5ac720376b811965506ac7
Waiting for container bcserver to be ready
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/19.5.36567.38293/w1
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\sandbox\19.5.36567.38293\platform\ServiceTier\Program Files
c:\dl\sandbox\19.5.36567.38293\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\19.5.36567.38293\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\19.5.36567.38293\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\19.5.36567.38293\w1\BusinessCentral-W1.bak
Restoring CRONUS Demo Database
Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Copying Web Client Files
c:\dl\sandbox\19.5.36567.38293\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\sandbox\19.5.36567.38293\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\sandbox\19.5.36567.38293\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\sandbox\19.5.36567.38293\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\sandbox\19.5.36567.38293\platform
c:\dl\sandbox\19.5.36567.38293\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\sandbox\19.5.36567.38293\platform\ConfigurationPackages
Copying Test Assemblies
C:\dl\sandbox\19.5.36567.38293\platform\Test Assemblies
Copying Extensions
C:\dl\sandbox\19.5.36567.38293\w1\Extensions
Copying Applications
C:\dl\sandbox\19.5.36567.38293\platform\Applications
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 69 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.192.132 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.192.132 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 192.168.144.1 in container hosts file
Starting Container
Hostname is bcserver
PublicDnsName is bcserver
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 8B4E6744F310AF5973A6E9E938BFACD138A5B2DA
DNS identity bcserver
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
WARNING: SetupWebClient failed, retrying...
Registering event sources
Creating DotNetCore Web Server Instance
Incorrect function. (Exception from HRESULT: 0x80070001)
at New-NavSiteWithBindings, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 674
at New-NavWebSite, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 624
at New-NAVWebServerInstance, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 501
at <ScriptBlock>, C:\Run\SetupWebClient.ps1: line 35
at <ScriptBlock>, C:\Run\navstart.ps1: line 175
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1Error
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/19.5.36567.38293/w1
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\sandbox\19.5.36567.38293\platform\ServiceTier\Program Files
c:\dl\sandbox\19.5.36567.38293\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\19.5.36567.38293\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\19.5.36567.38293\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\19.5.36567.38293\w1\BusinessCentral-W1.bak
Restoring CRONUS Demo Database
Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Copying Web Client Files
c:\dl\sandbox\19.5.36567.38293\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\sandbox\19.5.36567.38293\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\sandbox\19.5.36567.38293\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\sandbox\19.5.36567.38293\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\sandbox\19.5.36567.38293\platform
c:\dl\sandbox\19.5.36567.38293\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\sandbox\19.5.36567.38293\platform\ConfigurationPackages
Copying Test Assemblies
C:\dl\sandbox\19.5.36567.38293\platform\Test Assemblies
Copying Extensions
C:\dl\sandbox\19.5.36567.38293\w1\Extensions
Copying Applications
C:\dl\sandbox\19.5.36567.38293\platform\Applications
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 69 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.192.132 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.192.132 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 192.168.144.1 in container hosts file
Starting Container
Hostname is bcserver
PublicDnsName is bcserver
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 8B4E6744F310AF5973A6E9E938BFACD138A5B2DA
DNS identity bcserver
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
WARNING: SetupWebClient failed, retrying...
Registering event sources
Creating DotNetCore Web Server Instance
Incorrect function. (Exception from HRESULT: 0x80070001)
at New-NavSiteWithBindings, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 674
at New-NavWebSite, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 624
at New-NAVWebServerInstance, C:\Program Files\Microsoft Dynamics NAV\190\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1: line 501
at <ScriptBlock>, C:\Run\SetupWebClient.ps1: line 35
at <ScriptBlock>, C:\Run\navstart.ps1: line 175
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1
Initialization of container bcserver failed
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.22\ContainerHandling\Wait-NavContainerReady.ps1:42 char:17
+ ...             throw "Initialization of container $containerName failed" ...
+                 --------------------------------------
    + CategoryInfo          : OperationStopped: (Initialization ...bcserver failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container bcserver failed

I got rid of the -useSSL but now getting a different error

PS C:\WINDOWS\system32> $artifactUrl = Get-BcArtifactUrl -type sandbox -country w1 -select latest
New-BcContainer -accept_eula -artifactUrl $artifactUrl -alwaysPull -assignPremiumPlan -auth UserPassword -includeAL -installCertificateOnHost -licenseFile "D:\License\BTL\BC190 April- July 2022.flf" -memoryLimit 16G -updateHosts -useCleanDatabase 
BcContainerHelper is version 2.0.22
BcContainerHelper is running as administrator
Host is Microsoft Windows 11 Pro - 21H2
Docker Client Version is 20.10.13
Docker Server Version is 20.10.13
Removing container bcserver
Removing bcserver from container hosts file
Removing bcserver-* from container hosts file
Removing C:\ProgramData\BcContainerHelper\Extensions\bcserver
Fetching all docker images
Fetching all docker volumes
Pulling image mcr.microsoft.com/businesscentral:10.0.20348.587
DockerDo : Error response from daemon: Head "https://mcr.microsoft.com/v2/businesscentral/manifests/10.0.20348.587": net/http: TLS handshake timeout
ExitCode: 1
Commandline: docker pull  mcr.microsoft.com/businesscentral:10.0.20348.587
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.22\ContainerHandling\New-NavContainer.ps1:759 char:13
+             DockerDo -command pull -imageName $bestImageName | Out-Nu ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DockerDo
derroh commented 2 years ago

Update: I uninstalled Docker, and deleted C:\Program Files\Docker\Docker\ then ran afresh with Windows Defender's Virus and Threat protection turned off and it installed without issues.

andrea-lang commented 2 years ago

Hi, update for everyone: i have Windows 11 pro and by adding the -isolation HyperV the container was created with the SSL, this script worked for me. At the bottom there's the code that i've used:

$containerName = 'TEST'
$credential = Get-Credential -Message 'Using UserPassword authentication. Please enter credentials for the container.'
$auth = 'UserPassword'
$artifactUrl = Get-BcArtifactUrl -type 'OnPrem' -version '20' -country 'Your country' -select 'Latest'
$licenseFile = 'Path of license'
New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -licenseFile $licenseFile `
    -updateHosts `
    -useSSL `
    -installCertificateOnHost `
    -isolation hyperv
freddydk commented 2 years ago

Yes, that is still the only workaround.

KristofKlein commented 1 year ago

almost a year passed - what has happened to this story?

freddydk commented 1 year ago

Just tried - and now it doesn't crash - but it definitely doesn't work. Nothing really I can do about this - it is a OS error and it seems like the Windows team doesn't prioritize this scenario:-(

Luckily, there is a good workaround.

freddydk commented 1 year ago

I actually had to clean my docker installation after this - my machine blue-screened. Whether that has anything to do with this, I don't know.

DanielGoehler commented 1 year ago

@freddydk The bluescreen still happens with process isolation. Is there any way to create a Microsoft support case for this issue? More specifically, do you know who owns this part of Windows 11? I suspect this will come to Windows Server sooner or later.

jwikman commented 8 months ago

@freddydk, where is this resolved? In some version of Docker? Or some Windows update? Or a fix in BcContainerHelper? 🤓

DanielGoehler commented 8 months ago

I have the same question.

freddydk commented 8 months ago

The problem is in Windows - nothing I can do about that - I cannot do magic:-( Keeping issues like this open just consumes time...

jwikman commented 8 months ago

Ok, got it. And now it is clear in this issue, for future reference, that this is not solved yet and it has nothing to do with BcContainerHelper. 👍