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

Can't create a new working docker anymore. #3135

Closed FrankAuwers closed 1 year ago

FrankAuwers commented 1 year ago

Describe the issue Initialization of container FAS failed At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\5.0.4\ContainerHandling\Wait-NavContainerReady.ps1:42 char:17

Scripts used to create container and cause the issue

New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -licenseFile $licenseFile `
    -memoryLimit 4G `
    -updateHosts

Full output of scripts

New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -licenseFile $licenseFile `
    -memoryLimit 4G `
    -updateHosts
BcContainerHelper is version 5.0.4
BcContainerHelper is not running as administrator
UsePsSession is True
Host is Microsoft Windows 11 Pro - 10.0.22621.2070
Docker Client Version is 24.0.2
Docker Server Version is 24.0.2
Removing entries from hosts
Removing FAS from container hosts file
Removing FAS-* from container hosts file
Removing Desktop shortcuts
Removing C:\ProgramData\BcContainerHelper\Extensions\FAS
Fetching all docker images
Fetching all docker volumes
Using image mcr.microsoft.com/businesscentral:10.0.20348.1850
Creating Container FAS
Style: sandbox
Multitenant: Yes
Version: 23.0.11610.0
Platform: 23.0.11561.0
Generic Tag: 1.0.2.14
Container OS Version: 10.0.20348.1850 (ltsc2022)
Host OS Version: 10.0.22621.2070 (22H2)
Using process isolation
Using locale nl-BE
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\Data\4941796.bclicense
Files in C:\ProgramData\BcContainerHelper\Extensions\FAS\my:
- AdditionalOutput.ps1
- license.bclicense
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container FAS from image mcr.microsoft.com/businesscentral:10.0.20348.1850
831aa8cea9dc2e245482fbcf54ce90427f06a81c1d9ff28a0b5f20408337bdb0
Waiting for container FAS to be ready
Using artifactUrl https://bcinsider.azureedge.net/sandbox/23.0.11610.0/be
Using installer from C:\Run\210-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\sandbox\23.0.11610.0\platform\ServiceTier\Program Files
c:\dl\sandbox\23.0.11610.0\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\23.0.11610.0\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\23.0.11610.0\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\sandbox\23.0.11610.0\platform\WebClient\Microsoft Dynamics NAV
Copying ModernDev Files
c:\dl\sandbox\23.0.11610.0\platform
c:\dl\sandbox\23.0.11610.0\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\sandbox\23.0.11610.0\be\ConfigurationPackages
Copying Test Assemblies
C:\dl\sandbox\23.0.11610.0\platform\Test Assemblies
Copying Extensions
C:\dl\sandbox\23.0.11610.0\be\Extensions
Copying Applications
C:\dl\sandbox\23.0.11610.0\platform\Applications
Copying Applications.BE
C:\dl\sandbox\23.0.11610.0\be\Applications.BE
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Restoring CRONUS Demo Database
Setting CompatibilityLevel for tenant on localhost\SQLEXPRESS
Exporting Application to CRONUS
Removing Application from tenant
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
Copying Database on localhost\SQLEXPRESS from tenant to default
Taking database tenant offline
Copying database files
Attaching files as new Database default
Putting database tenant back online
Mounting tenant database
Mounting Database for default on server localhost\SQLEXPRESS with AllowAppDatabaseWrite = False
An internal WebSocket error occurred. Please see the innerException, if present, for more details. 
at Mount-NavDatabase, C:\Run\HelperFunctions.ps1: line 376
at <ScriptBlock>, C:\Run\navinstall.ps1: line 342
at <ScriptBlock>, C:\Run\start.ps1: line 242
at <ScriptBlock>, <No file>: line 1Error
Using artifactUrl https://bcinsider.azureedge.net/sandbox/23.0.11610.0/be
Using installer from C:\Run\210-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\sandbox\23.0.11610.0\platform\ServiceTier\Program Files
c:\dl\sandbox\23.0.11610.0\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\23.0.11610.0\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\23.0.11610.0\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\sandbox\23.0.11610.0\platform\WebClient\Microsoft Dynamics NAV
Copying ModernDev Files
c:\dl\sandbox\23.0.11610.0\platform
c:\dl\sandbox\23.0.11610.0\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\sandbox\23.0.11610.0\be\ConfigurationPackages
Copying Test Assemblies
C:\dl\sandbox\23.0.11610.0\platform\Test Assemblies
Copying Extensions
C:\dl\sandbox\23.0.11610.0\be\Extensions
Copying Applications
C:\dl\sandbox\23.0.11610.0\platform\Applications
Copying Applications.BE
C:\dl\sandbox\23.0.11610.0\be\Applications.BE
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Restoring CRONUS Demo Database
Setting CompatibilityLevel for tenant on localhost\SQLEXPRESS
Exporting Application to CRONUS
Removing Application from tenant
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
Copying Database on localhost\SQLEXPRESS from tenant to default
Taking database tenant offline
Copying database files
Attaching files as new Database default
Putting database tenant back online
Mounting tenant database
Mounting Database for default on server localhost\SQLEXPRESS with AllowAppDatabaseWrite = False
An internal WebSocket error occurred. Please see the innerException, if present, for more details. 
at Mount-NavDatabase, C:\Run\HelperFunctions.ps1: line 376
at <ScriptBlock>, C:\Run\navinstall.ps1: line 342
at <ScriptBlock>, C:\Run\start.ps1: line 242
at <ScriptBlock>, <No file>: line 1
New-BcContainer Telemetry Correlation Id: 49312cf5-dcbd-4a64-8795-0f220d0de35f
Initialization of container FAS failed
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\5.0.4\ContainerHandling\Wait-NavContainerReady.ps1:42 char:17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization of container FAS failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container FAS failed
...

