microsoft / navcontainerhelper

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

Access to the path 'C:\Run\Collation.txt' is denied. #2422

Closed juanbo8 closed 2 years ago

juanbo8 commented 2 years ago

We have problems with docker 4.7.1 and differents version of Windows 10 and Windows 11. It's not possible to create a container. We are using next script:

$ContainerName = 'namecontainer' $imageName = 'bc' $artifactUrl = Get-BCArtifactUrl -country 'es' -type "Sandbox" $licenseFile = 'C:\License.flf'

$UserName = 'name' $Password = ConvertTo-SecureString "pass123" -AsPlainText -Force $Credential = New-Object System.Management.Automation.PSCredential ($UserName, $Password)

New-BCContainer -accept_eula -containername $containername -auth NavUserPassword -Credential $credential -assignPremiumPlan -multitenant: $false -imageName $imageName -artifactUrl $artifactUrl -licenseFile $licenseFile -accept_outdated -updateHosts -isolation hyperv ` -additionalParameters @("--env CustomNavSettings=EnableThreadThrottling=False,EnablePrioritizedThreadThrottling=False") #para evitar errores en debugge

mtaanquist commented 2 years ago

I am seeing the same error after upgrading to BcContainerHelper 3.0.6. I managed to set up a container yesterday (with real-time protection disabled) with 3.0.5.

Tried downgrading to 3.0.5, but the same error persists.

Here's the log:

BcContainerHelper version 3.0.5
BcContainerHelper emits usage statistics telemetry to Microsoft
Configuring new Docker container for Business Central 20....
Downloading Business Central artifacts from: https://bcartifacts.azureedge.net/onprem/20.0.37253.38230/dk
BcContainerHelper is version 3.0.5
BcContainerHelper is running as administrator
Host is Microsoft Windows 10 Enterprise - 21H2
Docker Client Version is 20.10.14
Docker Server Version is 20.10.14
Removing container bcdev200
Removing bcdev200 from container hosts file
Removing bcdev200-* from container hosts file
Removing C:\ProgramData\BcContainerHelper\Extensions\bcdev200
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 bcdev200
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.19041.1415 (2004)
Host OS Version: 10.0.19044.1645 (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:\BC 20 DEV.flf
Additional Parameters:
--env customNavSettings=EnableTaskScheduler=True
Files in C:\ProgramData\BcContainerHelper\Extensions\bcdev200\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupNavUsers.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bcdev200 from image mcr.microsoft.com/businesscentral:10.0.19041.1415
062052c2bdec7f6d706c197145493667f0572f89e0f72df66f180869ed457650
Waiting for container bcdev200 to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.0.37253.38230/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.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\dk\database\Demo Database BC (20-0).bak
Changing Database Server Collation to Danish_Greenlandic_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 1Error
Using artifactUrl https://bcartifacts.azureedge.net/onprem/20.0.37253.38230/dk
Using installer from C:\Run\150-new
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
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\dk\database\Demo Database BC (20-0).bak
Changing Database Server Collation to Danish_Greenlandic_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: a8408fc0-8655-4a1d-854b-773e686b9062
Initialization of container bcdev200 failed
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.5\ContainerHandling\Wait-NavContainerReady.ps1:42 c har:17                                                                                                                  
+ ...             throw "Initialization of container $containerName failed" ...                                         
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                 
             + CategoryInfo          : OperationStopped: (Initialization ...bcdev200 failed:String) [], RuntimeException
             + FullyQualifiedErrorId : Initialization of container bcdev200 failed  
mtaanquist commented 2 years ago

Removing the downloaded images, both in Docker, and in C:\bcartifacts.cache allowed me to set up a new container.

juanbo8 commented 2 years ago

I finally uninstalled and installed docker again and it let me create the container. Thank you!