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 246 forks source link

Docker Container Creation Error - Access to the path 'C:\Run\Collation.txt' is denied. #2434

Closed DBiernat closed 2 years ago

DBiernat commented 2 years ago

Describe the issue On creating a docker container the following error occurs: Access to the path 'C:\Run\Collation.txt' is denied.

Scripts used to create container and cause the issue

$containerName = "SB-TEST"
$configPackage = "W1.ENU.EXTENDED"

New-BcContainer -containerName $containerName `
    -artifactUrl (Get-BCArtifactUrl -type Sandbox -country w1) `
    -accept_eula `
    -memoryLimit 8G `
    -isolation hyperv `
    -auth Windows `
    -locale "de-DE" `
    -licenseFile "C:\Dev-L\Licenses\Lic20.flf" `
    -includeTestToolkit `
    -shortcuts None `
    -dns "8.8.8.8"

Full output of scripts

BcContainerHelper is version 3.0.6
BcContainerHelper is running as administrator
Hyper-V is Enabled
Host is Microsoft Windows 10 Enterprise - 21H2
Docker Client Version is 20.10.14
Docker Server Version is 20.10.14
Removing container SB-TEST
Removing C:\ProgramData\BcContainerHelper\Extensions\SB-TEST
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
Using image mcr.microsoft.com/businesscentral:10.0.19041.1415
Creating Container SB-TEST
Style: sandbox
Multitenant: Yes
Version: 20.0.37253.39941
Platform: 20.0.37114.39877
Generic Tag: 1.0.2.1
Container OS Version: 10.0.19041.1415 (2004)
Host OS Version: 10.0.19044.1586 (21H2)
Using hyperv isolation
Using locale de-DE
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\Dev-L\Licenses\Lic20.flf
Files in C:\ProgramData\BcContainerHelper\Extensions\SB-TEST\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatecontainerhosts.ps1
Creating container SB-TEST from image mcr.microsoft.com/businesscentral:10.0.19041.1415
c755163ed2fe238d266a32854496cf7226a2fa946bed677883c59854351c94a1
Waiting for container SB-TEST to be ready
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/20.0.37253.39941/w1
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\sandbox\20.0.37253.39941\platform\ServiceTier\Program Files
c:\dl\sandbox\20.0.37253.39941\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\20.0.37253.39941\w1\BusinessCentral-W1.bak
Changing Database Server Collation to Latin1_General_100_CS_AS
Access to the path 'C:\Run\Collation.txt' is denied.
at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629
at <ScriptBlock>, C:\Run\navinstall.ps1: line 222
at <ScriptBlock>, C:\Run\start.ps1: line 225
at <ScriptBlock>, <No file>: line 1Error
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/20.0.37253.39941/w1
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\sandbox\20.0.37253.39941\platform\ServiceTier\Program Files
c:\dl\sandbox\20.0.37253.39941\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\20.0.37253.39941\w1\BusinessCentral-W1.bak
Changing Database Server Collation to Latin1_General_100_CS_AS
Access to the path 'C:\Run\Collation.txt' is denied.
at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629
at <ScriptBlock>, C:\Run\navinstall.ps1: line 222
at <ScriptBlock>, C:\Run\start.ps1: line 225
at <ScriptBlock>, <No file>: line 1
New-BcContainer Telemetry Correlation Id: d9a8e8d5-54a1-4fa2-a022-eb9582febaab
Initialization of container SB-TEST failed
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.6\ContainerHandling\Wait-NavContainerReady.ps1:42
char:17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ... SB-TEST failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container SB-TEST failed

Additional context For now it happend all the time. The last time I reinstalled Docker and the error was gone. But today the error occured one again. The same script was running in the past.

freddydk commented 2 years ago

Is this on a local computer or on a VM? I have seen this a few times and would like to do some troubleshooting to see if we can find a good fix for this

DBiernat commented 2 years ago

Is this on a local computer or on a VM? I have seen this a few times and would like to do some troubleshooting to see if we can find a good fix for this

It's on my local computer.

freddydk commented 2 years ago

Could you try to add this parameter to your new-bccontainer command:

 -myscripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/HelperFunctions.ps1")

This is an override of helperfunctions which doesn't write back to the collation.txt file.

DBiernat commented 2 years ago

Additional Information

I found the following error in the Windows Application event log:

exec's CreateProcess() failed [exec=e83c992c6b2a706c48988851c332f91e308395037558d320c18d97bcb51b256c error=container c755163ed2fe238d266a32854496cf7226a2fa946bed677883c59854351c94a1 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The user name or password is incorrect. (0x52e) [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!00007FF721EBA40B: (caller: 00007FF721E75C8B) Exception(37) tid(4ac) 8007052E The user name or password is incorrect. CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess] Provider: 00000000-0000-0000-0000-000000000000] module=libcontainerd namespace=moby container=c755163ed2fe238d266a32854496cf7226a2fa946bed677883c59854351c94a1]

It is related to the created container. May be it will help.

DBiernat commented 2 years ago

Could you try to add this parameter to your new-bccontainer command:

 -myscripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/HelperFunctions.ps1")

This is an override of helperfunctions which doesn't write back to the collation.txt file.

Yes, it helps.

DBiernat commented 2 years ago

Could you try to add this parameter to your new-bccontainer command:

 -myscripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/HelperFunctions.ps1")

This is an override of helperfunctions which doesn't write back to the collation.txt file.

Yes, it helps.

Just for one time!

freddydk commented 2 years ago

so, the next time it fails again - with which error?

DBiernat commented 2 years ago

so, the next time it fails again - with which error?

With the same error message.

freddydk commented 2 years ago

Could you copy/paste the output. Must be different as I removed the line in which the error occured.

freddydk commented 2 years ago

the original error was: Access to the path 'C:\Run\Collation.txt' is denied.

DBiernat commented 2 years ago

Could you copy/paste the output. Must be different as I removed the line in which the error occured.

