microsoft / navcontainerhelper

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

Error creating container BC14 CU23 #2150

Closed calliopedavidroldan closed 2 years ago

calliopedavidroldan commented 2 years ago

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

Describe the issue Error creating container BC 14 CU23

Scripts used to create container and cause the issue

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

Full output of scripts

Creating container LEP-Dev...
BcContainerHelper is version 2.0.16
BcContainerHelper is running as administrator
Host is Microsoft Windows 10 Professionnel - 21H1
Docker Client Version is 20.10.8
Docker Server Version is 20.10.8
Fetching all docker images
Fetching all docker volumes
INFO: Windows 10 21H1 images are not yet available, using 2004 as these are found to work better than 20H2 on 21H1
Pulling image mcr.microsoft.com/businesscentral:10.0.19041.1288
10.0.19041.1288: Pulling from businesscentral
Digest: sha256:0e92606977d3db824f202a6e094def931e3172a98fc79163f3a957f2068112f5
Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.19041.1288
mcr.microsoft.com/businesscentral:10.0.19041.1288
Using image mcr.microsoft.com/businesscentral:10.0.19041.1288
Disabling Health Check (always report healthy)
Creating Container LEP-Dev
Style: onprem
Multitenant: No
Version: 14.24.46857.0
Platform: 14.0.46844.0
Generic Tag: 1.0.1.8
Container OS Version: 10.0.19041.1288 (2004)
Host OS Version: 10.0.19043.1288 (21H1)
Using process isolation
Using locale fr-FR
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\Users\jplett\source\Workspaces\D365BC LEPICARD IMPLEMENTATION\Configs\NAV-DEV-License.flf
Additional Parameters:
--volume "C:\Users\jplett\source\Workspaces\D365BC LEPICARD IMPLEMENTATION\Dev\NAV\Add-Ins":c:\run\Add-Ins
--volume "C:\Users\jplett\source\Workspaces\D365BC LEPICARD IMPLEMENTATION\Baseline":c:\temp
--env bakfile="c:\temp\ANVEDI14.5_CMC14.08(D365BCCU8)_NAV14.08.39327(D365BCCU8)_FR.bak"
Files in C:\ProgramData\NavContainerHelper\Extensions\LEP-Dev\my:
- AdditionalOutput.ps1
- AdditionalSetup.ps1
- license.flf
- MainLoop.ps1
- SetupNavUsers.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container LEP-Dev from image mcr.microsoft.com/businesscentral:10.0.19041.1288
bdda9a0432450b42c187369b55192d2d54947b560a2fe8dd2f9c8f541eb1f88d
Waiting for container LEP-Dev to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/14.24.46857.0/fr
Using installer from C:\Run\130
Copying Platform Artifacts
c:\dl\onprem\14.24.46857.0\platform
Copying Application Artifacts
Copying Installers
c:\dl\onprem\14.24.46857.0\fr\Installers
Copying TestToolKit
c:\dl\onprem\14.24.46857.0\fr\TestToolKit
Copying UpgradeToolKit
c:\dl\onprem\14.24.46857.0\fr\UpgradeToolKit
Copying Extensions
c:\dl\onprem\14.24.46857.0\fr\Extensions
Installing Business Central
Installing Url Rewrite
Installing OpenXML
Installing DotNetCore
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
Copying Web Client Files
Copying Windows Client Files
Copying PowerShell Scripts
Copying ConfigurationPackages
Copying Test Assemblies
Copying TestToolKit
Copying UpgradeToolKit
Copying Extensions
Copying ClientUserSettings
Copying ReportBuilder
Skipping restore of Cronus database
Installing C:\NAVDVD\Installers\FR\RTC\RoleTailoredClient.Local.Fr.msi
Skipping C:\NAVDVD\Installers\FR\WebHelp\WebHelp.Local.Fr.msi
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Installation took 69 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.1.31 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.1.31 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.28.144.1 in container hosts file
Starting Container
Hostname is LEP-Dev
PublicDnsName is LEP-Dev
Using NavUserPassword Authentication
Using Database .bak file 'c:\temp\ANVEDI14.5_CMC14.08(D365BCCU8)_NAV14.08.39327(D365BCCU8)_FR.bak'
Using database server localhost\SQLEXPRESS
Setting CompatibilityLevel for mydatabase on localhost\SQLEXPRESS
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 331735734B595EE63CAF8447D580CDA8D5C0FBD9
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Failed to start service 'Dynamics 365 Business Central Server [NAV] (MicrosoftDynamicsNavServer$NAV)'.
at <ScriptBlock>, C:\Run\navstart.ps1: line 156
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1
remove C:\NAVDVDError
Using artifactUrl https://bcartifacts.azureedge.net/onprem/14.24.46857.0/fr
Using installer from C:\Run\130
Copying Platform Artifacts
c:\dl\onprem\14.24.46857.0\platform
Copying Application Artifacts
Copying Installers
c:\dl\onprem\14.24.46857.0\fr\Installers
Copying TestToolKit
c:\dl\onprem\14.24.46857.0\fr\TestToolKit
Copying UpgradeToolKit
c:\dl\onprem\14.24.46857.0\fr\UpgradeToolKit
Copying Extensions
c:\dl\onprem\14.24.46857.0\fr\Extensions
Installing Business Central
Installing Url Rewrite
Installing OpenXML
Installing DotNetCore
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
Copying Web Client Files
Copying Windows Client Files
Copying PowerShell Scripts
Copying ConfigurationPackages
Copying Test Assemblies
Copying TestToolKit
Copying UpgradeToolKit
Copying Extensions
Copying ClientUserSettings
Copying ReportBuilder
Skipping restore of Cronus database
Installing C:\NAVDVD\Installers\FR\RTC\RoleTailoredClient.Local.Fr.msi
Skipping C:\NAVDVD\Installers\FR\WebHelp\WebHelp.Local.Fr.msi
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Installation took 69 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.1.31 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.1.31 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.28.144.1 in container hosts file
Starting Container
Hostname is LEP-Dev
PublicDnsName is LEP-Dev
Using NavUserPassword Authentication
Using Database .bak file 'c:\temp\ANVEDI14.5_CMC14.08(D365BCCU8)_NAV14.08.39327(D365BCCU8)_FR.bak'
Using database server localhost\SQLEXPRESS
Setting CompatibilityLevel for mydatabase on localhost\SQLEXPRESS
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 331735734B595EE63CAF8447D580CDA8D5C0FBD9
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Failed to start service 'Dynamics 365 Business Central Server [NAV] (MicrosoftDynamicsNavServer$NAV)'.
at <ScriptBlock>, C:\Run\navstart.ps1: line 156
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1
remove C:\NAVDVD
Initialization of container LEP-Dev failed
Au caractère C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.16\ContainerHandling\Wait-NavContainerReady.ps1:42 : 17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Press [Enter] to exit...:
...

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

Additional context

DanielGoehler commented 2 years ago

Hi @calliopedavidroldan, is something wrong with the bak ANVEDI14.5_CMC14.08(D365BCCU8)_NAV14.08.39327(D365BCCU8)_FR.bak you are using. The Service Tier isn't starting:

[...]
Failed to start service 'Dynamics 365 Business Central Server [NAV] (MicrosoftDynamicsNavServer$NAV)'.
at <ScriptBlock>, C:\Run\navstart.ps1: line 156
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1
[...]
Rukkulakki commented 2 years ago

Seems to be a periodic error :( If you add the -ImageName parameter to the same script you will get an error stating that access to the cloud file was denied.

** Removing intermediate container 8559e8bd3ec9 ---> ead8189e818c Step 6/6 : LABEL legal="http://go.microsoft.com/fwlink/?LinkId=837447" created="202110220700" nav="2004" cu="cu2" country="dk" version="16.2.13509.13779" platform="16.0.13440.13772" ---> Running in 139f34afcada Removing intermediate container 139f34afcada ---> de3d5fd1d2e8 Successfully built de3d5fd1d2e8 Successfully tagged bc16cu2:onprem-16.2.13509.13779-dk Building image took 2151 seconds Remove-Item : Adgang til cloudfilen blev nægtet At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.16\ContainerHandling\New-NavImage.ps1:601 char:17

I am getting the same error(s) if I try creating containers in the morning (CET), but they will usually succeed if run in the late afternoon.

freddydk commented 2 years ago

The latest BcContainerHelper includes a fix to not reuse old layers when building an image. Also the latest generic image have added some resilience to the process, this might also solve this issue. If not, you will have to specify -isolation hyperv.