microsoft / navcontainerhelper

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

Pictures not shown in Word based report preview/pdf in version 21.0 #2753

Closed ninten closed 2 years ago

ninten commented 2 years ago

On a version 21.0 container, when I use the "Preview" or "Send to... PDF" buttons on a report with a Word based layout, the pictures (both database and embedded in the Word layout) are not shown. It works when we use "Send to... Microsoft Word Document", or when we use a RDLC layout based report.

I'm wondering if this is a container issue because we're not getting this problem in the SAAS version of BC.

Scripts used to create container and cause the issue

$artifactUrl = "https://bcartifacts.azureedge.net/sandbox/21.0.46256.47234/ca"
$credential = New-Object pscredential 'xxxxxx', (ConvertTo-SecureString -String 'yyyyyy' -AsPlainText -Force)
$containerName = "sandbox210ca"
$license = 'C:\License21.flf'

New-BcContainer -accept_eula -assignPremiumPlan -containerName $containerName -artifactUrl $artifactUrl -Credential $credential -auth UserPassword -licenseFile $license -updateHosts -includeTestToolkit -includeTestLibrariesOnly -isolation hyperv

Full output of scripts

BcContainerHelper is version 1.0.16
BcContainerHelper is not running as administrator
Host is Microsoft Windows 11 Pro - Unknown/Insider build
Docker Client Version is 20.10.8
Docker Server Version is 20.10.8
Downloading application artifact /sandbox/21.0.46256.47234/ca
Downloading C:\Users\xxxx\AppData\Local\Temp\e20550ed-7f2d-43cb-9ea4-4b69557225d0.zip
Unpacking application artifact to tmp folder using 7zip
Downloading platform artifact /sandbox/21.0.46256.47234/platform
Downloading C:\Users\xxxx\AppData\Local\Temp\bb0fbc7b-13a9-4925-9a3a-5b17a908965b.zip
Unpacking platform artifact to tmp folder using 7zip
Downloading Prerequisite Components
Downloading c:\bcartifacts.cache\sandbox\21.0.46256.47234\platform\Prerequisite Components\Open XML SDK 2.5 for Microsoft Office\OpenXMLSDKv25.msi
Downloading c:\bcartifacts.cache\sandbox\21.0.46256.47234\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi
Downloading c:\bcartifacts.cache\sandbox\21.0.46256.47234\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe
Fetching all docker images
Using image mcr.microsoft.com/businesscentral:10.0.20348.1129
Creating Container sandbox210ca
Version: 21.0.46256.47234-CA
Style: sandbox
Multitenant: Yes
Platform: 21.0.46384.47190
Generic Tag: 1.0.2.13
Container OS Version: 10.0.20348.1129 (unknown)
Host OS Version: 10.0.22000.1098 (Unknown/Insider build)
Using hyperv isolation
Using locale en-CA
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\License21.flf
Files in C:\ProgramData\BcContainerHelper\Extensions\sandbox210ca\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupNavUsers.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container sandbox210ca from image mcr.microsoft.com/businesscentral:10.0.20348.1129
3b9c5715318e6270d80045b1f833336c6fa12def401caa7b34624d148527fa6a
Waiting for container sandbox210ca to be ready
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/21.0.46256.47234/ca
Using installer from C:\Run\210-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
c:\dl\sandbox\21.0.46256.47234\platform\ServiceTier\Program Files
c:\dl\sandbox\21.0.46256.47234\platform\ServiceTier\System64Folder
Copying PowerShell Scripts
c:\dl\sandbox\21.0.46256.47234\platform\WindowsPowerShellScripts\Cloud\NAVAdministration
c:\dl\sandbox\21.0.46256.47234\platform\WindowsPowerShellScripts\WebSearch
Copying Web Client Files
c:\dl\sandbox\21.0.46256.47234\platform\WebClient\Microsoft Dynamics NAV
Copying ModernDev Files
c:\dl\sandbox\21.0.46256.47234\platform
c:\dl\sandbox\21.0.46256.47234\platform\ModernDev\program files\Microsoft Dynamics NAV
Copying additional files
Copying ConfigurationPackages
C:\dl\sandbox\21.0.46256.47234\ca\ConfigurationPackages
Copying Test Assemblies
C:\dl\sandbox\21.0.46256.47234\platform\Test Assemblies
Copying Extensions
C:\dl\sandbox\21.0.46256.47234\ca\Extensions
Copying Applications
C:\dl\sandbox\21.0.46256.47234\platform\Applications
Copying Applications.CA
C:\dl\sandbox\21.0.46256.47234\ca\Applications.CA
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Restoring CRONUS Demo Database
Setting CompatibilityLevel for tenant on localhost\SQLEXPRESS
Exporting Application to CRONUS
Removing Application from tenant
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Starting Business Central Service Tier
Importing license file
Copying Database on localhost\SQLEXPRESS from tenant to default
Taking database tenant offline
Copying database files
Attaching files as new Database default
Putting database tenant back online
Mounting tenant database
Mounting Database for default on server localhost\SQLEXPRESS with AllowAppDatabaseWrite = False
Sync'ing Tenant
Tenant is Operational
Stopping Business Central Service Tier
Installation took 226 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.102.56 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.102.56 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.25.192.1 in container hosts file
Starting Container
Hostname is sandbox210ca
PublicDnsName is sandbox210ca
WARNING: Container starts with TimeZone = Hora estándar romance, which is not recognized in the list of TimeZones.
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint FBC148B9B2A80DFDADB51A05BA2542595DAEA1E3
DNS identity sandbox210ca
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
Using license file 'c:\run\my\license.flf'
Import License
Dismounting Tenant
Mounting Tenant
Mounting Database for default on server localhost\SQLEXPRESS with AllowAppDatabaseWrite = False
Sync'ing Tenant
Tenant is Operational
Creating http download site
Setting SA Password and enabling SA
Creating bcuser as SQL User and add to sysadmin
Creating SUPER user
WARNING: The password that you entered does not meet the minimum requirements. 
It should be at least 8 characters long and contain at least one uppercase 
letter, one lowercase letter, and one number.
Assign Premium plan for BCUSER
Container IP Address: 172.25.192.195
Container Hostname  : sandbox210ca
Container Dns Name  : sandbox210ca
Web Client          : http://sandbox210ca/BC/?tenant=default
Dev. Server         : http://sandbox210ca
Dev. ServerInstance : BC
Dev. Server Tenant  : default
Setting sandbox210ca to 172.25.192.195 in host hosts file
Setting sandbox210ca-default to 172.25.192.195 in host hosts file

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

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

