microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
718 stars 242 forks source link

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

Open lippertmarkus opened 1 month ago

lippertmarkus commented 1 month ago

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:

Final Checklist

Please remember to do the following:

lippertmarkus commented 1 month ago

@freddydk might be relevant for you as well

lippertmarkus commented 1 month ago

Also happens for BC 24.1.18927.19498

SBalslev commented 1 month ago

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

SBalslev commented 1 month ago

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.

lippertmarkus commented 1 month ago

@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 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 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 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: 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: -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 Building 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 Building image took 1405 seconds ```

No changes to the error for any newly built images.

joandrsn commented 18 hours ago

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