AL icon indicating copy to clipboard operation
AL copied to clipboard

[BC 24] `Publish-NAVApp` hangs forever on compilation errors

Open lippertmarkus opened this issue 1 year ago • 17 comments

Please include the following with each issue:

1. Describe the bug Starting with BC24 Publish-NAVApp no longer shows an error when extension compilation fails but instead hangs forever.

2. To Reproduce Steps to reproduce the behavior:

  1. Setup a BC24 container (I used sandbox-24.0.16410.18981-de)
  2. Publish an app that has a dependency that isn't published yet:
  3. Observe that Publish-NAVApp hangs forever
    PS > Publish-NAVApp -ServerInstance BC -Path C:\azurefileshare\ccr.app -SkipVerification
    # ... hangs forever ...
    
  4. Compare that with a BC23 container (I used sandbox-23.5.16502.19504-w1) which shows the error immediately:
    PS > Publish-NAVApp -ServerInstance BC -Path C:\azurefileshare\ccr.app -SkipVerification
    
    # Publish-NAVApp : Extension compilation failed
    # error AL1024: A package with publisher 'xxx', name 'xxx', and a version compatible with '2.1.0.0' 
    # could not be loaded. Symbols for the requested app xxx by xxx  
    # 2.1.0.0 could not be found in the database.
    

Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.

3. Expected behavior Publish-NAVApp should return an error like it did for BC 23.5

4. Actual behavior Publish-NAVApp hangs forever

5. Versions:

  • AL Language: N/A
  • Visual Studio Code: N/A
  • Business Central: 24.0.16410.18981
  • List of Visual Studio Code extensions that you have installed: N/A

Final Checklist

Please remember to do the following:

  • [x] Search the issue repository to ensure you are reporting a new issue

  • [x] Reproduce the issue after disabling all extensions except the AL Language extension

  • [x] Simplify your code around the issue to better isolate the problem

lippertmarkus avatar May 15 '24 14:05 lippertmarkus

@freddydk might be relevant for you as well

lippertmarkus avatar May 15 '24 14:05 lippertmarkus

Also happens for BC 24.1.18927.19498

lippertmarkus avatar May 21 '24 10:05 lippertmarkus

@lippertmarkus do you have event log entries and other details from the container that might help us?

SBalslev avatar May 23 '24 07:05 SBalslev

if you can please also test platform 24.0.19840.0 or never. We found a timeout issue and the fix is being rolled out as we speak.

SBalslev avatar May 23 '24 14:05 SBalslev

@lippertmarkus do you have event log entries and other details from the container that might help us?

@SBalslev The container event log correctly shows the "missing dependency" error but this error isn't returned to Publish-NAVApp:

Event Log
Initialization took 263 seconds
Ready for connections!
Starting EventLog Monitor
Monitoring EventSources from EventLog[Application]:
- MicrosoftDynamicsNAVClientClientService
- MicrosoftDynamicsNAVClientWebClient
- MicrosoftDynamicsNavServer$BC
- MSSQL$SQLEXPRESS

TimeGenerated : 05/28/2024 14:55:23
EventSource: MicrosoftDynamicsNavServer$BC
EntryType : Warning
Message : 
Server instance: BC
Category: Extensions
ClientSessionId: 00000000-0000-0000-0000-000000000000
ClientActivityId: 00000000-0000-0000-0000-000000000000
ServerSessionUniqueId: 2b5607ab-89fb-4bbd-b8e7-d8c6f7f7d2a9
ServerActivityId: de776aae-11cb-4a2a-a36d-f933ffda67c6
EventTime: 05/28/2024 14:55:23
Message <redacted>
ProcessId: 27520
Tag: 0000I1D
ThreadId: 30
CounterInformation: 
CustomParameters: {
}
GatewayCorrelationId: 