$containerName = "SB-TEST"
$configPackage = "W1.ENU.EXTENDED"

New-BcContainer -containerName $containerName `
    -artifactUrl (Get-BCArtifactUrl -type Sandbox -country w1) `
    -accept_eula `
    -memoryLimit 8G `
    -isolation hyperv `
    -auth Windows `
    -locale "de-DE" `
    -licenseFile "C:\Dev-L\Licenses\Lic20.flf" `
    # -includeTestToolkit `
    -shortcuts None `
    -dns "8.8.8.8" `
    -myScripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/HelperFunctions.ps1")

BcContainerHelper is version 3.0.6
BcContainerHelper is running as administrator
Hyper-V is Enabled
Host is Microsoft Windows 10 Enterprise - 21H2
Docker Client Version is 20.10.14
Docker Server Version is 20.10.14
Removing container SB-TEST
Removing C:\ProgramData\BcContainerHelper\Extensions\SB-TEST
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
Using image mcr.microsoft.com/businesscentral:10.0.19041.1415
Creating Container SB-TEST
Style: sandbox
Multitenant: Yes
Version: 20.0.37253.39941
Platform: 20.0.37114.39877
Generic Tag: 1.0.2.1
Container OS Version: 10.0.19041.1415 (2004)
Host OS Version: 10.0.19044.1586 (21H2)
Using hyperv isolation
Using locale de-DE
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\Dev-L\Licenses\Lic20.flf
Files in C:\ProgramData\BcContainerHelper\Extensions\SB-TEST\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatecontainerhosts.ps1
Creating container SB-TEST from image mcr.microsoft.com/businesscentral:10.0.19041.1415
90afa67f1eb6ba61a058d252b2550b016054213157784bb3085b4dc3b73e4984
Waiting for container SB-TEST to be ready
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/20.0.37253.39941/w1
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\sandbox\20.0.37253.39941\platform\ServiceTier\Program Files
c:\dl\sandbox\20.0.37253.39941\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\20.0.37253.39941\w1\BusinessCentral-W1.bak
Changing Database Server Collation to Latin1_General_100_CS_AS
Access to the path 'C:\Run\Collation.txt' is denied.
at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629
at <ScriptBlock>, C:\Run\navinstall.ps1: line 222
at <ScriptBlock>, C:\Run\start.ps1: line 225
at <ScriptBlock>, <No file>: line 1Error
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/20.0.37253.39941/w1
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\sandbox\20.0.37253.39941\platform\ServiceTier\Program Files
c:\dl\sandbox\20.0.37253.39941\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\20.0.37253.39941\w1\BusinessCentral-W1.bak
Changing Database Server Collation to Latin1_General_100_CS_AS
Access to the path 'C:\Run\Collation.txt' is denied.
at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629
at <ScriptBlock>, C:\Run\navinstall.ps1: line 222
at <ScriptBlock>, C:\Run\start.ps1: line 225
at <ScriptBlock>, <No file>: line 1
New-BcContainer Telemetry Correlation Id: 3ad92c77-51f6-4ebe-8653-e930ec7d7aa4
Initialization of container SB-TEST failed
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.6\ContainerHandling\Wait-NavContainerReady.ps1:42
char:17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ... SB-TEST failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container SB-TEST failed
fridrichovsky commented 2 years ago

Hello, I have same problem with mentioned error. I uninstalled docker and after that I installed docker back. I could create containers without error. When I restarted computer docker started and containers. Everything is OK, but if I try create new container I get error Access to the path 'C:\Run\Collation.txt' is denied. If I do same steps uninstall/install/create I can create containers until first computer restart.

I am using latest version of Docker Desktop and BCHelper. It runs on Windows 10. I tested this issue on my second machine with Windows 11 and there is without problem.

May be it helps so there is my output.

BcContainerHelper is version 3.0.6
BcContainerHelper is running as administrator
Hyper-V is Enabled
Host is Microsoft Windows 10 Enterprise - 20H2
Docker Client Version is 20.10.14
Docker Server Version is 20.10.14
Removing Balikobot-19 from container hosts file
Removing Balikobot-19-* from container hosts file
Removing C:\ProgramData\BcContainerHelper\Extensions\Balikobot-19
Fetching all docker images
Fetching all docker volumes
Pulling image mcr.microsoft.com/businesscentral:10.0.19042.1645
10.0.19042.1645: Pulling from businesscentral
Digest: sha256:33b85c008526745fe474ad0420a2b7875cd77345af0c08b84c984f51842b32c4
Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.19042.1645
mcr.microsoft.com/businesscentral:10.0.19042.1645
Using image mcr.microsoft.com/businesscentral:10.0.19042.1645
Creating Container Balikobot-19
Style: onprem
Multitenant: No
Version: 19.4.35398.35482
Platform: 19.0.35391.35473
Generic Tag: 1.0.2.1
Container OS Version: 10.0.19042.1645 (20H2)
Host OS Version: 10.0.19042.1645 (20H2)
Using process isolation
Using locale en-US
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file \\srv-file01.navisys.local\Produkty\Licence\Navisys\D365BC190\Latest\4805287.flf
Additional Parameters:
--cpu-count 4 --dns=8.8.8.8 -e customnavsettings=ClientServicesMaxUploadSize=2000,MaxStreamReadSize=2147483647,SqlManagementCommandTimeout=-1,SOAPServicesOperationTimeout=00:30:00,NavHttpClientMaxTimeout=00:30:00,NavHttpClientMaxResponseContentSize=15,ClientServicesKeepAliveInterval=00:02:00,NavHttpClientMaxTimeout=00:30:00,EnableTaskScheduler=True
--volume C:\Containers\Balikobot-19\RapidStarts:C:\Temp\RapidStarts
--volume C:\Containers\Balikobot-19\TempFiles:C:\Temp\TempFiles
--volume C:\Containers\Balikobot-19\Agent:C:\Agent
--volume C:\Containers\Balikobot-19\Packages:C:\Temp\Packages
--volume C:\Containers\Balikobot-19\Backups:C:\Temp\Backups
Files in C:\ProgramData\BcContainerHelper\Extensions\Balikobot-19\my:
- AdditionalOutput.ps1
- AdditionalSetup.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container Balikobot-19 from image mcr.microsoft.com/businesscentral:10.0.19042.1645
e97472dfbced853cdf10c39c6809e537bf5d12fa61c218d922c3aeeea633277b
Waiting for container Balikobot-19 to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/19.4.35398.35482/w1
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\19.4.35398.35482\platform\ServiceTier\Program Files

