Closed ZacRyon closed 2 years ago
Please try to add -alwaysPull to new-bccontainer to get the latest generic image (just once)
I tried adding it and got the output below. Does it matter where I add it?
cmdlet
New-BCContainer -accept_eula
-containerName $MyDevContainerName -artifactUrl $MyArtifactUrl
-licenseFile $LicenseFile -Auth NavUserPassword
-Credential $Credential -updateHosts
-isolation hyperv -multitenant
-includeAL -UsecleanDatabase
-alwayspull -useNewDatabase
-assignPremiumPlan -copyTables @('Add-in', 'Report Layout', 'Style Sheet')
-myscripts @("https://raw.githubusercontent.com/microsoft/nav-docker/master/override/issue2434/HelperFunctions.ps1")
Output BcContainerHelper is version 3.0.11 BcContainerHelper is running as administrator Hyper-V is Enabled UsePsSession is True Host is Microsoft Windows 10 Pro - 21H1 Docker Client Version is 20.10.14 Docker Server Version is 20.10.14 Removing entries from hosts Removing BC203US from container hosts file Removing BC203US-* from container hosts file Removing Desktop shortcuts Removing C:\ProgramData\BcContainerHelper\Extensions\BC203US 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 Pulling image mcr.microsoft.com/businesscentral:10.0.19041.1415 10.0.19041.1415: Pulling from businesscentral Digest: sha256:aa9f9d0779654ab9dba736a43141591a70fa419c4a9a57fd8a517086841280ff Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.19041.1415 mcr.microsoft.com/businesscentral:10.0.19041.1415 Using image mcr.microsoft.com/businesscentral:10.0.19041.1415 Creating Container BC203US Style: sandbox Multitenant: Yes Version: 20.3.42673.43456 Platform: 20.0.42653.43435 Generic Tag: 1.0.2.10 Container OS Version: 10.0.19041.1415 (2004) Host OS Version: 10.0.19043.1826 (21H1) Using hyperv 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\BC203US\my\HelperFunctions.ps1 Using license file C:\OD\OneDrive\Licenses\v20 - expires 30 Aug 2022.flf Files in C:\ProgramData\BcContainerHelper\Extensions\BC203US\my:
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DockerDo
Just for the heck of it, I rebooted and tried again. I'm now back at my original error ("Access to path 'C:\run\Collation.txt' is denied").
Here's the output:
BcContainerHelper version 3.0.11 BcContainerHelper emits usage statistics telemetry to Microsoft BcContainerHelper is version 3.0.11 BcContainerHelper is running as administrator Hyper-V is Enabled UsePsSession is True Host is Microsoft Windows 10 Pro - 21H1 Docker Client Version is 20.10.14 Docker Server Version is 20.10.14 Removing entries from hosts Removing BC203US from container hosts file Removing BC203US-* from container hosts file Removing Desktop shortcuts Removing C:\ProgramData\BcContainerHelper\Extensions\BC203US 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 Pulling image mcr.microsoft.com/businesscentral:10.0.19041.1415 10.0.19041.1415: Pulling from businesscentral Digest: sha256:aa9f9d0779654ab9dba736a43141591a70fa419c4a9a57fd8a517086841280ff Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.19041.1415 mcr.microsoft.com/businesscentral:10.0.19041.1415 Using image mcr.microsoft.com/businesscentral:10.0.19041.1415 Creating Container BC203US Style: sandbox Multitenant: Yes Version: 20.3.42673.43456 Platform: 20.0.42653.43435 Generic Tag: 1.0.2.10 Container OS Version: 10.0.19041.1415 (2004) Host OS Version: 10.0.19043.1826 (21H1) Using hyperv 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\BC203US\my\HelperFunctions.ps1 Using license file C:\OD\OneDrive\Licenses\v20 - expires 30 Aug 2022.flf Files in C:\ProgramData\BcContainerHelper\Extensions\BC203US\my:
Files: http://BC203US:8080/ALLanguage.vsix
WARNING: You are running a container which is 140 days old. Microsoft recommends that you always run the latest version of our containers.
Container Total Physical Memory is 8.5Gb Container Free Physical Memory is 6.4Gb
Initialization took 52 seconds Ready for connections! Reading CustomSettings.config from BC203US Creating Desktop Shortcuts for BC203US Creating .net Assembly Reference Folder for VS Code Copying DLLs from C:\Windows\assembly to assemblyProbingPath Copying DLLs from C:\Windows\Microsoft.NET\assembly to assemblyProbingPath Copying DLLs from C:\Program Files\Microsoft Dynamics NAV\200\Service to assemblyProbingPath Copying DLLs from C:\Program Files (x86)\Microsoft Dynamics NAV\200\RoleTailored Client to assemblyProbingPath Copying DLLs from C:\Test Assemblies\Mock Assemblies to assemblyProbingPath Copying DLLs from C:\Program Files (x86)\Open XML SDK to assemblyProbingPath Stopping ServiceTier in order to replace database Copying Database on localhost\SQLEXPRESS from CRONUS to mytempdb Taking database CRONUS offline Copying database files Attaching files as new Database mytempdb Putting database CRONUS back online Removing Database CRONUS from localhost\SQLEXPRESS Access to the path 'C:\run\Collation.txt' is denied.
Exception Script Stack Trace:
at
PowerShell Call Stack:
at Invoke-ScriptInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.11\ContainerHandling\Invoke-ScriptInNavContainer.ps1: line 71
at Clean-BcContainerDatabase, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.11\AppHandling\Clean-BcContainerDatabase.ps1: line 99
at New-BcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.11\ContainerHandling\New-NavContainer.ps1: line 2237
at
Container Free Physical Memory: 7.0Gb
Services in container BC203US:
New-BCContainer Telemetry Correlation Id: 170c0c1b-d073-4102-b49b-bf15dad8a372 Access to the path 'C:\run\Collation.txt' is denied. At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\3.0.11\ContainerHandling\Invoke-ScriptInNavContainer.ps1:112 char:13
+ CategoryInfo : OperationStopped: (Access to the p...txt' is denied.:String) [], RuntimeException
+ FullyQualifiedErrorId : Access to the path 'C:\run\Collation.txt' is denied.
Is there any additional info I can provide to help resolve this?
No, I think the repro scenario is clear - I just need to have time to look at this and I have a few other urgent things after my vacation.
Any progress on this issue? This is holding us up in getting a bunch of clients upgraded to a later version.
Sorry about the delay, but I have a hard time reproing this, even though the scenario is very clear. I have tried in multiple ways - and even using the same generic image as you - not a problem on my Windows 11, but here's what you should do:
Remove the -myscripts line - the issue2434 fix was only temporary until the generic image was updated
This doesn't fix the problem, but an old override might have other implications, and should not be used here. It also states in comments on issue 2434 that this override is no longer necessary.
Now you can try one out of three things (in order of easiness - any should solve the issue)
-useGenericImage (Get-BestGenericImageName -hostOsVersion 10.0.17763)
which should force your machine to use the latest Windows Server 2019 generic image (instead of the 2004 image) and yes, only specify three elements of the OS version number.-myscripts @("your collation file path")
to your New-BcContainer statementBTW - you will need (2) if you want to control the collation of your database to be something else than default.
Thank you. I'll try these out.
Thank you for figuring that out. I did the first two suggestions and was able to execute the cmdlet.
Describe the issue When running the New-BCContainer cmdlet, I get this error: "Access to the path 'C:\run\Collation.txt' is denied."
Scripts used to create container and cause the issue
(The variables are not included, but set immediately before this command.)
Full output of scripts
Additional context