TimeGenerated : 05/28/2024 14:55:23
EventSource: MicrosoftDynamicsNavServer$BC
EntryType : Warning
Message : 
Server instance: BC
Category: Extensions
ClientSessionId: 00000000-0000-0000-0000-000000000000
ClientActivityId: 00000000-0000-0000-0000-000000000000
ServerSessionUniqueId: 2b5607ab-89fb-4bbd-b8e7-d8c6f7f7d2a9
ServerActivityId: de776aae-11cb-4a2a-a36d-f933ffda67c6
EventTime: 05/28/2024 14:55:23
Message <redacted>
ProcessId: 27520
Tag: 0000I1D
ThreadId: 30
CounterInformation: 
CustomParameters: {
}
GatewayCorrelationId: 

TimeGenerated : 05/28/2024 14:55:23
EventSource: MicrosoftDynamicsNavServer$BC
EntryType : Warning
Message : 
Server instance: BC
Category: Extensions
ClientSessionId: 00000000-0000-0000-0000-000000000000
ClientActivityId: 00000000-0000-0000-0000-000000000000
ServerSessionUniqueId: 2b5607ab-89fb-4bbd-b8e7-d8c6f7f7d2a9
ServerActivityId: de776aae-11cb-4a2a-a36d-f933ffda67c6
EventTime: 05/28/2024 14:55:23
Message Failed to load metadata using NavAppLatestSymbolReferenceLoader for app with ID '551d85cb-2152-4144-9464-a16791aff492' and version '2.1.0.0'. Unable to query for secondary dependencies.
ProcessId: 27520
Tag: 0000GFR
ThreadId: 30
CounterInformation: 
CustomParameters: {
}
GatewayCorrelationId: 

TimeGenerated : 05/28/2024 14:55:23
EventSource: MicrosoftDynamicsNavServer$BC
EntryType : Warning
Message : 
Server instance: BC
Category: Extensions
ClientSessionId: 00000000-0000-0000-0000-000000000000
ClientActivityId: 00000000-0000-0000-0000-000000000000
ServerSessionUniqueId: 2b5607ab-89fb-4bbd-b8e7-d8c6f7f7d2a9
ServerActivityId: de776aae-11cb-4a2a-a36d-f933ffda67c6
EventTime: 05/28/2024 14:55:23
Message Failed to load metadata using NavAppLatestSymbolReferenceLoader for app with ID 'ffa26420-b880-4d49-9b2c-c3e60c86b914' and version '2.14.0.0'. Unable to query for secondary dependencies.
ProcessId: 27520
Tag: 0000GFR
ThreadId: 30
CounterInformation: 
CustomParameters: {
}
GatewayCorrelationId: 

TimeGenerated : 05/28/2024 14:55:23
EventSource: MicrosoftDynamicsNavServer$BC
EntryType : Warning
Message : 
Server instance: BC
Category: Extensions
ClientSessionId: 00000000-0000-0000-0000-000000000000
ClientActivityId: 00000000-0000-0000-0000-000000000000
ServerSessionUniqueId: 2b5607ab-89fb-4bbd-b8e7-d8c6f7f7d2a9
ServerActivityId: de776aae-11cb-4a2a-a36d-f933ffda67c6
EventTime: 05/28/2024 14:55:23
Message Failed to load metadata using NavAppLatestSymbolReferenceLoader for app with ID '551d85cb-2152-4144-9464-a16791aff492' and version '2.1.0.0'. Unable to query for secondary dependencies.
ProcessId: 27520
Tag: 0000GFR
ThreadId: 30
CounterInformation: 
CustomParameters: {
}
GatewayCorrelationId: 

