microsoft / navcontainerhelper

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

Container **** does not support the function Export-NavContainerObjects ( #1357

Closed erikrijn closed 3 years ago

erikrijn commented 3 years ago

A single specific CU for NAV2018 (NL localization) throws the exception: Container n2018-cu24-nl does not support the function Export-NavContainerObjects At C:\Program Files\WindowsPowerShell\Modules\navcontainerhelper\0.7.0.26\HelperFunctions.ps1:201 char:9 When exporting objects. So far this has happened only with NAV 2018 NL CU24. This throws off our automated merge/build/release script.

I've already updated the module.

Container creation:

$artifactUrl = Get-NavArtifactUrl -nav 2018 -cu "cu$cu" -country $language
New-NavContainer -accept_eula `
    -accept_outdated `
    -containerName $containerName `
    -artifactUrl $artifactUrl `
    -auth $auth `
    -credential $credential `
    -shortcuts None `
    -alwaysPull `
    -licenseFile $licenseFile `
    -additionalParameters @('--network "transparentnet"', '--volume ' + $exportVolume, '-e locale=en-US');

Export cmd: Export-NavContainerObjects -containerName $containerName -objectsFolder $exportFolderCodeunits -exportTo "txt folder" -filter "Type=Codeunit;Id=80|86|90|5704|5988|7324"

freddydk commented 3 years ago

I need the full output of the container creation.

erikrijn commented 3 years ago
NavContainerHelper is version 0.7.0.26
NavContainerHelper is running as administrator
Host is Microsoft Windows Server 2019 Datacenter - ltsc2019
Docker Client Version is 19.03.4
Docker Server Version is 19.03.4
Removing n2018-cu24-nl from host hosts file
Removing C:\ProgramData\NavContainerHelper\Extensions\n2018-cu24-nl
Fetching all docker images
Pulling image mcr.microsoft.com/businesscentral/onprem:ltsc2019
ltsc2019: Pulling from businesscentral/onprem
Using image mcr.microsoft.com/businesscentral/onprem:ltsc2019
Creating Container n2018-cu24-nl
Version: 16.3.14085.14238-W1
Style: onprem
Platform: 16.0.14073.14195
Generic Tag: 0.0.9.99
Container OS Version: 10.0.17763.973 (ltsc2019)
Host OS Version: 10.0.17763.805 (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 E:\Licenses\idyn_NAV2018_ISV.flf
Additional Parameters:
--network "transparentnet"
--volume
E:\Export\2018\SI5.10\2018-cu24-nl:C:\Export
-e locale=en-US
Files in C:\ProgramData\NavContainerHelper\Extensions\n2018-cu24-nl\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container n2018-cu24-nl from image mcr.microsoft.com/businesscentral/onprem:ltsc2019
e88608e0f53583c48b09096e5a74f9da22c911a795797ba55361b4f9aa167c78
Waiting for container n2018-cu24-nl to be ready
Initializing...
Starting Container
Hostname is n2018-cu24-nl
PublicDnsName is n2018-cu24-nl
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 8BC8B1B4F1166F029E0E995EBBD73970F6BC4CD8
Modifying Service Tier Config File with Instance Specific Settings
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 username as SQL User and add to sysadmin
WARNING: This license is not compatible with this version of Business Central.
Creating SUPER user
WARNING: This license is not compatible with this version of Business Central.
WARNING: This license is not compatible with this version of Business Central.
Container IP Address: 169.254.56.103
Container Hostname  : n2018-cu24-nl
Container Dns Name  : n2018-cu24-nl
Web Client          : http://n2018-cu24-nl/BC/
Dev. Server         : http://n2018-cu24-nl
Dev. ServerInstance : BC

Files:
http://n2018-cu24-nl:8080/ALLanguage.vsix

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

Initialization took 339 seconds
Ready for connections!
Reading CustomSettings.config from n2018-cu24-nl
Container n2018-cu24-nl successfully created
Container n2018-cu24-nl does not support the function Export-NavContainerObjects
At C:\Program Files\WindowsPowerShell\Modules\navcontainerhelper\0.7.0.26\HelperFunctions.ps1:201 char:9
+         throw "Container $containerOrImageName does not support the f ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Container n2018...ontainerObjects:String) [], RuntimeException
    + FullyQualifiedErrorId : Container n2018-cu24-nl does not support the function Export-NavContainerObjects
erikrijn commented 3 years ago

I'm not sure why it's complainging about WARNING: This license is not compatible with this version of Business Central. The input is a valid NAV2018 development license.

erikrijn commented 3 years ago

Other artifact URLs result in a correct image. IE. Creating container n2018-cu29-nl from image mcr.microsoft.com/dynamicsnav:10.0.17763.864-generic

I'm guessing it's not a navcontainerhelper issue but an issue in the specific artifacts for NAV2018 CU24 NL.

freddydk commented 3 years ago

The problem is, that NAV 2018 CU24 is missing for a number of countries.

Get-NavArtifactUrl -nav 2018 -cu "cu24" -country "nl"

Returns blank.

Looking at the dump above - the version you get is Version: 16.3.14085.14238-W1 (latest container image)

BcContainerHelper would have given you an error

I would recommend to change to BcContainerHelper when possible for a lot of reasons - most can be found on my blog.

I will check why CU24 isn't complete.

freddydk commented 3 years ago

NAV 2018 CU24 should now be complete. Not sure why this was missing.

I also created a script to check all cus on all versions - and it seems that the only problematic version was cu24.