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

Publishing extension app to BC25 Docker container fails #3719

Open ndardagan opened 2 days ago

ndardagan commented 2 days ago

Publishing extension app to BC25 Container fails I created a Docker container with bccontainerhelper using Business Central 25 artifact and my bak file on Windows 11 machine. Container is sucessfully created and I can access the webclient, but publishing my extension app from VS Code fails. There is no meaningfull error message in VS Code or event log. My app can be published to comapnies OnPrem service.

Container created with a same script and bak file on Windows 10 machine is completly functional. Publishing of the same app is also possible.

Environment Details I am using Windows 11 on the latest update, Docker Desktop on version 4.34.3 and bccontainerhelper on version 6.0.25.

This is the scripts used to create container and cause the issue

$artifactUrl = Get-BCArtifactUrl -version 25.0 -country at -type OnPrem
$containerName = "MB25DEV"

$licenseFile = "C:\ProgramData\BcContainerHelper\License\CurrentBusinessCentralOnPremisesLicense.bclicense"
$bakFile = "C:\ProgramData\BcContainerHelper\Database\MBAT25DEV_Docker_2024-10-08.bak"

New-BCContainer -accept_eula `
                -artifactUrl $artifactUrl `
                -containerName $containerName `
                -auth $auth `
                -Credential $credential `
                -licenseFile $licenseFile `
                -updateHosts `
                -isolation hyperv `
                -alwaysPull `
                -bakFile $bakFile

Full output of scripts

BcContainerHelper version 6.0.25
WinRM service is not running, will not try to use WinRM sessions
BC.HelperFunctions emits usage statistics telemetry to Microsoft
Running on Windows, PowerShell 5.1.22621.4249
BcContainerHelper is version 6.0.25
BcContainerHelper is running as administrator
HyperV is Enabled
Host is Microsoft Windows 11 Enterprise - 10.0.22631.4317
UsePsSession is True
UsePwshForBc24 is True
UseWinRmSession is never
UseSslForWinRmSession is True
Docker Client Version is 27.2.0
Docker Server Version is 27.2.0
Removing entries from hosts
Removing MB25DEV from container hosts file
Removing MB25DEV-* from container hosts file
Removing Desktop shortcuts
Removing C:\ProgramData\BcContainerHelper\Extensions\MB25DEV
Fetching all docker images
Fetching all docker volumes
Pulling image mcr.microsoft.com/businesscentral:ltsc2022
ltsc2022: Pulling from businesscentral
2534953f34d3: Already exists
3445b4971217: Pulling fs layer
816d82a57c4b: Pulling fs layer
09d427a592a1: Pulling fs layer
a0f29a885e9d: Pulling fs layer
46f0827e7e7f: Pulling fs layer
53b1996199f0: Pulling fs layer
00592d1ac9db: Pulling fs layer
ded9d30d7bcd: Pulling fs layer
82cf974f270d: Pulling fs layer
54d1ab850d60: Pulling fs layer
1911e80e06ba: Pulling fs layer
c6ea02344630: Pulling fs layer
46f0827e7e7f: Waiting
53b1996199f0: Waiting
00592d1ac9db: Waiting
a0f29a885e9d: Waiting
c347259e30a7: Pulling fs layer
82cf974f270d: Waiting
54d1ab850d60: Waiting
1911e80e06ba: Waiting
c347259e30a7: Waiting
c6ea02344630: Waiting
ded9d30d7bcd: Waiting
816d82a57c4b: Verifying Checksum
816d82a57c4b: Download complete
a0f29a885e9d: Verifying Checksum
a0f29a885e9d: Download complete
46f0827e7e7f: Verifying Checksum
46f0827e7e7f: Download complete
53b1996199f0: Verifying Checksum
53b1996199f0: Download complete
00592d1ac9db: Verifying Checksum
00592d1ac9db: Download complete
09d427a592a1: Verifying Checksum
09d427a592a1: Download complete
82cf974f270d: Verifying Checksum
82cf974f270d: Download complete
54d1ab850d60: Verifying Checksum
54d1ab850d60: Download complete
1911e80e06ba: Verifying Checksum
1911e80e06ba: Download complete
c6ea02344630: Verifying Checksum
c6ea02344630: Download complete
c347259e30a7: Verifying Checksum
c347259e30a7: Download complete
3445b4971217: Verifying Checksum
3445b4971217: Download complete
ded9d30d7bcd: Verifying Checksum
ded9d30d7bcd: Download complete
3445b4971217: Pull complete
816d82a57c4b: Pull complete
09d427a592a1: Pull complete
a0f29a885e9d: Pull complete
46f0827e7e7f: Pull complete
53b1996199f0: Pull complete
00592d1ac9db: Pull complete
ded9d30d7bcd: Pull complete
82cf974f270d: Pull complete
54d1ab850d60: Pull complete
1911e80e06ba: Pull complete
c6ea02344630: Pull complete
c347259e30a7: Pull complete
Digest: sha256:d7889d565b25c66fcd9d8163f994c85b8aac6a473d656c1895a49c3b5114b5b8
Status: Downloaded newer image for mcr.microsoft.com/businesscentral:ltsc2022
mcr.microsoft.com/businesscentral:ltsc2022
Using image mcr.microsoft.com/businesscentral:ltsc2022
Creating Container MB25DEV
Style: onprem
Multitenant: No
Version: 25.0.23364.24652
Platform: 25.0.24618.0
Generic Tag: 1.0.2.49
Container OS Version: 10.0.20348.2762 (ltsc2022)
Host OS Version: 10.0.22631.4317 (23H2)
Using hyperv isolation
Using locale de-AT
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\ProgramData\BcContainerHelper\License\CurrentBusinessCentralOnPremisesLicense.bclicense
Files in C:\ProgramData\BcContainerHelper\Extensions\MB25DEV\my:
- AdditionalOutput.ps1
- HelperFunctions.ps1
- license.bclicense
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container MB25DEV from image mcr.microsoft.com/businesscentral:ltsc2022
53952a4829fd7ea62a10a75494d98bdbfbe3712e7f458ba66416da39b72dcdc1
Waiting for container MB25DEV to be ready
Using artifactUrl https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/onprem/25.0.23364.24652/at
Using installer from C:\Run\240
Installing Business Central: multitenant=False, installOnly=False, filesOnly=False, includeTestToolkit=False, includeTestLibrariesOnly=False, includeTestFrameworkOnly=False, includePerformanceToolkit=False, appArtifactPath=c:\dl\onpre
m\25.0.23364.24652\at, platformArtifactPath=c:\dl\onprem\25.0.23364.24652\platform, databasePath=, licenseFilePath=c:\dl\onprem\25.0.23364.24652\at\database\Cronus.bclicense, rebootContainer=True
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\onprem\25.0.23364.24652\platform\ServiceTier\Program Files
c:\dl\onprem\25.0.23364.24652\platform\ServiceTier\System64Folder
Copying Web Client Files
c:\dl\onprem\25.0.23364.24652\platform\WebClient\Microsoft Dynamics NAV
Copying ModernDev Files
c:\dl\onprem\25.0.23364.24652\platform
c:\dl\onprem\25.0.23364.24652\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\25.0.23364.24652\platform\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\25.0.23364.24652\platform\Test Assemblies
Copying Applications
C:\dl\onprem\25.0.23364.24652\at\Applications
Copying dependencies
Importing PowerShell Modules
Skipping restore of Cronus database
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Installation took 11 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.1.121 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.1.121 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)
Setting host.containerhelper.internal to 172.28.16.1 in container hosts file
Starting Container
Hostname is MB25DEV
PublicDnsName is MB25DEV
WARNING: Container starts with TimeZone = Mitteleuropäische Zeit, which is not recognized in the list of TimeZones.
Using NavUserPassword Authentication
Using Database .bak file 'C:\ProgramData\BcContainerHelper\Database\MBAT25DEV_Docker_2024-10-08.bak'
Using database server localhost\SQLEXPRESS
Setting CompatibilityLevel for mydatabase on localhost\SQLEXPRESS
Creating Self Signed Certificate
Self Signed Certificate Thumbprint B83FBDA4212EB269756F24A37588D346283EE0AC
DNS identity MB25DEV
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
Using license file 'c:\run\my\license.bclicense'
Import License
Creating http download site
Setting SA Password and enabling SA
Creating admin as SQL User and add to sysadmin
Container IP Address: 172.28.17.29
Container Hostname  : MB25DEV
Container Dns Name  : MB25DEV
Web Client          : http://MB25DEV/BC/
Dev. Server         : http://MB25DEV
Dev. ServerInstance : BC
Setting MB25DEV to 172.28.17.29 in host hosts file

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

Container Total Physical Memory is 8.5Gb
Container Free Physical Memory is 3.8Gb

Initialization took 144 seconds
Ready for connections!
Reading CustomSettings.config from MB25DEV
Creating Desktop Shortcuts for MB25DEV
Cleanup old dotnet core assemblies
Container MB25DEV successfully created

Screenshots Image

similar-issues-ai[bot] commented 2 days ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

freddydk commented 2 days ago

Could you share the container creation on the working Windows 10 machine in order to see the difference?

On the host, in a command prompt - can you:

ping mb25dev

Is c:\windows\system32\etc\drivers\hosts updated with a line for mb25dev?

freddydk commented 2 days ago

Is there any difference if you use a container name with only lowercase characters?