TimeGenerated : 05/28/2024 14:55:23
EventSource: MicrosoftDynamicsNavServer$BC
EntryType : Warning
Message : 
Server instance: BC
Category: Extensions
ClientSessionId: 00000000-0000-0000-0000-000000000000
ClientActivityId: 00000000-0000-0000-0000-000000000000
ServerSessionUniqueId: 2b5607ab-89fb-4bbd-b8e7-d8c6f7f7d2a9
ServerActivityId: de776aae-11cb-4a2a-a36d-f933ffda67c6
EventTime: 05/28/2024 14:55:23
Message Failed to load metadata using NavAppLatestSymbolReferenceLoader for app with ID 'ffa26420-b880-4d49-9b2c-c3e60c86b914' and version '2.14.0.0'. Unable to query for secondary dependencies.
ProcessId: 27520
Tag: 0000GFR
ThreadId: 30
CounterInformation: 
CustomParameters: {
}
GatewayCorrelationId: 

TimeGenerated : 05/28/2024 14:55:26
EventSource: MicrosoftDynamicsNavServer$BC
EntryType : Error
Message : 
Server instance: BC
Category: Extensions
ClientSessionId: 00000000-0000-0000-0000-000000000000
ClientActivityId: 00000000-0000-0000-0000-000000000000
ServerSessionUniqueId: 2b5607ab-89fb-4bbd-b8e7-d8c6f7f7d2a9
ServerActivityId: de776aae-11cb-4a2a-a36d-f933ffda67c6
EventTime: 05/28/2024 14:55:26
Message Extension compilation failed
<missing dependency error details>
ProcessId: 27520
Tag: 00001YW
ThreadId: 30
CounterInformation: 
CustomParameters: {
}
GatewayCorrelationId: 

if you can please also test platform 24.0.19840.0 or never. We found a timeout issue and the fix is being rolled out as we speak.

Is the platform artifact already available? I always get platform 24.1.18927.20080 with New-BcImage:

New-BcImage log
BcContainerHelper version 6.0.17
BC.HelperFunctions emits usage statistics telemetry to Microsoft
Running on Windows, PowerShell 5.1.20348.2400
Getting artifact url
Get-BCArtifactUrl -StorageAccount: bcartifacts -Select: latest -Version: 24 -Type: sandbox -Country: de
Setting '24.1.18927.20080' as version.
Setting 'sandbox-24.1.18927.20080-de' as tag.
Using artifact url: https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/24.1.18927.20080/de
Starting image build: <image>
New-BCImage -includePerformanceToolkit: True -includeTestToolkit: True -baseImage: mcr.microsoft.com/businesscentral:ltsc2022 -memory: 10G -artifactUrl: https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/24.1.18927.20080/de -imageName: <imageName> -includeTestLibrariesOnly: True
Downloading artifact /sandbox/24.1.18927.20080/de
Downloading C:\Users\ContainerAdministrator\AppData\Local\Temp\0e7a5f16-1e71-4ac4-b399-fb402c43da5d.zip
Unpacking artifact to tmp folder using 7zip
Downloading platform artifact /sandbox/24.1.18927.20080/platform
Downloading C:\Users\ContainerAdministrator\AppData\Local\Temp\1734181f-3483-405e-b437-b7063eb7c22c.zip
Unpacking artifact to tmp folder using 7zip
Downloading Prerequisite Components
Downloading c:\bcartifacts.cache\sandbox\24.1.18927.20080\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi
Downloading c:\bcartifacts.cache\sandbox\24.1.18927.20080\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe
<image>
Building image <image> based on mcr.microsoft.com/businesscentral:ltsc2022 with https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/24.1.18927.20080/de
Pulling latest image mcr.microsoft.com/businesscentral:ltsc2022
ltsc2022: Pulling from businesscentral
Digest: sha256:41294a2c7ad03f8bbcd6f30384525d644f76b08681c9185a522b39c1b08b40a5
Status: Image is up to date for mcr.microsoft.com/businesscentral:ltsc2022
mcr.microsoft.com/businesscentral:ltsc2022
Generic Tag: 1.0.2.23
Container OS Version: 10.0.20348.2461 (ltsc2022)
Host OS Version: 10.0.20348.2402 (ltsc2022)
WARNING: Container and host OS build is 20348 or above, defaulting to process isolation. If you encounter issues, you could try to install HyperV.
Using process isolation
Files in c:\bcartifacts.cache\b3tzbmzu.a3g\my:
Copying Platform Artifacts
c:\bcartifacts.cache\sandbox\24.1.18927.20080\platform
Copying Database
Copying Licensefile
Copying ConfigurationPackages
C:\bcartifacts.cache\sandbox\24.1.18927.20080\de\ConfigurationPackages
Copying Extensions
C:\bcartifacts.cache\sandbox\24.1.18927.20080\de\Extensions
Copying Applications.DE
C:\bcartifacts.cache\sandbox\24.1.18927.20080\de\Applications.DE
c:\bcartifacts.cache\b3tzbmzu.a3g
Sending build context to Docker daemon  2.765GB

