Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker with Traefik: odata.context URL are not correct #2137

Closed
DanielGoehler opened this issue Oct 15, 2021 · 2 comments
Closed

Docker with Traefik: odata.context URL are not correct #2137

DanielGoehler opened this issue Oct 15, 2021 · 2 comments
Assignees

Comments

@DanielGoehler
Copy link
Contributor

Describe the issue
If the container was created with -useTraefik, the API odata.context URL is not correct. It should read

This is a problem if the other application needs to use odata.mediaEditLink or odata.mediaReadLink to upload or download BLOBs and MediaSet fields. (e.g. https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v1.0/resources/dynamics_picture#properties)

Scripts used to create container and cause the issue

New-NavContainer `
-accept_eula `
-alwaysPull `
-updateHosts `
-containername test `
-artifactUrl "https://bcartifacts.azureedge.net/onprem/19.0.29894.30693/de" `
-PublicDnsName dockerhub.company.com `
-useTraefik `
-shortcuts None `
-auth NavUserPassword `
-licenseFile "C:\ProgramData\dockerLicenseFiles\bc.flf"

Full output of scripts

BcContainerHelper is version 2.0.15
BcContainerHelper is running as administrator
Host is Microsoft Windows Server 2019 Standard - ltsc2019
Docker Client Version is 19.03.5
Docker Server Version is 19.03.5
Fetching all docker images
Fetching all docker volumes
Enabling SSL as otherwise all clients will see mixed HTTP / HTTPS request, which will cause problems e.g. on the mobile and modern windows clients
Pulling image mcr.microsoft.com/businesscentral:10.0.17763.2237
10.0.17763.2237: Pulling from businesscentral
Using image mcr.microsoft.com/businesscentral:10.0.17763.2237
PublicDnsName is dockerhub.company.com
Creating Container test
Version: 19.0.29894.30693-de
Style: onprem
Multitenant: No
Platform: 19.0.29884.30666
Generic Tag: 1.0.1.8
Container OS Version: 10.0.17763.2237 (ltsc2019)
Host OS Version: 10.0.17763.2237 (ltsc2019)
Using process isolation
Using locale de-DE
Adding special CheckHealth.ps1 to enable Traefik support
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\ProgramData\prisma\dockerLicenseFiles\aaa_prisma_BC.flf
Additional Parameters:
-e webserverinstance=test
-e publicdnsname=dockerhub.company.com
-l "traefik.protocol=https"
-l "traefik.web.frontend.rule=PathPrefix:/test"
-l "traefik.web.port=443"
-l "traefik.soap.frontend.rule=PathPrefix:/testsoap;ReplacePathRegex: ^/testsoap(.*) /BC$1"
-l "traefik.soap.port=7047"
-l "traefik.rest.frontend.rule=PathPrefix:/testrest;ReplacePathRegex: ^/testrest(.*) /BC$1"
-l "traefik.rest.port=7048"
-l "traefik.dev.frontend.rule=PathPrefix:/testdev;ReplacePathRegex: ^/testdev(.*) /BC$1"
-l "traefik.dev.port=7049"
-l "traefik.snap.frontend.rule=PathPrefix:/testsnap;ReplacePathRegex: ^/testsnap(.*) /BC$1"
-l "traefik.snap.port=7083"
-l "traefik.dl.frontend.rule=PathPrefixStrip:/testdl"
-l "traefik.dl.port=8080"
-l "traefik.dl.protocol=http"
-l "traefik.enable=true"
-l "traefik.frontend.entryPoints=https"
--env customNavSettings=PublicODataBaseUrl=https://dockerhub.company.com/testrest/odata,PublicSOAPBaseUrl=https://dockerhub.company.com/testsoap/ws,PublicWebBaseUrl=https://dockerhub.company.com/test
Files in C:\ProgramData\BcContainerHelper\Extensions\test\my:
- AdditionalOutput.ps1
- CheckHealth.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container test from image mcr.microsoft.com/businesscentral:10.0.17763.2237
da7795678235fffe2ad195918c65a4e0796aed86dd82dcc018ad9c17b9273b7e
Waiting for container test to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/19.0.29894.30693/de
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\onprem\19.0.29894.30693\platform\ServiceTier\Program Files
c:\dl\onprem\19.0.29894.30693\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\onprem\19.0.29894.30693\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\onprem\19.0.29894.30693\platform\WindowsPowerShellScripts\WebSearch
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\onprem\19.0.29894.30693\de\database\Demo Database BC (19-0).bak
Changing Database Server Collation to Latin1_General_100_CI_AS
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'
Copying Web Client Files
c:\dl\onprem\19.0.29894.30693\platform\WebClient\Microsoft Dynamics NAV
Copying Client Files
c:\dl\onprem\19.0.29894.30693\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\19.0.29894.30693\platform\LegacyDlls\program files\Microsoft Dynamics NAV
c:\dl\onprem\19.0.29894.30693\platform\LegacyDlls\systemFolder
Copying ModernDev Files
c:\dl\onprem\19.0.29894.30693\platform
c:\dl\onprem\19.0.29894.30693\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\onprem\19.0.29894.30693\de\ConfigurationPackages
Copying Test Assemblies
C:\dl\onprem\19.0.29894.30693\platform\Test Assemblies
Copying Applications
C:\dl\onprem\19.0.29894.30693\de\Applications
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 124 seconds
Installation complete
Initializing...
Setting host.containerhelper.internal to 172.17.96.1 in container hosts file
Starting Container
Hostname is test
PublicDnsName is dockerhub.company.com
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 89A244F7728260F60E48E5EC396BD329C671F7A5
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting PublicODataBaseUrl to https://dockerhub.company.com/testrest/odata
Setting PublicSOAPBaseUrl to https://dockerhub.company.com/testsoap/ws
Setting PublicWebBaseUrl to https://dockerhub.company.com/test
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 admin 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: 172.17.109.131
Container Hostname  : test
Container Dns Name  : dockerhub.company.com
Web Client          : https://dockerhub.company.com/test/
Dev. Server         : https://dockerhub.company.com
Dev. ServerInstance : BC
Setting test to 172.17.109.131 in host hosts file

Files:
http://dockerhub.company.com:8080/ALLanguage.vsix
http://dockerhub.company.com:8080/certificate.cer

Container Total Physical Memory is 255.9Gb
Container Free Physical Memory is 24.3Gb

Initialization took 39 seconds
Ready for connections!
Reading CustomSettings.config from test
Container test successfully created
Because of Traefik, the following URLs need to be used when accessing the container from outside your Docker host:
Web Client:        https://dockerhub.company.com/test
SOAP WebServices:  https://dockerhub.company.com/testsoap
OData WebServices: https://dockerhub.company.com/testrest
Dev Service:       https://dockerhub.company.com/testdev
Snapshot Service:  https://dockerhub.company.com/testsnap
File downloads:    https://dockerhub.company.com/testdl

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

We are having the same issue. Is this URL constructed by using the ServiceTier? If so why? Why isn't the ODataBaseUrl used here?

@freddydk
Copy link
Contributor

freddydk commented May 6, 2023

This is a duplicate of #2595 - I will re-query the server team for a status and update that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants