microsoft / nav-docker

Official Microsoft repository for Dynamics NAV in Docker resources. It has not been decided yet, to which extend Microsoft will ship Docker images with NAV, so everything in this repo is work in progress and might be subject to deletion.
MIT License
180 stars 90 forks source link

BC14-OnPrem: Docker container created unhealthy #448

Closed dominicstarkl closed 4 years ago

dominicstarkl commented 4 years ago

We have an issue in creating a Docker container from a specific Business Central OnPrem image. The creation of the container exists with an error and the container is unhealthy.

Related image mcr.microsoft.com/businesscentral/onprem:14.10.40471.0-ch-ltsc2019

Docker info

Client:
 Debug Mode: false

Server:
 Containers: 6
  Running: 1
  Paused: 0
  Stopped: 5
 Images: 2
 Server Version: 19.03.5
 Storage Driver: windowsfilter
  Windows:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: inactive
 Default Isolation: hyperv
 Kernel Version: 10.0 18362 (18362.1.amd64fre.19h1_release.190318-1202)
 Operating System: Windows 10 Enterprise Version 1903 (OS Build 18362.1)
 OSType: windows
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.79GiB
 Name: WW10-DST01
 ID: S5QN:O7NM:AWPI:7VIL:MS6K:HYOE:GUZR:645F:DVS5:ZKM7:JQ5B:ADL5
 Docker Root Dir: C:\ProgramData\Docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

The container is created using NavContainerHelper, version 0.6.5.0

Container tries to be created with following command:

New-NavContainer @parameters `
    -containerName $containerName `
    -imageName $imageversion.containerImage `
    -auth NAVUserPassword `
    -Credential $credential `
    -alwaysPull:$imageversion.alwaysPull `
    -updateHosts `
    -doNotExportObjectsToText `
    -enableSymbolLoading:$enableSymbolLoading `
    -useBestContainerOS `
    -shortcuts $shortcuts `
    -licenseFile "$licenseFile" `
    -additionalParameters $additionalParameters `
    -myScripts $myscripts `
    -useTraefik:$false

We can create containers from other BC OnPrem images in the same way as described above without any issues.

Full event protocol until the error occurs:

NavContainerHelper 0.6.5.0 is installed
Determine latest NavContainerHelper version
NavContainerHelper 0.6.5.0 is the latest version
Create SPT-dev from mcr.microsoft.com/businesscentral/onprem:14.10.40471.0-ch-ltsc2019
NavContainerHelper is version 0.6.5.0
NavContainerHelper is running as administrator
Host is Microsoft  - 1903
Docker Client Version is 19.03.5
Docker Server Version is 19.03.5
Pulling image mcr.microsoft.com/businesscentral/onprem:14.10.40471.0-ch-ltsc2019
14.10.40471.0-ch-ltsc2019: Pulling from businesscentral/onprem
[...]
Digest: sha256:4dfd9d00c1d6c904c454c087110ca838d03b5e218fb41d45d2c0211f450623c0
Status: Downloaded newer image for mcr.microsoft.com/businesscentral/onprem:14.10.40471.0-ch-ltsc2019
mcr.microsoft.com/businesscentral/onprem:14.10.40471.0-ch-ltsc2019
Using image mcr.microsoft.com/businesscentral/onprem:14.10.40471.0-ch-ltsc2019
Removing SPT-dev from host hosts file
Removing C:\ProgramData\NavContainerHelper\Extensions\SPT-dev
Creating Container SPT-dev
Version: 14.10.40471.0-ch
Style: onprem
Platform: 14.0.40464.0
Generic Tag: 0.0.9.98
Container OS Version: 10.0.17763.973 (ltsc2019)
Host OS Version: 10.0.18362.1 (1903)
A better Generic Container OS exists for your host (mcr.microsoft.com/dynamicsnav:10.0.18362.116-generic)
Using generic image mcr.microsoft.com/dynamicsnav:10.0.18362.116-generic
Pulling image mcr.microsoft.com/dynamicsnav:10.0.18362.116-generic
10.0.18362.116-generic: Pulling from dynamicsnav
5b663e3b9104: Already exists
0887519c3911: Pulling fs layer
[...]
Digest: sha256:6a5df0f863f3eba25855e17e8bfbd666ef5bce13364ac4470c8220cd3230b997
Status: Downloaded newer image for mcr.microsoft.com/dynamicsnav:10.0.18362.116-generic
Generic Container OS Version: 10.0.18362.116 (1903)
Generic Tag of better generic: 0.0.9.99
WARNING: The container operating system matches the host operating system, but the revision is different.
If you encounter issues, you might want to specify -isolation hyperv
Using locale de-CH
Using process isolation
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\Users\d.starkl\Source\Repos\SPT.Ext\200117_D365_V14_5399438.flf
Files in C:\ProgramData\NavContainerHelper\Extensions\SPT-dev\my:
- AdditionalOutput.ps1
- AdditionalSetup.ps1
- license.flf
- MainLoop.ps1
- SetupNavUsers.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container SPT-dev from image mcr.microsoft.com/dynamicsnav:10.0.18362.116-generic
781037fe43d272ab407d3c9d27852b8274cdbb458f0ed54daeaaa444caa4eb25
Waiting for container SPT-dev to be ready
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 Test Assemblies
Copying TestToolKit
Copying UpgradeToolKit
Copying Extensions
Copying ClientUserSettings
Copying ReportBuilder
Changing Database Server Collation to Latin1_General_100_CI_AS
SQL Server 2017 transmits information about your installation experience, as well as other usage and performance data, to Microsoft to help improve the product. To learn more about SQL Server 2017 data 
processing and privacy controls, please see the Privacy Statement.
Copying Cronus database
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
Failed to start service 'Dynamics 365 Business Central Server [NAV] (MicrosoftDynamicsNavServer$NAV)'.
at <ScriptBlock>, C:\Run\navinstall.ps1: line 216
at <ScriptBlock>, C:\Run\start.ps1: line 114
at <ScriptBlock>, <No file>: line 1Error
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 Test Assemblies
Copying TestToolKit
Copying UpgradeToolKit
Copying Extensions
Copying ClientUserSettings
Copying ReportBuilder
Changing Database Server Collation to Latin1_General_100_CI_AS
SQL Server 2017 transmits information about your installation experience, as well as other usage and performance data, to Microsoft to help improve the product. To learn more about SQL Server 2017 data 
processing and privacy controls, please see the Privacy Statement.
Copying Cronus database
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
Failed to start service 'Dynamics 365 Business Central Server [NAV] (MicrosoftDynamicsNavServer$NAV)'.
at <ScriptBlock>, C:\Run\navinstall.ps1: line 216
at <ScriptBlock>, C:\Run\start.ps1: line 114
at <ScriptBlock>, <No file>: line 1
Initialization of container SPT-dev failed
In C:\Users\d.starkl\Documents\WindowsPowerShell\Modules\navcontainerhelper\0.6.5.0\ContainerHandling\Wait-NavContainerReady.ps1:44 Zeichen:17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ... SPT-dev failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container SPT-dev failed

The terminal process terminated with exit code: 1

The EventLog of the so created unhealthy Docker container writes following entries for example:

  Cannot open database "Cronusch" requested by the login. The login failed.
  Login failed for user 'WORKGROUP\SPT-DEV$'.

It seems as if no connection can be made with the internal SQL database.

Thank you for verifying and reporting back this issue.

Regards

freddydk commented 4 years ago

The build servers did suffer from some February update problems and some images might have been wrongly build. These should have been updated - if you can assure me, that you used -alwaysPull (cannot see the value of the variable above) then I will have a look and rebuild the image.

dominicstarkl commented 4 years ago

Hy Freddy

Many thanks for your quick response.

We never use -alwaysPull because of performance issues. But I can assure you that I pulled the above mentioned Docker image at the same time I tried to create the Docker container from it. This is also written in the Event Protocol:

[...]
Status: Downloaded newer image for mcr.microsoft.com/businesscentral/onprem:14.10.40471.0-ch-ltsc2019
[...]

In the meantime, I created my desired Docker container using the DVD Path with -dvdPath, and this worked without any issues.

Nevertheless, I think it could be worthful, if you rebuild the wrongly built Docker images to avoid that other users run into the same issues a I did.

Thanks again for your help!

Regards Dominic

freddydk commented 4 years ago

Will check that image when I get back from vacation. Issue is, that I don't know which images were wrongly build - I thought I rebuild all. Thanks for all the info.

dominicstarkl commented 4 years ago

Hi Freddy Thanks for your information. I whish you a pleasant vaccation! Regards Dominic

beemubotokka commented 4 years ago

Hi, I'm quite newbie with these, but I probably found same error with following concept:

image

freddydk commented 4 years ago

@beemubotokka - that looks like a totally different issue. Please create a new issue and include the full output from the command, thanks