Step 1/6 : FROM mcr.microsoft.com/businesscentral:ltsc2022
---> 1e2ee26c4e8d
Step 2/6 : ENV DatabaseServer=localhost DatabaseInstance=SQLEXPRESS DatabaseName=CRONUS IsBcSandbox=Y artifactUrl=https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/24.1.18927.20080/de filesOnly=False
---> Running in e9511b66d87b
Removing intermediate container e9511b66d87b
---> 61b39ff32da6
Step 3/6 : COPY my /run/
---> 89dabc907cf9
Step 4/6 : COPY NAVDVD /NAVDVD/
---> b893d95422e6
Step 5/6 : RUN \Run\start.ps1 -installOnly -multitenant -includeTestToolkit -includeTestLibrariesOnly -includePerformanceToolkit
---> Running in d353a20f93e3
c:\run\my folder doesn't exist, creating it
Using DVD installer from C:\Run\240
Installing Business Central: multitenant=True, installOnly=True, filesOnly=False, includeTestToolkit=True, includeTestLibrariesOnly=True, includeTestFrameworkOnly=False, includePerformanceToolkit=True, appArtifactPath=, platformArtifactPath=, 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 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.DE
C:\NAVDVD\Applications.DE
Copying dependencies
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'
C:\Applications.DE\Microsoft_Permissions Mock_24.1.18927.20080.app
C:\Applications.DE\Microsoft_Test Runner_24.1.18927.20080.app
C:\Applications.DE\Microsoft_Any_24.1.18927.20080.app
C:\Applications.DE\Microsoft_Library Assert_24.1.18927.20080.app
C:\Applications.DE\Microsoft_Permissions Mock_24.1.18927.20080.app
C:\Applications.DE\Microsoft_Library Variable Storage_24.1.18927.20080.app
C:\Applications.DE\Microsoft_System Application Test Library_24.1.18927.20080.app
C:\Applications.DE\Microsoft_Business Foundation Test Libraries_24.1.18927.20080.app
C:\Applications.DE\Microsoft_Tests-TestLibraries_24.1.18927.20080.app
C:\Applications.DE\Microsoft_Performance Toolkit_24.1.18927.20080.app
C:\Applications.DE\Microsoft_Performance Toolkit Samples_24.1.18927.20080.app
C:\Applications.DE\Microsoft_Performance Toolkit Tests_24.1.18927.20080.app
Starting Business Central Service Tier
Importing CRONUS 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
Permissions Mock is already published
Synchronizing Permissions Mock
Installing Permissions Mock
Test Runner is already published
Synchronizing Test Runner
Installing Test Runner
Any is already published
Synchronizing Any
Installing Any
Library Assert is already published
Synchronizing Library Assert
Installing Library Assert
Skipping Permissions Mock as it is already installed
Library Variable Storage is already published
Synchronizing Library Variable Storage
Installing Library Variable Storage
Publishing C:\Applications.DE\Microsoft_System Application Test Library_24.1.18927.20080.app
Synchronizing System Application Test Library
Installing System Application Test Library
Publishing C:\Applications.DE\Microsoft_Business Foundation Test Libraries_24.1.18927.20080.app
Synchronizing Business Foundation Test Libraries
Installing Business Foundation Test Libraries
Publishing C:\Applications.DE\Microsoft_Tests-TestLibraries_24.1.18927.20080.app
Synchronizing Tests-TestLibraries
Installing Tests-TestLibraries
Performance Toolkit is already published
Synchronizing Performance Toolkit
Installing Performance Toolkit
Publishing C:\Applications.DE\Microsoft_Performance Toolkit Samples_24.1.18927.20080.app
Synchronizing Performance Toolkit Samples
Installing Performance Toolkit Samples
Publishing C:\Applications.DE\Microsoft_Performance Toolkit Tests_24.1.18927.20080.app
Synchronizing Performance Toolkit Tests
Installing Performance Toolkit Tests
Stopping Business Central Service Tier
Installation took 411 seconds
Installation complete
Removing intermediate container d353a20f93e3
---> f5883a252289
Step 6/6 : LABEL legal="http://go.microsoft.com/fwlink/?LinkId=837447"       created="202405281410"       nav=""       cu=""       multitenant="Y"       country="DE"       version="24.1.18927.20080"       platform="24.0.20056.0"
---> Running in 452117cb7815
Removing intermediate container 452117cb7815
---> f74e46886b4d
Successfully built f74e46886b4d
Successfully tagged <image>
Building image took 1405 seconds

