Closed mtaanquist closed 1 year 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.
Apologies, I forgot to mention that: yes, Hyper-V isolation resolves it.
It's very reminiscent of the issue we had previously in #2389.
Thanks, yeah - I think i know how this can be fixed
Are there any other new container flags you think might have the same issue that you'd like me to try out?
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?
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.
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.
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
Full output of scripts (with real-time protection)
Full output of scripts (without real-time protection)
Additional context