c:\dl\onprem\19.4.35398.35482\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\19.4.35398.35482\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\19.4.35398.35482\platform\WindowsPowerShellScripts\WebSearch

Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules

Determining Database Collation from c:\dl\onprem\19.4.35398.35482\w1\database\Demo Database BC (19-0).bak

Changing Database Server Collation to Latin1_General_100_CS_AS

Access to the path 'C:\Run\Collation.txt' is denied.
at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629
at <ScriptBlock>, C:\Run\navinstall.ps1: line 222
at <ScriptBlock>, C:\Run\start.ps1: line 225
at <ScriptBlock>, <No file>: line 1
Error
Using artifactUrl https://bcartifacts.azureedge.net/onprem/19.4.35398.35482/w1
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\19.4.35398.35482\platform\ServiceTier\Program Files
c:\dl\onprem\19.4.35398.35482\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\19.4.35398.35482\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\19.4.35398.35482\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\onprem\19.4.35398.35482\w1\database\Demo Database BC (19-0).bak
Changing Database Server Collation to Latin1_General_100_CS_AS
Access to the path 'C:\Run\Collation.txt' is denied.
at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629
at <ScriptBlock>, C:\Run\navinstall.ps1: line 222
at <ScriptBlock>, C:\Run\start.ps1: line 225
at <ScriptBlock>, <No file>: line 1
PS>TerminatingError(): "Initialization of container Balikobot-19 failed"
New-BcContainer Telemetry Correlation Id: 6ebaa76d-6bcb-46ee-b944-4e24ffa850ac
PS>TerminatingError(): "Initialization of container Balikobot-19 failed"
>> TerminatingError(): "Initialization of container Balikobot-19 failed"
freddydk commented 2 years ago

@DBiernat - by inserting the # in the line in the middle, your New-BcContainer stops there and the last lines are not seen as parameters for the command (i.e. you are no longer overriding the helperfunctions).

@fridrichovsky could you try to add the -myscripts as mentioned above as well

DBiernat commented 2 years ago

@DBiernat - by inserting the # in the line in the middle, your New-BcContainer stops there and the last lines are not seen as parameters for the command (i.e. you are no longer overriding the helperfunctions).

@fridrichovsky could you try to add the -myscripts as mentioned above as well

Ah, my fault! I removed that line. Now it works.

fridrichovsky commented 2 years ago

I can confirm that it works with -myScripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/HelperFunctions.ps1")

freddydk commented 2 years ago

Thanks, I will investigate why this is. Let's keep this issue open until the workaround is no longer needed.

StreichersBC commented 2 years ago

I'm having the same problem. Not to pile on, but hopefully to give you another data point.

Added your -myscripts option to no avail. Added isolation, still no help. Running on a local machine.

Script:

install-module bccontainerhelper -force

Import-Module bccontainerhelper

$accept_eula=$true

$containerName = 'bcserver1'
$password = 'P@ssw0rd'
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$credential = New-Object pscredential 'admin', $securePassword
$auth = 'UserPassword'
$artifactUrl = Get-BcArtifactUrl -type 'Sandbox' -country 'us' -select 'Latest'
New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -imageName 'bcserver1' `
    -isolation hyperv `
    -updateHosts `
    -Publishports 80,7046,7047,7049,8080 `
    -myscripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/HelperFunctions.ps1") 

Log:
BcContainerHelper is version 3.0.7
BcContainerHelper is running as administrator
Hyper-V is Enabled
Host is Microsoft Windows 10 Pro - 21H2
Docker Client Version is 20.10.14
Docker Server Version is 20.10.14
Fetching all docker images
Fetching all docker volumes
ArtifactUrl and ImageName specified
INFO: Windows 10 21H1/21H2 images are not yet available, using 2004 as these are found to work better than 20H2 on 21H1/21H2
WARNING: Unable to find matching generic image for your host OS. Using mcr.microsoft.com/businesscentral:10.0.19041.1415
Building multitenant image bcserver1:sandbox-20.0.37253.39941-us-mt based on mcr.microsoft.com/businesscentral:10.0.19041.1415 with https://bcartifacts.azuree
dge.net/sandbox/20.0.37253.39941/us
Pulling latest image mcr.microsoft.com/businesscentral:10.0.19041.1415
10.0.19041.1415: Pulling from businesscentral
Digest: sha256:5081759663a6e853232a99c2f7289d19e384ac148abe637e147d58739fc281e1
Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.19041.1415
mcr.microsoft.com/businesscentral:10.0.19041.1415
Generic Tag: 1.0.2.1
Container OS Version: 10.0.19041.1415 (2004)
Host OS Version: 10.0.19044.1645 (21H2)
Using hyperv isolation
Files in R:\BC\Artifacts.cache\4rkaefhg.x0g\my:
Copying Platform Artifacts
R:\BC\Artifacts.cache\sandbox\20.0.37253.39941\platform
Copying Database
Copying Licensefile
Copying ConfigurationPackages
R:\BC\Artifacts.cache\sandbox\20.0.37253.39941\us\ConfigurationPackages
Copying Extensions
R:\BC\Artifacts.cache\sandbox\20.0.37253.39941\us\Extensions
Copying Applications.US
R:\BC\Artifacts.cache\sandbox\20.0.37253.39941\us\Applications.US
R:\BC\Artifacts.cache\4rkaefhg.x0g
Sending build context to Docker daemon  2.206GB