Additional context

freddydk commented 1 year ago

Could you see whether -isolation hyperv changes anything?

FrankAuwers commented 1 year ago

The script runs now further, but stills an error.

Here the complete output:

New-BcContainer -accept_eula -containerName $containerName -credential $credential -auth $auth -artifactUrl $artifactUrl -licenseFile $licenseFile -memoryLimit 4G -isolation hyperv ` -updateHosts BcContainerHelper is version 5.0.4 BcContainerHelper is not running as administrator UsePsSession is True Host is Microsoft Windows 11 Pro - 10.0.22621.2070 Docker Client Version is 24.0.2 Docker Server Version is 24.0.2 Removing Session FAS Removing container FAS Removing entries from hosts Removing FAS from container hosts file Removing FAS-* from container hosts file Removing Desktop shortcuts Removing C:\ProgramData\BcContainerHelper\Extensions\FAS Downloading artifact /sandbox/23.0.11611.0/be Downloading C:\Users\FrankAuwers\AppData\Local\Temp\035675a4-29a8-4201-afc2-f6a23dabc6f8.zip Downloading using WebClient Unpacking artifact to tmp folder using 7zip Downloading platform artifact /sandbox/23.0.11611.0/platform Downloading C:\Users\FrankAuwers\AppData\Local\Temp\5a1d25ce-08f4-4526-b5a7-1170c4647e76.zip Downloading using WebClient Unpacking platform artifact to tmp folder using 7zip Downloading Prerequisite Components Downloading c:\bcartifacts.cache\sandbox\23.0.11611.0\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi Downloading using WebClient Downloading c:\bcartifacts.cache\sandbox\23.0.11611.0\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe Downloading using WebClient INFO: Patching wrong version of Microsoft.IdentityModel.Clients.ActiveDirectory.dll in c:\bcartifacts.cache\sandbox\23.0.11611.0\platform\Applications\testframework\TestRunner\Internal\Microsoft.IdentityModel.Clients.Act iveDirectory.dll Fetching all docker images Fetching all docker volumes Using image mcr.microsoft.com/businesscentral:10.0.20348.1850 Creating Container FAS Style: sandbox Multitenant: Yes Version: 23.0.11611.0 Platform: 23.0.11561.0 Generic Tag: 1.0.2.14 Container OS Version: 10.0.20348.1850 (ltsc2022) Host OS Version: 10.0.22621.2070 (22H2) Using hyperv isolation Using locale nl-BE Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable) Using license file C:\Data\4941796.bclicense Files in C:\ProgramData\BcContainerHelper\Extensions\FAS\my:

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

Container Total Physical Memory is 4.5Gb Container Free Physical Memory is 0.6Gb

Initialization took 18 seconds Ready for connections! container 1ac413b19313b97ecebae4b31feef4f3911d8ca912c4096ebf24b06b35ad8104 encountered an error during hcs::System::CreateProcess: failure in a Windows system call: The remote procedure call failed. (0x6be) [Event Detail: Provider: 00000000-0000-0000-0000-000000000000] [Event Detail: Provider: 00000000-0000-0000-0000-000000000000] [Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF717B8F64D: (caller: 00007FF717B34AE7) Exception(68) tid(3e4) 800706BE The remote procedure call failed. CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess] Provider: 00000000-0000-0000-0000-000000000000] ServerInstance 'MicrosoftDynamicsNavServer$BC' is not running.

Container Free Physical Memory: 3.9Gb

Services in container FAS:

New-BcContainer Telemetry Correlation Id: 84584fc7-6e8e-4569-8f25-2c431ae4de0c **ServerInstance 'MicrosoftDynamicsNavServer$BC' is not running. At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\5.0.4\ContainerHandling\Invoke-ScriptInNavContainer.ps1:285 char:25

TrippyZ commented 1 year ago

Try removing the memoryLimit

freddydk commented 1 year ago

As @TrippyZ said - or set it to 6G or 8G - 4G is probably not enough

FrankAuwers commented 1 year ago

Thanks, this works.

freddydk commented 1 year ago

You might be able to use process isolation as well without the memorylimit - that might very well have been the problem all along