No changes to the error for any newly built images.

lippertmarkus avatar May 28 '24 15:05 lippertmarkus

Just to say, we also experienced this on 24.2 OnPrem. Our pipeline hanged for 22 hours because it just waits forever (Only stopped since we cancelled the build): image

joandrsn avatar Jul 04 '24 08:07 joandrsn

@SBalslev Is it possible you'd overlooked Markus' reply? Or do you really need further input, and if so: which?

NKarolak avatar Jul 18 '24 07:07 NKarolak

@SBalslev it still happens in the newest CU, do you have an update for us or need more information?

lippertmarkus avatar Jul 23 '24 08:07 lippertmarkus

Lost track of this one, did anyone try the latest release?

SBalslev avatar Aug 20 '24 06:08 SBalslev

@lippertmarkus have you tried it on any of the latest builds? also do you experience the same issue if the server is installed outside of a container?

would you also attach the events?

I will try to repro and get back to you.

PooyaKharamesh avatar Aug 20 '24 06:08 PooyaKharamesh

I just tried on sandbox-24.4.22295.23050-us and it still happens. Although it seems that for some extensions it doesn't hang (maybe BC24 has an issue with install codeunits?). I haven't tried outside of a container as I'm working with containers only.

Here's the container and event logs: logs.zip

If you send me a private message I can send you the app file if needed.

lippertmarkus avatar Aug 20 '24 09:08 lippertmarkus

@lippertmarkus - are you running Powershell 7 or Powershell 5 inside the container? Could you try the other?

freddydk avatar Aug 26 '24 19:08 freddydk

@freddydk you're right, it always shows the errors correctly with PS7 but with PS5 it only shows the errors for some apps but not for the others. Is that something you can fix?

lippertmarkus avatar Aug 27 '24 14:08 lippertmarkus

It isn't something I can fix, but I think the server team will look at the bug.

Just be aware, that you very soon have to shift to PS7 anyway: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/upgrade/deprecated-features-platform#support-for-powershell-50-removal

When we start shipping v26, the bridge will likely be removed quickly.

freddydk avatar Aug 28 '24 09:08 freddydk

@freddydk Did you get feedback from the server team? Did you start moving the base image to PS7?

lippertmarkus avatar Sep 23 '24 07:09 lippertmarkus

Problem still exists in BC25 @freddydk @SBalslev any updates on this topic?

PatrickSchiefer avatar Oct 01 '24 09:10 PatrickSchiefer

Faced the same problem today with BC 25.3 OnPrem. The release pipeline hangs. An attemp to publish the app manually using PowerShell (version 5 is installed) on customer's server hangs. Is installing PowerShell 7 a solution?

yurim108 avatar Feb 12 '25 10:02 yurim108