Step 1/6 : FROM mcr.microsoft.com/businesscentral:10.0.19041.1415
 ---> 0f2e7be4d4fe
Step 2/6 : ENV DatabaseServer=localhost DatabaseInstance=SQLEXPRESS DatabaseName=CRONUS IsBcSandbox=Y artifactUrl=https://bcartifacts.azureedge.net/sandbox/20
.0.37253.39941/us filesOnly=False
 ---> Running in eb5a571d4b3b
Removing intermediate container eb5a571d4b3b
 ---> 941dc492a44e
Step 3/6 : COPY my /run/
 ---> c40d8f3f7d86
Step 4/6 : COPY NAVDVD /NAVDVD/
 ---> d7393ea1b468
Step 5/6 : RUN \Run\start.ps1 -installOnly -multitenant
 ---> Running in b194bdb202a1
Using installer from C:\Run\150-new
Installing Business Central
Installing from DVD
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
C:\NAVDVD\ServiceTier\Program Files
C:\NAVDVD\ServiceTier\System64Folder
Copying PowerShell Scripts
C:\NAVDVD\WindowsPowerShellScripts\Cloud\NAVAdministration
C:\NAVDVD\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation
Changing Database Server Collation to Latin1_General_100_CS_AS
Access to the path 'C:\Run\Collation.txt' is denied.
Installation failed
At C:\Run\start.ps1:372 char:9
+         throw "Installation failed"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Installation failed:String) [ 
   ], RuntimeException
    + FullyQualifiedErrorId : Installation failed
 
New-Bcimage Telemetry Correlation Id: d6482ffa-6894-41f4-954a-33b8a283e1fd
New-BcContainer Telemetry Correlation Id: 0eb03de5-15a7-4f61-b4ed-28e8b0a6773e
Docker Build failed with exit code -1
At C:\Program Files\WindowsPowerShell\Modules\bccontainerhelper\3.0.7\ContainerHandling\New-NavImage.ps1:637 char:25
+ ...              throw "Docker Build failed with exit code $LastExitCode"
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Docker Build failed with exit code -1:String) [], RuntimeException
    + FullyQualifiedErrorId : Docker Build failed with exit code -1
freddydk commented 2 years ago

@StreichersBC - the myscripts override will not kick in before running the container. With -imagename, it will build the container and have the same problem. Please try to remove the -imagename parameter

StreichersBC commented 2 years ago

Removed the imagename parameter.

Script completed.

Anything else you would like me to try?

StreichersBC commented 2 years ago

By asking if there is anything else, I mean would you like me to try anything that might help you with your troubleshooting?

freddydk commented 2 years ago

Enter the container and see whether collation.txt is readonly?

image

StreichersBC commented 2 years ago

image

freddydk commented 2 years ago

was a long shot, thanks

lvvagain commented 2 years ago

Hi, sorry I am new to github, I have same issue. Can I ask what's next, how to fix it?
Thank you.

nils-acumen commented 2 years ago

Hi There,

Just jumping on the bandwagon here to report the same issue. Interestingly the first container (that means one is running currently already, not sure if that makes any difference) started up without any issue any subsequent one is failing.

Here is my script (created with the wiz, just changed the country to 'nz')

$containerName = 'bcserver'
$password = 'P@ssw0rd'
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$credential = New-Object pscredential 'admin', $securePassword
$auth = 'UserPassword'
$artifactUrl = Get-BcArtifactUrl -type 'Sandbox' -country 'nz' -select 'Latest'
New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -updateHosts

Here is the full output:

PS C:\WINDOWS\system32> D:\bc-development\new-container-wiz.ps1
BcContainerHelper is version 3.0.6
BcContainerHelper is running as administrator
Hyper-V is Enabled
Host is Microsoft Windows 10 Enterprise - 21H2
Docker Client Version is 20.10.14
Docker Server Version is 20.10.14
Removing C:\ProgramData\BcContainerHelper\Extensions\bcserver
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
Using image mcr.microsoft.com/businesscentral:10.0.19041.1415
Creating Container bcserver
Style: sandbox
Multitenant: Yes
Version: 20.0.37253.39941
Platform: 20.0.37114.39877
Generic Tag: 1.0.2.1
Container OS Version: 10.0.19041.1415 (2004)
Host OS Version: 10.0.19044.1682 (21H2)
Using hyperv isolation
Using locale en-NZ
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Files in C:\ProgramData\BcContainerHelper\Extensions\bcserver\my:
- AdditionalOutput.ps1
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bcserver from image mcr.microsoft.com/businesscentral:10.0.19041.1415
47ccd83fc8c0ec1d88c2e40f7cf7c467850e4163c092202e90ea7da116d4f51e
Waiting for container bcserver to be ready
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/20.0.37253.39941/nz
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\sandbox\20.0.37253.39941\platform\ServiceTier\Program Files
c:\dl\sandbox\20.0.37253.39941\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\20.0.37253.39941\nz\BusinessCentral-NZ.bak
Changing Database Server Collation to Latin1_General_100_CS_AS
Access to the path 'C:\Run\Collation.txt' is denied.
at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629
at <ScriptBlock>, C:\Run\navinstall.ps1: line 222
at <ScriptBlock>, C:\Run\start.ps1: line 225
at <ScriptBlock>, <No file>: line 1Error
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/20.0.37253.39941/nz
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\sandbox\20.0.37253.39941\platform\ServiceTier\Program Files
c:\dl\sandbox\20.0.37253.39941\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\20.0.37253.39941\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\20.0.37253.39941\nz\BusinessCentral-NZ.bak
Changing Database Server Collation to Latin1_General_100_CS_AS
Access to the path 'C:\Run\Collation.txt' is denied.
at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629
at <ScriptBlock>, C:\Run\navinstall.ps1: line 222
at <ScriptBlock>, C:\Run\start.ps1: line 225
at <ScriptBlock>, <No file>: line 1
New-BcContainer Telemetry Correlation Id: 48979bdd-3b98-46db-8bbe-8131e531cb12
Initialization of container bcserver failed
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.6\ContainerHandling\Wait-NavContainerReady.ps1:42
char:17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ...bcserver failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container bcserver failed
freddydk commented 2 years ago