Initialization took 50 seconds
Ready for connections!
Reading CustomSettings.config from sandbox210ca
Creating Desktop Shortcuts for sandbox210ca
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
Synchronizing Permissions Mock on default
App successfully synchronized
Installing Permissions Mock on default
App successfully installed
Synchronizing Library Variable Storage on default
App successfully synchronized
Installing Library Variable Storage on default
App successfully installed
Synchronizing Test Runner on default
App successfully synchronized
Installing Test Runner on default
App successfully installed
Copy from container sandbox210ca (C:\Applications.CA\Microsoft_System Application Test Library_21.0.46256.47234.app) to C:\ProgramData\BcContainerHelper\Extensions\sandbox210ca\_Microsoft_Sys
tem Application Test Library_21.0.46256.47234.app
Publishing C:\ProgramData\BcContainerHelper\Extensions\sandbox210ca\_Microsoft_System Application Test Library_21.0.46256.47234.app
Synchronizing System Application Test Library on tenant default
Installing System Application Test Library on tenant default
App successfully published
Copy from container sandbox210ca (C:\Applications.CA\Microsoft_Tests-TestLibraries_21.0.46256.47234.app) to C:\ProgramData\BcContainerHelper\Extensions\sandbox210ca\_Microsoft_Tests-TestLibra
ries_21.0.46256.47234.app
Publishing C:\ProgramData\BcContainerHelper\Extensions\sandbox210ca\_Microsoft_Tests-TestLibraries_21.0.46256.47234.app
Synchronizing Tests-TestLibraries on tenant default
Installing Tests-TestLibraries on tenant default
App successfully published
TestToolkit successfully imported
Container sandbox210ca successfully created

Screenshots Report 1304 "Sales - Quote", layout "./StandardSalesQuote.docx", the preview/PDF version doesn't show the company picture:

image

But we can see the picture when we export it to Word:

image

Additional context

This is the first time we get this issue, and we have tried a mix of onprem/sandbox and different countries. It has failed with the following artifacts:

https://bcartifacts.azureedge.net/onprem/21.0.46256.46853/es https://bcartifacts.azureedge.net/onprem/21.0.46256.46853/us https://bcartifacts.azureedge.net/sandbox/21.0.46256.48257/es https://bcartifacts.azureedge.net/sandbox/21.0.46256.47234/ca

While it does work in the SAAS version of our customer: CA Business Central 21.0 (Platform 21.0.46384.48092 + Application 21.0.46256.46853)

And it works too if we go back to a previous version like: https://bcartifacts.azureedge.net/onprem/20.6.47024.0/es

freddydk commented 2 years ago

Have you tried using -usessl (just a longshot).

ninten commented 2 years ago

Have you tried using -usessl (just a longshot).

I've just created a new container with -usessl and I'm getting the same issue.

freddydk commented 2 years ago

I can definitely repro this, but I don't think this is related to BcContainerHelper or docker at all. I can file a bug on the platform team to get this resolved - but I will not be able to follow up and respond back here on this. You can also file the bug to support yourself and with that get direct feedback and communication with somebody.

You decide.

ninten commented 2 years ago

Alright, I just wanted to consider every possibility, because regular SAAS BC21 works properly. I'll file the bug myself, thanks a lot!

freddydk commented 2 years ago

Thanks

It might be that the scenario only repros in containers, but if the bug is in the platform - the fix needs to be there. You can link to this issue in the error report and state that we do not think that this is a docker problem.

ninten commented 2 years ago

Just in case someone stumbles upon this, it was indeed a platform bug and it has been fixed in the version 21.1 on their side.