microsoft / navcontainerhelper

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

Creating a container with -useSSL fails with real-time protection #2582

Closed mtaanquist closed 1 year ago

mtaanquist commented 2 years ago

Describe the issue When attempting to set up a new container, with -useSSL, the container creation fails. Disabling Windows Defender's real-time protection allows it to continue without issue.

Scripts used to create container and cause the issue

New-BcContainer bctest200 `
    -accept_eula `
    -alwaysPull `
    -artifactUrl (Get-BCArtifactUrl -type OnPrem -country DK -version 20) `
    -assignPremiumPlan `
    -auth NavUserPassword `
    -doNotExportObjectsToText `
    -enableTaskScheduler `
    -isolation process `
    -licenseFile "C:\BC 20 DEV.flf" `
    -updateHosts `
    -useSSL

Full output of scripts (with real-time protection)

BcContainerHelper is version 3.0.11
BcContainerHelper is running as administrator
Hyper-V is Enabled
UsePsSession is True
Host is Microsoft Windows 10 Enterprise - 21H2
Docker Client Version is 20.10.16
Docker Server Version is 20.10.16
Removing Desktop shortcuts
Fetching all docker images
Fetching all docker volumes
INFO: Windows 10 21H1/21H2 images are not yet available, using 2004 as these are found to work better than 20H2 on 21H1/21H2
Pulling image mcr.microsoft.com/businesscentral:10.0.19041.1415
10.0.19041.1415: Pulling from businesscentral
Digest: sha256:aa9f9d0779654ab9dba736a43141591a70fa419c4a9a57fd8a517086841280ff
Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.19041.1415
mcr.microsoft.com/businesscentral:10.0.19041.1415
Using image mcr.microsoft.com/businesscentral:10.0.19041.1415
Creating Container bctest200
Style: onprem
Multitenant: No
Version: 20.2.41144.41423
Platform: 20.0.41086.41354
Generic Tag: 1.0.2.10
Container OS Version: 10.0.19041.1415 (2004)
Host OS Version: 10.0.19044.1766 (21H2)
Using process isolation
Using locale da-DK
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\BC 20 DEV.flf
Additional Parameters:
--env customNavSettings=EnableTaskScheduler=True
Files in C:\ProgramData\BcContainerHelper\Extensions\bctest200\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupNavUsers.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bctest200 from image mcr.microsoft.com/businesscentral:10.0.19041.1415
a4143133e0f4272cfa5212dfdb1d35343022fa7b40ef86f0b39615423113dc75
Waiting for container bctest200 to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.2.41144.41423/dk
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\onprem\20.2.41144.41423\platform\ServiceTier\Program Files
c:\dl\onprem\20.2.41144.41423\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\20.2.41144.41423\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\20.2.41144.41423\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\onprem\20.2.41144.41423\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\20.2.41144.41423\platform
c:\dl\onprem\20.2.41144.41423\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\20.2.41144.41423\dk\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\20.2.41144.41423\platform\Test Assemblies
Copying Applications
C:\dl\onprem\20.2.41144.41423\dk\Applications
Copying dependencies
Copying ReportBuilder
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.2.41144.41423/dk
Using installer from
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\onprem\20.2.41144.41423\platform\ServiceTier\Program Files
c:\dl\onprem\20.2.41144.41423\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\20.2.41144.41423\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\20.2.41144.41423\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\onprem\20.2.41144.41423\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\20.2.41144.41423\platform
c:\dl\onprem\20.2.41144.41423\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\20.2.41144.41423\dk\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\20.2.41144.41423\platform\Test Assemblies
Copying Applications
C:\dl\onprem\20.2.41144.41423\dk\Applications
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
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'
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 220 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.2.33 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.2.33 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.25.224.1 in container hosts file
Starting Container
Hostname is bctest200
PublicDnsName is bctest200
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint BD7242E274C5B317CB2E7A3384D756C27A5576C9
DNS identity bctest200
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting EnableTaskScheduler to True
Starting Service Tier
CertificateThumprint BD7242E274C5B317CB2E7A3384D756C27A5576C9
Registering event sources
Creating DotNetCore Web Server Instance
Using application pool name: BC
Using default container name: NavWebApplicationContainer
Copy files to WWW root C:\inetpub\wwwroot\BC
Create the application pool BC
Create website: NavWebApplicationContainer with SSL
Update configuration: navsettings.json
Done Configuring Web Client
Using license file 'c:\run\my\license.flf'
Import License
Creating http download site
Setting SA Password and enabling SA
Creating mt as SQL User and add to sysadmin
Initializing...
Cannot find path 'C:\run\my\aes.key' because it does not exist.
at <ScriptBlock>, C:\Run\SetupVariables.ps1: line 64
at <ScriptBlock>, C:\Run\my\SetupVariables.ps1: line 2
at <ScriptBlock>, C:\Run\navstart.ps1: line 25
at <ScriptBlock>, C:\Run\start.ps1: line 377
at <ScriptBlock>, <No file>: line 1Error
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.2.41144.41423/dk
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\onprem\20.2.41144.41423\platform\ServiceTier\Program Files
c:\dl\onprem\20.2.41144.41423\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\20.2.41144.41423\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\20.2.41144.41423\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\onprem\20.2.41144.41423\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\20.2.41144.41423\platform
c:\dl\onprem\20.2.41144.41423\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\20.2.41144.41423\dk\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\20.2.41144.41423\platform\Test Assemblies
Copying Applications
C:\dl\onprem\20.2.41144.41423\dk\Applications
Copying dependencies
Copying ReportBuilder
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.2.41144.41423/dk
Using installer from
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\onprem\20.2.41144.41423\platform\ServiceTier\Program Files
c:\dl\onprem\20.2.41144.41423\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\20.2.41144.41423\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\20.2.41144.41423\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\onprem\20.2.41144.41423\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\20.2.41144.41423\platform
c:\dl\onprem\20.2.41144.41423\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\20.2.41144.41423\dk\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\20.2.41144.41423\platform\Test Assemblies
Copying Applications
C:\dl\onprem\20.2.41144.41423\dk\Applications
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
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'
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 220 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.2.33 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.2.33 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.25.224.1 in container hosts file
Starting Container
Hostname is bctest200
PublicDnsName is bctest200
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint BD7242E274C5B317CB2E7A3384D756C27A5576C9
DNS identity bctest200
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting EnableTaskScheduler to True
Starting Service Tier
CertificateThumprint BD7242E274C5B317CB2E7A3384D756C27A5576C9
Registering event sources
Creating DotNetCore Web Server Instance
Using application pool name: BC
Using default container name: NavWebApplicationContainer
Copy files to WWW root C:\inetpub\wwwroot\BC
Create the application pool BC
Create website: NavWebApplicationContainer with SSL
Update configuration: navsettings.json
Done Configuring Web Client
Using license file 'c:\run\my\license.flf'
Import License
Creating http download site
Setting SA Password and enabling SA
Creating mt as SQL User and add to sysadmin
Initializing...
Cannot find path 'C:\run\my\aes.key' because it does not exist.
at <ScriptBlock>, C:\Run\SetupVariables.ps1: line 64
at <ScriptBlock>, C:\Run\my\SetupVariables.ps1: line 2
at <ScriptBlock>, C:\Run\navstart.ps1: line 25
at <ScriptBlock>, C:\Run\start.ps1: line 377
at <ScriptBlock>, <No file>: line 1
New-BcContainer Telemetry Correlation Id: 9fb0bd9f-7786-4307-a3f4-f345acec1bef
Initialization of container bctest200 failed
At C:\Users\mt\Documents\WindowsPowerShell\Modules\BcContainerHelper\3.0.11\ContainerHandling\Wait-NavContainerReady.ps1:42 char:17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ...ctest200 failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container bctest200 failed

Full output of scripts (without real-time protection)

BcContainerHelper is version 3.0.11
BcContainerHelper is running as administrator
Hyper-V is Enabled
UsePsSession is True
Host is Microsoft Windows 10 Enterprise - 21H2
Docker Client Version is 20.10.16
Docker Server Version is 20.10.16
Removing Desktop shortcuts
Fetching all docker images
Fetching all docker volumes
INFO: Windows 10 21H1/21H2 images are not yet available, using 2004 as these are found to work better than 20H2 on 21H1/21H2
Pulling image mcr.microsoft.com/businesscentral:10.0.19041.1415
10.0.19041.1415: Pulling from businesscentral
Digest: sha256:aa9f9d0779654ab9dba736a43141591a70fa419c4a9a57fd8a517086841280ff
Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.19041.1415
mcr.microsoft.com/businesscentral:10.0.19041.1415
Using image mcr.microsoft.com/businesscentral:10.0.19041.1415
Creating Container bctest200
Style: onprem
Multitenant: No
Version: 20.2.41144.41423
Platform: 20.0.41086.41354
Generic Tag: 1.0.2.10
Container OS Version: 10.0.19041.1415 (2004)
Host OS Version: 10.0.19044.1766 (21H2)
Using process isolation
Using locale da-DK
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\BC 20 DEV.flf
Additional Parameters:
--env customNavSettings=EnableTaskScheduler=True
Files in C:\ProgramData\BcContainerHelper\Extensions\bctest200\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupNavUsers.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bctest200 from image mcr.microsoft.com/businesscentral:10.0.19041.1415
d20c905f8e87e53c1ff2296908a8fb23f1b346457fef8e8b21fd42e789fea389
Waiting for container bctest200 to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.2.41144.41423/dk
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\onprem\20.2.41144.41423\platform\ServiceTier\Program Files
c:\dl\onprem\20.2.41144.41423\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\20.2.41144.41423\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\20.2.41144.41423\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\onprem\20.2.41144.41423\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.2.41144.41423\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\20.2.41144.41423\platform
c:\dl\onprem\20.2.41144.41423\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\20.2.41144.41423\dk\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\20.2.41144.41423\platform\Test Assemblies
Copying Applications
C:\dl\onprem\20.2.41144.41423\dk\Applications
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
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'
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 144 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.2.33 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.2.33 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.25.224.1 in container hosts file
Starting Container
Hostname is bctest200
PublicDnsName is bctest200                                                                                                                                                                                       Using NavUserPassword Authentication                                                                                                                                                                             Creating Self Signed Certificate                                                                                                                                                                                 Self Signed Certificate Thumbprint 4A5EEDABDEFD769B83E45A61499980BE6D845AEC                                                                                                                                      DNS identity bctest200
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting EnableTaskScheduler to True
Starting Service Tier
CertificateThumprint 4A5EEDABDEFD769B83E45A61499980BE6D845AEC
Registering event sources
Creating DotNetCore Web Server Instance
Using application pool name: BC
Using default container name: NavWebApplicationContainer
Copy files to WWW root C:\inetpub\wwwroot\BC
Create the application pool BC
Create website: NavWebApplicationContainer with SSL
Update configuration: navsettings.json
Done Configuring Web Client
Using license file 'c:\run\my\license.flf'
Import License
Creating http download site
Setting SA Password and enabling SA
Creating mt as SQL User and add to sysadmin
Creating SUPER user
Assign Premium plan for MT
Container IP Address: 172.25.238.73
Container Hostname  : bctest200
Container Dns Name  : bctest200
Web Client          : https://bctest200/BC/
Dev. Server         : https://bctest200
Dev. ServerInstance : BC
Setting bctest200 to 172.25.238.73 in host hosts file

Files:
http://bctest200:8080/ALLanguage.vsix
http://bctest200:8080/certificate.cer

WARNING: You are running a container which is 118 days old.
Microsoft recommends that you always run the latest version of our containers.

Container Total Physical Memory is 31.6Gb
Container Free Physical Memory is 14.1Gb

Initialization took 44 seconds
Ready for connections!
Reading CustomSettings.config from bctest200
Creating Desktop Shortcuts for bctest200
Container bctest200 successfully created

Use:
Get-BcContainerEventLog -containerName bctest200 to retrieve a snapshot of the event log from the container
Get-BcContainerDebugInfo -containerName bctest200 to get debug information about the container
Enter-BcContainer -containerName bctest200 to open a PowerShell prompt inside the container
Remove-BcContainer -containerName bctest200 to remove the container again
docker logs bctest200 to retrieve information about URL's again

Additional context

freddydk commented 2 years ago

I assume that using hyperv isolation resolves the issue as well? Will see if I can add some resilience to this scenario and survive the sudden container restart.

mtaanquist commented 2 years ago

Apologies, I forgot to mention that: yes, Hyper-V isolation resolves it.

It's very reminiscent of the issue we had previously in #2389.

freddydk commented 2 years ago

Thanks, yeah - I think i know how this can be fixed

mtaanquist commented 2 years ago

Are there any other new container flags you think might have the same issue that you'd like me to try out?

freddydk commented 2 years ago

I might have been a bit fast on saying that I knew what was wrong here... Could you include the full output of a container created using the same script without -useSSL?

mtaanquist commented 2 years ago

Sure thing. This is the script:

New-BcContainer bctest200 `
     -accept_eula `
     -alwaysPull `
     -artifactUrl (Get-BCArtifactUrl -type OnPrem -country DK -version 20) `
     -assignPremiumPlan `
     -auth NavUserPassword `
     -doNotExportObjectsToText `
     -enableTaskScheduler `
     -isolation process `
     -licenseFile "C:\BC 20 DEV.flf" `
     -updateHosts

And this is the output:

BcContainerHelper is version 3.0.11
BcContainerHelper is running as administrator
Hyper-V is Enabled
UsePsSession is True
Host is Microsoft Windows 10 Enterprise - 21H2
Docker Client Version is 20.10.17
Docker Server Version is 20.10.17
Removing Desktop shortcuts
Fetching all docker images
Fetching all docker volumes
INFO: Windows 10 21H1/21H2 images are not yet available, using 2004 as these are found to work better than 20H2 on 21H1/21H2
Pulling image mcr.microsoft.com/businesscentral:10.0.19041.1415
10.0.19041.1415: Pulling from businesscentral
Digest: sha256:aa9f9d0779654ab9dba736a43141591a70fa419c4a9a57fd8a517086841280ff
Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.19041.1415
mcr.microsoft.com/businesscentral:10.0.19041.1415
Using image mcr.microsoft.com/businesscentral:10.0.19041.1415
Creating Container bctest200
Style: onprem
Multitenant: No
Version: 20.3.42673.43026
Platform: 20.0.42653.43007
Generic Tag: 1.0.2.10
Container OS Version: 10.0.19041.1415 (2004)
Host OS Version: 10.0.19044.1826 (21H2)
Using process isolation
Using locale da-DK
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\Users\mt\Consortio IT ApS\Consortio IT - Dokumenter\NAV licenser\BC 20 DEV.flf
Additional Parameters:
--env customNavSettings=EnableTaskScheduler=True
Files in C:\ProgramData\BcContainerHelper\Extensions\bctest200\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupNavUsers.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bctest200 from image mcr.microsoft.com/businesscentral:10.0.19041.1415
59a9cfef0980275d24d813438bb2fbf33932e1efa8781f4c2c72eb9042ac4679
Waiting for container bctest200 to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.3.42673.43026/dk
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\onprem\20.3.42673.43026\platform\ServiceTier\Program Files
c:\dl\onprem\20.3.42673.43026\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\20.3.42673.43026\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\20.3.42673.43026\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\onprem\20.3.42673.43026\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\onprem\20.3.42673.43026\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.3.42673.43026\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.3.42673.43026\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\20.3.42673.43026\platform
c:\dl\onprem\20.3.42673.43026\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\20.3.42673.43026\dk\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\20.3.42673.43026\platform\Test Assemblies
Copying Applications
C:\dl\onprem\20.3.42673.43026\dk\Applications
Copying dependencies
Copying ReportBuilder
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.3.42673.43026/dk
Using installer from
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\onprem\20.3.42673.43026\platform\ServiceTier\Program Files
c:\dl\onprem\20.3.42673.43026\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\20.3.42673.43026\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\20.3.42673.43026\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\onprem\20.3.42673.43026\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\onprem\20.3.42673.43026\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.3.42673.43026\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.3.42673.43026\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\20.3.42673.43026\platform
c:\dl\onprem\20.3.42673.43026\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\20.3.42673.43026\dk\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\20.3.42673.43026\platform\Test Assemblies
Copying Applications
C:\dl\onprem\20.3.42673.43026\dk\Applications
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
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'
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 180 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.2.33 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.2.33 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.20.224.1 in container hosts file
Starting Container
Hostname is bctest200
PublicDnsName is bctest200
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint DB1BAFDC349F5A23E72D90D4192D170E99870506
DNS identity bctest200
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting EnableTaskScheduler to True
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
Using application pool name: BC
Using default container name: NavWebApplicationContainer
Copy files to WWW root C:\inetpub\wwwroot\BC
Create the application pool BC
Create website: NavWebApplicationContainer without SSL
Update configuration: navsettings.json
Done Configuring Web Client
Using license file 'c:\run\my\license.flf'
Import License
Creating http download site
Setting SA Password and enabling SA
Creating mt as SQL User and add to sysadmin
Creating SUPER user
Assign Premium plan for MT
Container IP Address: 172.20.224.223
Container Hostname  : bctest200
Container Dns Name  : bctest200
Web Client          : http://bctest200/BC/
Dev. Server         : http://bctest200
Dev. ServerInstance : BC
Setting bctest200 to 172.20.224.223 in host hosts file

Files:
http://bctest200:8080/ALLanguage.vsix

WARNING: You are running a container which is 132 days old.
Microsoft recommends that you always run the latest version of our containers.

Container Total Physical Memory is 31.6Gb
Container Free Physical Memory is 11.3Gb

Initialization took 124 seconds
Ready for connections!
Reading CustomSettings.config from bctest200
Creating Desktop Shortcuts for bctest200
Container bctest200 successfully created
Health check returns False, restarting container
Removing Session bctest200
bctest200
Waiting for container bctest200 to be ready

Initializing...
Setting host.docker.internal to 192.168.2.33 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.2.33 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.20.224.1 in container hosts file
Restarting Container
PublicDnsName unchanged
Hostname is bctest200
PublicDnsName is bctest200
Using NavUserPassword Authentication
Starting Local SQL Server
Starting Internet Information Server
Starting Service Tier
Container IP Address: 172.20.224.12
Container Hostname  : bctest200
Container Dns Name  : bctest200
Web Client          : http://bctest200/BC/
Dev. Server         : http://bctest200
Dev. ServerInstance : BC
Setting bctest200 to 172.20.224.12 in host hosts file

Files:
http://bctest200:8080/ALLanguage.vsix

Container Total Physical Memory is 31.6Gb
Container Free Physical Memory is 11.5Gb

Initialization took 33 seconds
Ready for connections!

Use:
Get-BcContainerEventLog -containerName bctest200 to retrieve a snapshot of the event log from the container
Get-BcContainerDebugInfo -containerName bctest200 to get debug information about the container
Enter-BcContainer -containerName bctest200 to open a PowerShell prompt inside the container
Remove-BcContainer -containerName bctest200 to remove the container again
docker logs bctest200 to retrieve information about URL's again

Just to make sure it wasn't just a transient error, I ran it with -useSSL as well, and got the same output as in the original issue description.

Let me know if there's any other information you need.

freddydk commented 1 year ago

Not sure whether you still have this problem

The problem is here...

Creating http download site
Setting SA Password and enabling SA
Creating mt as SQL User and add to sysadmin
Initializing...
Cannot find path 'C:\run\my\aes.key' because it does not exist.
at <ScriptBlock>, C:\Run\SetupVariables.ps1: line 64
at <ScriptBlock>, C:\Run\my\SetupVariables.ps1: line 2

when the script suddenly (in the middle of some other task) writes Initializing... - that is because the container is restarted in the middle of some other task. I did add a lot of resilience to this process and try to survive these restarts (which are typically caused by antivirus / defender things) - but I can never guarantee anything.

The safe bet in these cases is hyperv isolation, where the antivirus on the host doesn't become a problem.