@lvvagain and @nils-acumen - did you try the workaround described a little earlier in the post (adding -myscripts to your command)?

nils-acumen commented 2 years ago

@freddydk Yes, I did that during the day and it worked perfectly thanks.

Kurosama commented 2 years ago

Hi @freddydk if use New-BcContainer with -isolation hyperv and myscripts parameter works properly. if use New-BcContainer with myscripts parameter but without -isolation hyperv doesn't work with this error:

$navcredential = New-Object System.Management.Automation.PSCredential -argumentList "admin", (ConvertTo-SecureString -String "password" -AsPlainText -Force)
$MyLicense = "C:\license.flf"
$artifactUrl = Get-BCArtifactUrl -country it -select Latest -type OnPrem
$containerName = "BCIT-ONPR-LAST"

New-BCContainer -accept_eula `
 -containerName $containerName `
 -Auth NavUserPassword `
 -artifactUrl $artifactUrl `
 -Credential $navcredential `
 -assignPremiumPlan `
 -updateHosts `
 -includeAL `
 -shortcuts None `
 #-isolation hyperv `
 -licensefile $MyLicense `
 -myscripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/HelperFunctions.ps1")
Importing PowerShell Modules
Determining Database Collation from c:\dl\onprem\20.0.37253.38230\it\database\Demo Database BC (20-0).bak
Changing Database Server Collation to Latin1_General_100_CI_AS
Access to the path 'C:\Run\Collation.txt' is denied.
at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629
at <ScriptBlock>, C:\Run\navinstall.ps1: line 222
at <ScriptBlock>, C:\Run\start.ps1: line 225
at <ScriptBlock>, <No file>: line 1
New-BCContainer Telemetry Correlation Id: cbacc8ba-564a-421b-86f6-c22d7fbfb0fd
Initialization of container BCIT-ONPR-LAST failed
In C:\Program
Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.5\ContainerHandling\Wait-NavContainerReady.ps1:42 car:17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ...NPR-LAST failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container BCIT-ONPR-LAST failed
freddydk commented 2 years ago

@Kurosama - you cannot out-comment a parameter like that in powershell - it means that the New-BcContainer stops before that line and you exclude the -myscripts as well.

ffulconis-pdw commented 2 years ago

Hi,

I had same issue since last Docker Desktop update to 4.7.1 on Windows 10 21h2. The workaround proposed by adding "-myscript" parameter works fine with New-BcContainerHelper but not with Run-AlPipeline, or at least I don't know how to implement it correctly.

I tried adding it this way as a parameter to my Run-AlPipeline script (dns in following example was already present in the script and works well) but it doesn't solve the issue:

Run-AlPipeline -pipelineName $pipelineName -containerName $containerName ` ....(lot of other parameters) -NewBcContainer { Param([Hashtable]$parameters) $parameters += @{ "dns" = "8.8.8.8" } $parameters += @{ "myscripts" = "https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/HelperFunctions.ps1"} New-BcContainer @parameters Invoke-ScriptInBcContainer $parameters.ContainerName -scriptblock { $progressPreference = 'SilentlyContinue' } }

I tried other syntaxes with no success but error on script not found. Is there a particular syntax to use to this parameter with Run-AlPipeline?

Kurosama commented 2 years ago

@Kurosama - you cannot out-comment a parameter like that in powershell - it means that the New-BcContainer stops before that line and you exclude the -myscripts as well.

My fault! It's the same error as a previous post... Sorry :sweat_smile: It works with -myscripts

ashirokikh commented 2 years ago

For those who have a similar issue, the workaround with -myScripts does not work if the -imageName parameter is added. The image parameter is not in the original issue description but the error is the same when the image is created.

buzzwick commented 2 years ago

We started having the same issue only very recently. Adding the -myScripts parameter and removing the -imagename parameter made it run slick as a whistle. But am I correct this is a temporary workaround?

freddydk commented 2 years ago

Yes, temporary - I am trying to get my head around the root cause of this.

StreichersBC commented 2 years ago

For those of us who may have time, are there any tests you would like us to run that would help you?

freddydk commented 2 years ago

if somebody can try with these two files included in myscripts instead of the helperfunctions override and copy/paste the output here, that would be awesome.

 -myscripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/start.ps1","https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/navinstall.ps1")
fridrichovsky commented 2 years ago

It tested your change. Container was created successful. -myscripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/start.ps1","https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/navinstall.ps1")

here is output:

BcContainerHelper is version 3.0.7
BcContainerHelper is running as administrator
Hyper-V is Enabled
Host is Microsoft Windows 11 Enterprise - 21H2
Docker Client Version is 20.10.13
Docker Server Version is 20.10.13
Removing NSSCore-20 from container hosts file
Removing NSSCore-20-* from container hosts file
Removing C:\ProgramData\BcContainerHelper\Extensions\NSSCore-20
Fetching all docker images
Fetching all docker volumes
Pulling image mcr.microsoft.com/businesscentral:10.0.20348.643
10.0.20348.643: Pulling from businesscentral
Digest: sha256:6109e8021486b29fae895410629867541a0f0515bd6228a06129f61a99906445
Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.20348.643
mcr.microsoft.com/businesscentral:10.0.20348.643
Using image mcr.microsoft.com/businesscentral:10.0.20348.643
Creating Container NSSCore-20
Style: onprem
Multitenant: No
Version: 20.0.37253.38230
Platform: 20.0.37114.38150
Generic Tag: 1.0.2.1
Container OS Version: 10.0.20348.643 (ltsc2022)
Host OS Version: 10.0.22000.493 (21H2)
Using process isolation
Using locale en-US
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Downloading C:\ProgramData\BcContainerHelper\Extensions\NSSCore-20\my\start.ps1
Downloading C:\ProgramData\BcContainerHelper\Extensions\NSSCore-20\my\navinstall.ps1
Using license file \\srv-file01.navisys.local\Produkty\Licence\Navisys\D365BC200\Latest\4805287.flf
Additional Parameters:
--cpu-count 4 --dns=8.8.8.8 -e customnavsettings=ClientServicesMaxUploadSize=2000,MaxStreamReadSize=2147483647,SqlManagementCommandTimeout=-1,SOAPServicesOperationTimeout=00:30:00,NavHttpClientMaxTimeout=00:30:00,NavHttpClientMaxResponseContentSize=15,ClientServicesKeepAliveInterval=00:02:00,NavHttpClientMaxTimeout=00:30:00,EnableTaskScheduler=True
--volume C:\Containers\NSSCore-20\RapidStarts:C:\Temp\RapidStarts
--volume C:\Containers\NSSCore-20\TempFiles:C:\Temp\TempFiles
--volume C:\Containers\NSSCore-20\Agent:C:\Agent
--volume C:\Containers\NSSCore-20\Packages:C:\Temp\Packages
--volume C:\Containers\NSSCore-20\Backups:C:\Temp\Backups
Files in C:\ProgramData\BcContainerHelper\Extensions\NSSCore-20\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- navinstall.ps1
- SetupVariables.ps1
- start.ps1
- updatehosts.ps1
Creating container NSSCore-20 from image mcr.microsoft.com/businesscentral:10.0.20348.643
5b17f7feb8d4137c35cef371c5e92b1076fa3c15e045f18fbd1bb3a9b9baa82c
Waiting for container NSSCore-20 to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.0.37253.38230/w1
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.0.37253.38230\platform\ServiceTier\Program Files
c:\dl\onprem\20.0.37253.38230\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\20.0.37253.38230\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\20.0.37253.38230\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\onprem\20.0.37253.38230\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\onprem\20.0.37253.38230\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.0.37253.38230\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.0.37253.38230\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\20.0.37253.38230\platform
c:\dl\onprem\20.0.37253.38230\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\20.0.37253.38230\platform\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\20.0.37253.38230\platform\Test Assemblies
Copying Applications
C:\dl\onprem\20.0.37253.38230\platform\Applications
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\onprem\20.0.37253.38230\w1\database\Demo Database BC (20-0).bak
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 202 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.2.119 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.2.119 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.17.96.1 in container hosts file
Starting Container
Hostname is NSSCore-20
PublicDnsName is NSSCore-20
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 0EBFAD020ECAED9C549D77704F781571F8BF843E
DNS identity NSSCore-20
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting ClientServicesMaxUploadSize to 2000
Setting MaxStreamReadSize to 2147483647
Setting SqlManagementCommandTimeout to -1
Setting SOAPServicesOperationTimeout to 00:30:00
Setting NavHttpClientMaxTimeout to 00:30:00
Setting NavHttpClientMaxResponseContentSize to 15
Setting ClientServicesKeepAliveInterval to 00:02:00
Setting NavHttpClientMaxTimeout to 00:30:00
Setting EnableTaskScheduler to True
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
Using license file 'c:\run\my\license.flf'
Import License
Creating http download site
Setting SA Password and enabling SA
Creating Admin as SQL User and add to sysadmin
Creating SUPER user
Container IP Address: 172.17.109.91
Container Hostname  : NSSCore-20
Container Dns Name  : NSSCore-20
Web Client          : http://NSSCore-20/BC/
Dev. Server         : http://NSSCore-20
Dev. ServerInstance : BC
Setting NSSCore-20 to 172.17.109.91 in host hosts file

Files:
http://NSSCore-20:8080/ALLanguage.vsix

Container Total Physical Memory is 31.8Gb
Container Free Physical Memory is 21.2Gb

Initialization took 68 seconds
Ready for connections!
Reading CustomSettings.config from NSSCore-20
Creating Desktop Shortcuts for NSSCore-20
Container NSSCore-20 successfully created

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

Thanks @fridrichovsky And exactly the same command without the 2 files in myscript would fail? (also without the helperfunctions) could you share the output of that?

ffulconis-pdw commented 2 years ago

Hi, If it can help on my side with New-ContainerHelper It works with helperfunctions but doesn't work with 2 files in myscripts (neither without any myscripts addition) (I can't make it work using Run-AlPipeline whatever additional scripts I add)

Here is the problem raised with 2 scripts files addition (bccontainerhelper 3.0.7): ... Copying ReportBuilder Importing PowerShell Modules Determining Database Collation from c:\dl\sandbox\19.3.34541.35193\base\Demo Database BC (19-0).bak Changing Database Server Collation to Latin1_General_100_CS_AS Access to the path 'C:\Run\Collation.txt' is denied. at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629 at , C:\Run\my\navinstall.ps1: line 207 at , C:\Run\my\start.ps1: line 230 at , C:\Run\start.ps1: line 32 at , : line 1 New-bcContainer Telemetry Correlation Id: 8effe02b-bfbd-4178-8344-f379d0dfa438 Initialization of container Temp-Version failed Au caractère C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.7\ContainerHandling\Wait-NavContainerReady.ps1:42 : 17

freddydk commented 2 years ago

thanks @AcererakTheLich - it should work now with the 2 files alone.

freddydk commented 2 years ago

Looking for one more test and possibly after that, I will generate new generic images, which contains the fix.

fridrichovsky commented 2 years ago

If I left myscript without settings I get error again. I tested both examples on another machine and results are bellow. Two files works, no mysript does not work.

