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

WARNING: Could not find Microsoft.Dynamics.Nav.Apps.Management.psd1 #3369

Closed rdebath closed 7 months ago

rdebath commented 7 months ago

PLEASE DO NOT INCLUDE ANY PASSWORDS OR TOKENS IN YOUR ISSUE!!!

Describe the issue WARNING: Could not find Microsoft.Dynamics.Nav.Apps.Management.psd1 Oh would you look at that; they've broken it again, a couple of days after you fixed it. :unamused:

Looks like ...

\program files\Microsoft Dynamics NAV\230\Service\Management\Microsoft.Dynamics.Nav.Apps.Management.psd1 to \program files\Microsoft Dynamics NAV\240\Service\Admin\Microsoft.BusinessCentral.Apps.Management.psd1

And something to do with Microsoft.Dynamics.Nav.Apps.Management.format.ps1xml being bodged up too.

This specific error means that the image created with either New-BcImage or New-BCContainer does NOT include the tests, they have to be loaded later which breaks (or slows down) the pipelines.

Scripts used to create container and cause the issue

New-BcContainer `
          -accept_eula `
          -accept_insiderEula `
          -artifactUrl $navurl `
          -imagename $navimage `
          -auth NavUserPassword `
          -containerName $container `
          -multitenant:$false `
          -useBestContainerOS `
          -updateHosts `
          -Credential $creds `
          -includeTestToolkit `
          -includeTestLibrariesOnly `
          -AdditionalParameters @(
            "-v c:\temp:c:\temp", "-v c:\tvt:c:\tvt"
            "--network=tlan", "--ip 10.13.74.97", "--dns=10.13.74.11", "--dns=10.13.74.1"
        )

Full output of scripts

Fetching artifact name
BcContainerHelper version 6.0.7-preview1148
Setting MicrosoftTelemetryConnectionString =
Setting bcartifactsCacheFolder = D:\bcartifacts.cache
URL https://bcinsider.azureedge.net/sandbox/24.0.16561.0/gb
Set user as TVision
Creating navserver from https://bcinsider.azureedge.net/sandbox/24.0.16561.0/gb
--------------------------------------------------------------------------------
BcContainerHelper is version 6.0.7-preview1148
BcContainerHelper is running as administrator
HyperV is Enabled
UsePsSession is True
Host is Microsoft Windows Server 2016 Standard - 10.0.14393.6709
Docker Client Version is 20.10.9
Docker Server Version is 20.10.9
Removing Desktop shortcuts
Fetching all docker images
Fetching all docker volumes
ArtifactUrl and ImageName specified
Building image navimage:24.0.16561.0 based on mcr.microsoft.com/businesscentral:10.0.14393.6709-dev with https://bcinsid
er.azureedge.net/sandbox/24.0.16561.0/gb
Pulling latest image mcr.microsoft.com/businesscentral:10.0.14393.6709-dev
10.0.14393.6709-dev: Pulling from businesscentral
Digest: sha256:274a0e6131a552966f72f4b3f35a8b3c15d687e2797ae69fd9a55819e822f496
Status: Image is up to date for mcr.microsoft.com/businesscentral:10.0.14393.6709-dev
mcr.microsoft.com/businesscentral:10.0.14393.6709-dev
Generic Tag: 1.0.2.15
Container OS Version: 10.0.14393.6709 (ltsc2016)
Host OS Version: 10.0.14393.6709 (ltsc2016)
Using process isolation
Files in D:\bcartifacts.cache\qmw2rngb.ikl\my:
Copying Platform Artifacts
D:\bcartifacts.cache\sandbox\24.0.16561.0\platform
Copying Database
Copying Licensefile
Copying ConfigurationPackages
D:\bcartifacts.cache\sandbox\24.0.16561.0\gb\ConfigurationPackages
Copying Extensions
D:\bcartifacts.cache\sandbox\24.0.16561.0\gb\Extensions
Copying Applications.GB
D:\bcartifacts.cache\sandbox\24.0.16561.0\gb\Applications.GB
D:\bcartifacts.cache\qmw2rngb.ikl
Sending build context to Docker daemon  2.743GB

Step 1/6 : FROM mcr.microsoft.com/businesscentral:10.0.14393.6709-dev
 ---> 94be967a11de
Step 2/6 : ENV DatabaseServer=localhost DatabaseInstance=SQLEXPRESS DatabaseName=CRONUS IsBcSandbox=Y artifactUrl=https:
//bcinsider.azureedge.net/sandbox/24.0.16561.0/gb filesOnly=False
 ---> Running in e71cb6821fdf
Removing intermediate container e71cb6821fdf
 ---> 1cf7c754c6d2
Step 3/6 : COPY my /run/
 ---> ad22a6866978
Step 4/6 : COPY NAVDVD /NAVDVD/
 ---> 72c877fb78e6
Step 5/6 : RUN \Run\start.ps1 -installOnly -includeTestToolkit -includeTestLibrariesOnly
 ---> Running in 987b47a27034
c:\run\my folder doesn't exist, creating it
Using DVD installer from C:\Run\240
Installing Business Central: multitenant=False, installOnly=True, filesOnly=False, includeTestToolkit=True, includeTestL
ibrariesOnly=True, includeTestFrameworkOnly=False, includePerformanceToolkit=False, appArtifactPath=, platformArtifactPa
th=, databasePath=, licenseFilePath=, rebootContainer=False
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 Web Client Files
C:\NAVDVD\WebClient\Microsoft Dynamics NAV
Copying ModernDev Files
C:\NAVDVD
C:\NAVDVD\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\NAVDVD\ConfigurationPackages
Copying Test Assemblies
C:\NAVDVD\Test Assemblies
Copying Extensions
C:\NAVDVD\Extensions
Copying Applications
C:\NAVDVD\Applications
Copying Applications.GB
C:\NAVDVD\Applications.GB
Copying dependencies
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'
C:\Applications.GB\Microsoft_Permissions Mock_24.0.16561.0.app
C:\Applications.GB\Microsoft_Test Runner_24.0.16561.0.app
C:\Applications.GB\Microsoft_Any_24.0.16561.0.app
C:\Applications.GB\Microsoft_Library Assert_24.0.16561.0.app
C:\Applications.GB\Microsoft_Permissions Mock_24.0.16561.0.app
C:\Applications.GB\Microsoft_Library Variable Storage_24.0.16561.0.app
C:\Applications.GB\Microsoft_System Application Test Library_24.0.16561.0.app
C:\Applications.GB\Microsoft_Business Foundation Test Libraries_24.0.16561.0.app
C:\Applications.GB\Microsoft_Tests-TestLibraries_24.0.16561.0.app
Starting Business Central Service Tier
Importing CRONUS license file
WARNING: Could not find Microsoft.Dynamics.Nav.Apps.Management.psd1
Stopping Business Central Service Tier
Installation took 265 seconds
Installation complete
Removing intermediate container 987b47a27034
 ---> 36f3cb754daf
Step 6/6 : LABEL legal="http://go.microsoft.com/fwlink/?LinkId=837447"       created="202402260702"       nav=""       c
u=""       country="GB"       version="24.0.16561.0"       platform="24.0.16518.0"
 ---> Running in 9add06fbb584
Removing intermediate container 9add06fbb584
 ---> 99b60eb367c1
Successfully built 99b60eb367c1
Successfully tagged navimage:24.0.16561.0
Building image took 697 seconds
Using image navimage:24.0.16561.0
Creating Container navserver
Style: sandbox
Multitenant: No
Version: 24.0.16561.0
Platform: 24.0.16518.0
Generic Tag: 1.0.2.15
Container OS Version: 10.0.14393.6709 (ltsc2016)
Host OS Version: 10.0.14393.6709 (ltsc2016)
Using process isolation
Using locale en-GB
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Additional Parameters:
-v c:\temp:c:\temp
-v c:\tvt:c:\tvt
--network=tlan
--ip 10.13.74.97
--dns=10.13.74.11
--dns=10.13.74.1
Files in C:\ProgramData\BcContainerHelper\Extensions\navserver\my:
- AdditionalOutput.ps1
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container navserver from image navimage:24.0.16561.0
8c21a23b8c80437e3a0759d2518b603953054bddc6ffe9ebc7d7aba5b8312b84
Waiting for container navserver to be ready
Initializing...
Setting host.docker.internal to 10.13.74.140 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 10.13.74.140 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to fe80 in container hosts file
Starting Container
Hostname is navserver
PublicDnsName is navserver
Using NavUserPassword Authentication
Starting Local SQL Server
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to
start...
Starting Internet Information Server
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 8AC964C5014CF10456CE0621CEE23CB8BBA85742
DNS identity navserver
Modifying Service Tier Config File with Instance Specific Settings
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
Using application pool name: BC
Using default container name: NavWebApplicationContainer
Copy files to WWW root C:\inetpub\wwwroot\BC
Create the application pool BC
Create website: NavWebApplicationContainer without SSL
Update configuration: navsettings.json
Done Configuring Web Client
Enabling Financials User Experience
Creating http download site
Setting SA Password and enabling SA
Creating TVision as SQL User and add to sysadmin
Creating SUPER user
Container IP Address: 10.13.74.97
Container Hostname  : navserver
Container Dns Name  : navserver
Web Client          : http://navserver/BC/
Dev. Server         : http://navserver
Dev. ServerInstance : BC
Setting navserver to 10.13.74.97 in host hosts file

Files:
http://navserver:8080/ALLanguage.vsix

Container Total Physical Memory is 7.9Gb
Container Free Physical Memory is 3.5Gb

Initialization took 87 seconds
Ready for connections!
Reading CustomSettings.config from navserver
Creating Desktop Shortcuts for navserver
Synchronizing Permissions Mock on default
App successfully synchronized
Installing Permissions Mock on default
App successfully installed
Synchronizing Test Runner on default
App successfully synchronized
Installing Test Runner on default
App successfully installed
Synchronizing Any on default
App successfully synchronized
Installing Any on default
App successfully installed
Synchronizing Library Assert on default
App successfully synchronized
Installing Library Assert on default
App successfully installed
Skipping app 'C:\Applications.GB\Microsoft_Permissions Mock_24.0.16561.0.app' as it is already installed
Synchronizing Library Variable Storage on default
App successfully synchronized
Installing Library Variable Storage on default
App successfully installed
Publishing C:\ProgramData\BcContainerHelper\Extensions\navserver\b6942a36-88bd-45dd-b64a-d397e003404f\Microsoft_System A
pplication Test Library_24.0.16561.0.app
Synchronizing System Application Test Library on tenant default
Installing System Application Test Library on tenant default
App Microsoft_System Application Test Library_24.0.16561.0.app successfully published
Publishing C:\ProgramData\BcContainerHelper\Extensions\navserver\2663a8ac-bc32-40e4-b44e-6d92a94bfdf5\Microsoft_Business
 Foundation Test Libraries_24.0.16561.0.app
Synchronizing Business Foundation Test Libraries on tenant default
Installing Business Foundation Test Libraries on tenant default
App Microsoft_Business Foundation Test Libraries_24.0.16561.0.app successfully published
Publishing C:\ProgramData\BcContainerHelper\Extensions\navserver\3075f6df-894b-49a8-81ea-9b9cb924d070\Microsoft_Tests-Te
stLibraries_24.0.16561.0.app
Synchronizing Tests-TestLibraries on tenant default
Installing Tests-TestLibraries on tenant default
App Microsoft_Tests-TestLibraries_24.0.16561.0.app successfully published
TestToolkit successfully imported
Cleanup old dotnet core assemblies
Container navserver successfully created

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

...

Screenshots If applicable, add screenshots to help explain your problem.

Additional context

freddydk commented 7 months ago

Should be fixed in BcContainerHelper preview as of yesterday

rdebath commented 7 months ago

Sorry, nope, it' a nav-docker issue. New-BCContainer or Import-TestToolkitToBCContainer will put the test extensions into an image that doesn't have them but when it tells nav-docker to put them in the image it's ignored because of that warning.

This is only a speed issue though, next week is more than soon enough.

freddydk commented 7 months ago

Got it - you are right, it is not fixed in the latest containerhelper.

freddydk commented 7 months ago

This is the fix in nav-docker for this: https://github.com/microsoft/nav-docker/pull/544 Will add a patch to ContainerHelper asap