Navcontainerhelper: Issues with Invoke-ScriptInNavContainer New-BCContainer

Created on 26 Feb 2020  路  5Comments  路  Source: microsoft/navcontainerhelper

Setup:
Docker Desktop: 2.2.0.3
Navcontainerhelper: 0.6.4.30
OS: Windows 10 Pro

Creating a container using:

New-BCContainer -accept_eula -accept_outdated -containerName BC -imageName mcr.microsoft.com/businesscentral/sandbox:14.0.29537.0-w1 -licenseFile .\Licenses\MyLicense.flf -includeAL -includeCSide -updateHosts -auth UserPassword

Outcome:

NavContainerHelper is version 0.6.4.30
NavContainerHelper is running as administrator
Host is Microsoft Windows 10 Pro - ltsc2019
Docker Client Version is 19.03.5
Docker Server Version is 19.03.5
Using image mcr.microsoft.com/businesscentral/sandbox:14.0.29537.0-w1-ltsc2019
Creating Container BC
Version: 14.0.29537.0-W1
Style: sandbox
Platform: 14.0.29530.0
Generic Tag: 0.0.9.3
Container OS Version: 10.0.17763.379 (ltsc2019)
Host OS Version: 10.0.17763.1039 (ltsc2019)
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 en-US
Using process isolation
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file .\Licenses\MyLicense.flf
Files in C:\ProgramData\NavContainerHelper\Extensions\BC\my:
- AdditionalOutput.ps1
- AdditionalSetup.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- SetupWebClient.ps1
- updatehosts.ps1
Creating container BC from image mcr.microsoft.com/businesscentral/sandbox:14.0.29537.0-w1-ltsc2019
18914ea02f1c0dc501689d8b0311dcc528c6988ec7dedfe56bfba01ee69845cc
Waiting for container BC to be ready
Initializing...
Setting host.containerhelper.internal to 172.16.0.1 in container hosts file (copy from host hosts file)
Setting host.docker.internal to 172.16.0.226 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 172.16.0.226 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)
Starting Container
Hostname is BC
PublicDnsName is BC
WARNING: DNS resolution not working from within the container.
Using NavUserPassword Authentication
Starting Local SQL Server
Starting Internet Information Server
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 58E07A09F1BB936C7F1979A4FD6318B42B363E2F
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
Enabling Financials User Experience
Using license file 'c:\run\my\license.flf'
Import License
Creating http download site
Creating Windows user dev
Setting SA Password and enabling SA
Creating dev as SQL User and add to sysadmin
Creating SUPER user
Container IP Address: 172.18.167.88
Container Hostname  : BC
Container Dns Name  : BC
Web Client          : http://BC/NAV/
Dev. Server         : http://BC
Dev. ServerInstance : NAV
Setting BC to 172.18.167.88 in host hosts file

Files:
http://BC:8080/al-3.0.106655.vsix

WARNING: You are running a container which is 335 days old.
Microsoft recommends that you always run the latest version of our containers.

Initialization took 136 seconds
Ready for connections!
Reading CustomSettings.config from BC
Creating Desktop Shortcuts for BC
**Export Objects with filter 'Id=1..1999999999' to C:\ProgramData\NavContainerHelper\Extensions\Original-14.0.29537.0-W1\objects.txt (container path)
!
at Export-NAVApplicationObject, C:\Program Files (x86)\Microsoft Dynamics NAV\140\RoleTailored Client\Microsoft.Dynamics.Nav.Ide.psm1: line 355
at <ScriptBlock>, <No file>: line 51
!
At C:\Program Files\WindowsPowerShell\Modules\navcontainerhelper\0.6.4.30\ContainerHandling\Invoke-ScriptInNavContainer.ps1:37 char:13
+             Invoke-Command -Session $session -ScriptBlock $scriptbloc ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Export-NAVApplicationObject
    + PSComputerName        : 18914ea02f1c0dc501689d8b0311dcc528c6988ec7dedfe56bfba01ee69845cc**

Tried reinstalling navcontainerhelper, same issue. License is ok, did not expire or similar.

error

Any suggestions? (Sorry for bad formatting of output)

question Fix Ready

Most helpful comment

Rookie mistake - using -isolation hyperv solves the problem.

Though I'm still a bit confused since I never had to use it before. Anyhow, my mistake.

All 5 comments

Rookie mistake - using -isolation hyperv solves the problem.

Though I'm still a bit confused since I never had to use it before. Anyhow, my mistake.

Had a similar issue, great work @mattiasboustedt.

This is due to the february update: https://freddysblog.com/2020/02/14/hyperv-isolation-to-the-rescue/
Note though that when you are using C/AL (export objects), this might cause issues with hyperv.
I am working on a more permanent solution to this problem, should be out later today.

NavContainerHelper 0.6.5.0 has shipped.

Was this page helpful?
0 / 5 - 0 ratings