BcContainerHelper is version 3.0.7
BcContainerHelper is running as administrator
Hyper-V is Enabled
Host is Microsoft Windows 10 Enterprise - 20H2
Docker Client Version is 20.10.14
Docker Server Version is 20.10.14
Removing NSSFinanceCZ-20 from container hosts file
Removing NSSFinanceCZ-20-* from container hosts file
Removing C:\ProgramData\BcContainerHelper\Extensions\NSSFinanceCZ-20
Fetching all docker images
Fetching all docker volumes
Pulling image mcr.microsoft.com/businesscentral:10.0.19042.1645
10.0.19042.1645: Pulling from businesscentral
Digest: sha256:33b85c008526745fe474ad0420a2b7875cd77345af0c08b84c984f51842b32c4
Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.19042.1645
mcr.microsoft.com/businesscentral:10.0.19042.1645
Using image mcr.microsoft.com/businesscentral:10.0.19042.1645
Creating Container NSSFinanceCZ-20
Style: onprem
Multitenant: No
Version: 20.0.37253.38230
Platform: 20.0.37114.38150
Generic Tag: 1.0.2.1
Container OS Version: 10.0.19042.1645 (20H2)
Host OS Version: 10.0.19042.1645 (20H2)
Using process isolation
Using locale cs-CZ
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file \\srv-file01.navisys.local\Produkty\Licence\Navisys\D365BC200\Latest\4805287.flf
Additional Parameters:
--cpu-count 4 --dns=8.8.8.8 -e customnavsettings=ClientServicesMaxUploadSize=2000,MaxStreamReadSize=2147483647,SqlManagementCommandTimeout=-1,SOAPServicesOperationTimeout=00:30:00,NavHttpClientMaxTimeout=00:30:00,NavHttpClientMaxResponseContentSize=15,ClientServicesKeepAliveInterval=00:02:00,NavHttpClientMaxTimeout=00:30:00,EnableTaskScheduler=True
--volume C:\Containers\NSSFinanceCZ-20\RapidStarts:C:\Temp\RapidStarts
--volume C:\Containers\NSSFinanceCZ-20\TempFiles:C:\Temp\TempFiles
--volume C:\Containers\NSSFinanceCZ-20\Agent:C:\Agent
--volume C:\Containers\NSSFinanceCZ-20\Packages:C:\Temp\Packages
--volume C:\Containers\NSSFinanceCZ-20\Backups:C:\Temp\Backups
Files in C:\ProgramData\BcContainerHelper\Extensions\NSSFinanceCZ-20\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container NSSFinanceCZ-20 from image mcr.microsoft.com/businesscentral:10.0.19042.1645
cf37ff8da13343a314929b33daaa326542515321eb62d542545527db1b1f8515
Waiting for container NSSFinanceCZ-20 to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.0.37253.38230/cz
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.0.37253.38230\platform\ServiceTier\Program Files

c:\dl\onprem\20.0.37253.38230\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\20.0.37253.38230\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\20.0.37253.38230\platform\WindowsPowerShellScripts\WebSearch

Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules

Determining Database Collation from c:\dl\onprem\20.0.37253.38230\cz\database\Demo Database BC (20-0).bak

Changing Database Server Collation to Czech_100_CI_AS

Access to the path 'C:\Run\Collation.txt' is denied.
at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629
at <ScriptBlock>, C:\Run\navinstall.ps1: line 222
at <ScriptBlock>, C:\Run\start.ps1: line 225
at <ScriptBlock>, <No file>: line 1
Error
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.0.37253.38230/cz
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.0.37253.38230\platform\ServiceTier\Program Files
c:\dl\onprem\20.0.37253.38230\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\20.0.37253.38230\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\20.0.37253.38230\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\onprem\20.0.37253.38230\cz\database\Demo Database BC (20-0).bak
Changing Database Server Collation to Czech_100_CI_AS
Access to the path 'C:\Run\Collation.txt' is denied.
at SetDatabaseServerCollation, C:\Run\HelperFunctions.ps1: line 629
at <ScriptBlock>, C:\Run\navinstall.ps1: line 222
at <ScriptBlock>, C:\Run\start.ps1: line 225
at <ScriptBlock>, <No file>: line 1
PS>TerminatingError(): "Initialization of container NSSFinanceCZ-20 failed"
New-BcContainer Telemetry Correlation Id: 97f878c0-cd38-453b-a59e-52478c909d9c
PS>TerminatingError(): "Initialization of container NSSFinanceCZ-20 failed"
>> TerminatingError(): "Initialization of container NSSFinanceCZ-20 failed"
Container creation duration: 00:01:51,494

If I use two files settings for myscripts

BcContainerHelper is version 3.0.7
BcContainerHelper is running as administrator
Hyper-V is Enabled
Host is Microsoft Windows 10 Enterprise - 20H2
Docker Client Version is 20.10.14
Docker Server Version is 20.10.14
Removing NSSFinanceCZ-20 from container hosts file
Removing NSSFinanceCZ-20-* from container hosts file
Removing C:\ProgramData\BcContainerHelper\Extensions\NSSFinanceCZ-20
Fetching all docker images
Fetching all docker volumes
Pulling image mcr.microsoft.com/businesscentral:10.0.19042.1645
10.0.19042.1645: Pulling from businesscentral
Digest: sha256:33b85c008526745fe474ad0420a2b7875cd77345af0c08b84c984f51842b32c4
Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.19042.1645
mcr.microsoft.com/businesscentral:10.0.19042.1645
Using image mcr.microsoft.com/businesscentral:10.0.19042.1645
Creating Container NSSFinanceCZ-20
Style: onprem
Multitenant: No
Version: 20.0.37253.38230
Platform: 20.0.37114.38150
Generic Tag: 1.0.2.1
Container OS Version: 10.0.19042.1645 (20H2)
Host OS Version: 10.0.19042.1645 (20H2)
Using process isolation
Using locale cs-CZ
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Downloading C:\ProgramData\BcContainerHelper\Extensions\NSSFinanceCZ-20\my\start.ps1
Downloading C:\ProgramData\BcContainerHelper\Extensions\NSSFinanceCZ-20\my\navinstall.ps1
Using license file \\srv-file01.navisys.local\Produkty\Licence\Navisys\D365BC200\Latest\4805287.flf
Additional Parameters:
--cpu-count 4 --dns=8.8.8.8 -e customnavsettings=ClientServicesMaxUploadSize=2000,MaxStreamReadSize=2147483647,SqlManagementCommandTimeout=-1,SOAPServicesOperationTimeout=00:30:00,NavHttpClientMaxTimeout=00:30:00,NavHttpClientMaxResponseContentSize=15,ClientServicesKeepAliveInterval=00:02:00,NavHttpClientMaxTimeout=00:30:00,EnableTaskScheduler=True
--volume C:\Containers\NSSFinanceCZ-20\RapidStarts:C:\Temp\RapidStarts
--volume C:\Containers\NSSFinanceCZ-20\TempFiles:C:\Temp\TempFiles
--volume C:\Containers\NSSFinanceCZ-20\Agent:C:\Agent
--volume C:\Containers\NSSFinanceCZ-20\Packages:C:\Temp\Packages
--volume C:\Containers\NSSFinanceCZ-20\Backups:C:\Temp\Backups
Files in C:\ProgramData\BcContainerHelper\Extensions\NSSFinanceCZ-20\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- navinstall.ps1
- SetupVariables.ps1
- start.ps1
- updatehosts.ps1
Creating container NSSFinanceCZ-20 from image mcr.microsoft.com/businesscentral:10.0.19042.1645
638b4f7473e45910959283db8f2ef10fd46148c404db0e7f46f57d30bce3b0ea
Waiting for container NSSFinanceCZ-20 to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.0.37253.38230/cz
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.0.37253.38230\platform\ServiceTier\Program Files

c:\dl\onprem\20.0.37253.38230\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\20.0.37253.38230\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\20.0.37253.38230\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\onprem\20.0.37253.38230\platform\WebClient\Microsoft Dynamics NAV

Copying Client Files
c:\dl\onprem\20.0.37253.38230\platform\LegacyDlls\program files\Microsoft Dynamics NAV

c:\dl\onprem\20.0.37253.38230\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\20.0.37253.38230\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\20.0.37253.38230\platform
c:\dl\onprem\20.0.37253.38230\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\20.0.37253.38230\platform\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\20.0.37253.38230\platform\Test Assemblies
Copying Applications
C:\dl\onprem\20.0.37253.38230\cz\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 172 seconds
Installation complete
Initializing...

Setting host.docker.internal to 192.168.68.101 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.68.101 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.17.16.1 in container hosts file
Starting Container
Hostname is NSSFinanceCZ-20
PublicDnsName is NSSFinanceCZ-20

Using NavUserPassword Authentication
Creating Self Signed Certificate

Self Signed Certificate Thumbprint 7AF808623CAB57DFA8DF016AAB46FDA532F05FB8
DNS identity NSSFinanceCZ-20
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting ClientServicesMaxUploadSize to 2000
Setting MaxStreamReadSize to 2147483647
Setting SqlManagementCommandTimeout to -1
Setting SOAPServicesOperationTimeout to 00:30:00
Setting NavHttpClientMaxTimeout to 00:30:00
Setting NavHttpClientMaxResponseContentSize to 15
Setting ClientServicesKeepAliveInterval to 00:02:00
Setting NavHttpClientMaxTimeout to 00:30:00
Setting EnableTaskScheduler to True

Starting Service Tier

Registering event sources

Creating DotNetCore Web Server Instance

Using license file 'c:\run\my\license.flf'
Import License
Creating http download site

Setting SA Password and enabling SA
Creating Admin as SQL User and add to sysadmin

Creating SUPER user

Container IP Address: 172.17.27.121
Container Hostname  : NSSFinanceCZ-20
Container Dns Name  : NSSFinanceCZ-20
Web Client          : http://NSSFinanceCZ-20/BC/
Dev. Server         : http://NSSFinanceCZ-20
Dev. ServerInstance : BC
Setting NSSFinanceCZ-20 to 172.17.27.121 in host hosts file

Files:
http://NSSFinanceCZ-20:8080/ALLanguage.vsix

Container Total Physical Memory is 19.9Gb
Container Free Physical Memory is 7.1Gb

Initialization took 55 seconds
Ready for connections!

Reading CustomSettings.config from NSSFinanceCZ-20
Creating Desktop Shortcuts for NSSFinanceCZ-20
Container NSSFinanceCZ-20 successfully created

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

Can confirm having the same issue, but the using -myscripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/start.ps1","https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/navinstall.ps1") as a workaround is a success. I'm using Windows 10 Enterprise -21H2

freddydk commented 2 years ago

Will make some changes to the generic image and create a new version of this, adding some resilience to the process

freddydk commented 2 years ago

I have created a dev version of the new generic image. If somebody can try to remove all the -myscripts and instead add:

-useGenericImage "$(Get-BestGenericImageName)-dev"

and post here how it goes, thanks

Roglar01 commented 2 years ago

Works for me :-)

buzzwick commented 2 years ago

Worked fine first time!

mtaanquist commented 2 years ago

Hey @freddydk, this change also works for me. In addition, the new image doesn't seem to run afoul of the real-time protection issue mentioned in #2389, which the two -myscripts thing still did (although at a different point in the process).

I'm going to try to spin up a few more containers, just to see if the results stay the same.

shsteindorsson commented 2 years ago

Adding -useGenericImage "$(Get-BestGenericImageName)-dev" also worked for me. Good stuff @freddydk, keep up the good work 👍

freddydk commented 2 years ago

@mtaanquist - are you saying the the new image also fixes the real-time protection issue? (that was the next thing I wanted to test)