AL icon indicating copy to clipboard operation
AL copied to clipboard

Error with RootException: NavAppDuplicateApiEndpointException while installing / uninstalling Apps on BC On-Prem v18.1.24822.26330

Open ManishKutar opened this issue 1 year ago • 1 comments

1. Describe the bug We have a scenario where Business Central On-Premises v18.1.24822.26330 has been installed with many extensions where some are dependent to each other. Now our concern is error while:

  1. Installing any new App (either via VS Code or via PowerShell command with Force).
  2. Uninstalling any existing App (via PowerShell command with Force or using Extension Management). The error we get is as below:

Server instance: PSEBCClient_UAT Category: Api EventTime: 02/18/2025 02:04:50 Message (NavAppDuplicateApiEndpointException): RootException: NavAppDuplicateApiEndpointException Multiple API web services with the path 'ServiceOrders/ServiceApp/beta/ServiceOrders' have been found for the application group 56. Query 50200, package <Package_ID>. CallerStackTrace: at Microsoft.Dynamics.Nav.Runtime.ApiWebServiceEntryHelper.GetEntriesFromNavApp(NavAppGroup group, HashSet1 paths) at Microsoft.Dynamics.Nav.Runtime.WebServiceHelper.GetApiWebServices(NavAppGroup group) at Microsoft.Dynamics.Nav.Service.Api.ApiRouteManager.ConfigureRoutes(NavAppGroup group) at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppGroupUpdater.ConfigureRoutes(NavAppGroup group) at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppGroupUpdater.PrepareAppGroup(NavAppGroup group) at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppInstaller.PrepareAllAppGroupsForInstallChain(NavAppInstallPreCheckHelper precheckResult) at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppInstaller.Install(NavSqlConnectionScope tenantDatabaseScope, NavSqlDatabaseLock tenantLock, NavAppInstallPreCheckHelper precheckResult, NavSession session, String name, NavTenant tenant, Boolean doNotLoadData, String activityId, Boolean enableDebugging) at Microsoft.Dynamics.Nav.Runtime.NavManagementTasks.<>c__DisplayClass26_1.<InstallNavApp>b__1(NavTenant tenant, NavSession session) at Microsoft.Dynamics.Nav.Runtime.NavTenant.Microsoft.Dynamics.Nav.Runtime.ITenantSessionHandler.RunTenantActionInSystemSessionWithoutTransaction(Action2 action, Boolean throwExceptions, Boolean useCurrentCulture, LanguageSetting language, NavCancellationToken cancellationToken) at Microsoft.Dynamics.Nav.Runtime.NavManagementTasks.<>c__DisplayClass26_0.b__0() at Microsoft.Dynamics.Nav.Runtime.NavManagementTasks.InstallNavApp(InstallNavAppArguments installNavAppArguments, Boolean async) at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppALInstaller.<>c__DisplayClass3_0.b__0() at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppDiagnosticSession.SendTraceTagOnFailure(Action operation, String additionalInfo, Func2 exceptionMap, String callerName) at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Dynamics.Nav.Runtime.NavDotNet.Invoke[T](String methodName, UInt32 methodIndex, BindingFlags flags, ParameterModifier modifier, Type[] referenceTypes, Object[] arguments) at Microsoft.Dynamics.Nav.Runtime.NavDotNet.InvokeMethod[T](Boolean isStatic, String methodName, UInt32 methodIndex, Object[] arguments) at Microsoft.Dynamics.Nav.Runtime.NavDotNet.InvokeMethod[T](String methodName, UInt32 methodIndex, Object[] arguments) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit2500.InstallExtensionSilently_Scope__2082688803.OnRun() in C:\ProgramData\Microsoft\Microsoft Dynamics NAV\180\Server\MicrosoftDynamicsNavServer$PSEBCClient_UAT\apps\metadata\3\D7\D776B1EF4D5096C646C3DB8EF6976D5BEEEBC2E920164847FBF5130A30C11208.cs:line 1062 at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run() at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit2500.InstallExtensionSilently(Guid packageID, Int32 lcid) in C:\ProgramData\Microsoft\Microsoft Dynamics NAV\180\Server\MicrosoftDynamicsNavServer$PSEBCClient_UAT\apps\metadata\3\D7\D776B1EF4D5096C646C3DB8EF6976D5BEEEBC2E920164847FBF5130A30C11208.cs:line 1000 at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit2500.InstallExtensionWithConfirmDialog_Scope_940601984.OnRun() in C:\ProgramData\Microsoft\Microsoft Dynamics NAV\180\Server\MicrosoftDynamicsNavServer$PSEBCClient_UAT\apps\metadata\3\D7\D776B1EF4D5096C646C3DB8EF6976D5BEEEBC2E920164847FBF5130A30C11208.cs:line 1189 at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run() at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit2500.InstallExtensionWithConfirmDialog(Guid packageId, Int32 lcid) in C:\ProgramData\Microsoft\Microsoft Dynamics NAV\180\Server\MicrosoftDynamicsNavServer$PSEBCClient_UAT\apps\metadata\3\D7\D776B1EF4D5096C646C3DB8EF6976D5BEEEBC2E920164847FBF5130A30C11208.cs:line 1081 at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit2500.OnInvoke(Int32 memberId, Object[] args) in C:\ProgramData\Microsoft\Microsoft Dynamics NAV\180\Server\MicrosoftDynamicsNavServer$PSEBCClient_UAT\apps\metadata\3\D7\D776B1EF4D5096C646C3DB8EF6976D5BEEEBC2E920164847FBF5130A30C11208.cs:line 121 at Microsoft.Dynamics.Nav.BusinessApplication.Page2501.Install_a45_OnAction_Scope.OnRun() in C:\ProgramData\Microsoft\Microsoft Dynamics NAV\180\Server\MicrosoftDynamicsNavServer$PSEBCClient_UAT\apps\metadata\3\01\014715F4674A9F8BEE66C1148C3D57908A06D29495F24188BF8339575D0BCC97.cs:line 511 at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run() at Microsoft.Dynamics.Nav.BusinessApplication.Page2501.Install_a45_OnAction() in C:\ProgramData\Microsoft\Microsoft Dynamics NAV\180\Server\MicrosoftDynamicsNavServer$PSEBCClient_UAT\apps\metadata\3\01\014715F4674A9F8BEE66C1148C3D57908A06D29495F24188BF8339575D0BCC97.cs:line 466 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(ITreeObject obj, String methodName, Object[] args, Boolean resolveHandler, Boolean throwOnNotFound) at Microsoft.Dynamics.Nav.Runtime.NavForm.RaiseOnAction(Nullable1 actionId, String actionTriggerMethodName) at Microsoft.Dynamics.Nav.Service.NSField.<>c__DisplayClass20_0.b__0(NsDataAccess recDataAccess) at Microsoft.Dynamics.Nav.Service.NsFormDataAccess.RunWithFormDataAccess[T](ITreeObject parent, NavForm form, Func2 func) at Microsoft.Dynamics.Nav.Service.NsDataAccess.RunWithDataAccess[T](ITreeObject parent, NavRecordState state, Boolean instantiateNewForm, Guid parentFormHandle, String parentControlName, Boolean& instantiatedForm, Func2 func) at Microsoft.Dynamics.Nav.Service.NsDataAccess.RunWithDataAccess[T](ITreeObject parent, NavRecordState state, Func2 func) at Microsoft.Dynamics.Nav.Service.NSField.Action(NavSession session) at SyncInvokeActionField(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.RunInTransactionCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.<Combine>b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.TransientErrorRetryCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.<Combine>b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.<Combine>b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.PushPopCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.<Combine>b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationTracer.TraceScopeCombinator(Category telemetryCategory, ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.<Combine>b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass10_0.<PerformanceCounterCombinator>b__0() at Microsoft.Dynamics.Nav.Runtime.NavPerformanceCounterSetter.UpdatePerformanceCountersWithAverageServiceOperationDuration(Stopwatch stopWatch, Action action) at Microsoft.Dynamics.Nav.Runtime.NavPerformanceCounterSetter.UpdatePerformanceCountersWithAverageServiceOperationAction(Action action, NavSession session) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.PerformanceCounterCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.<Combine>b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.InitClientTelemetryIdsCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.<Combine>b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.TlsClearCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1.<Combine>b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result) at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at Microsoft.Dynamics.Nav.Types.Channels.ReceiveCorrelator.AsyncResult.Complete(Action setValue) at Microsoft.Dynamics.Nav.Types.Channels.ReceiveCorrelator.OnNewMessage(IAsyncResult ar) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Security.SecuritySessionServerSettings.ServerSecuritySessionChannel.ReceiveRequestAsyncResult.Complete(Boolean synchronous, Exception exception) at System.ServiceModel.Security.SecuritySessionServerSettings.ServerSecuritySessionChannel.ReceiveRequestAsyncResult.OnReceive(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Channels.ReliableChannelBinder1.InputAsyncResult1.OnInputComplete(IAsyncResult result) at System.ServiceModel.Channels.ReliableChannelBinder1.InputAsyncResult`1.OnInputCompleteStatic(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object state) at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Net.LazyAsyncResult.Complete(IntPtr userToken) at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken) at System.Net.Security._SslStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.ReadFrameCallback(AsyncProtocolRequest asyncRequest) at System.Net.AsyncProtocolRequest.CompleteRequest(Int32 result) at System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes) at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Channels.ConnectionStream.IOAsyncResult.OnAsyncIOComplete(Object state) at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e) at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(SocketError socketError, Int32 bytesTransferred, SocketFlags flags) at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

2. To Reproduce Steps to reproduce the behavior:

  1. Install Two different Apps.
  2. First App installed on BC has Query with API Name as ServiceOrders
  3. This App also has published page as API with same API Name and other details as ServiceOrders.
  4. Another App has dependency on First App and is also installed on BC.
  5. Now we try to uninstall Apps and it throws the error.
AL code snippet that demonstrates the issue:

![Image](https://github.com/user-attachments/assets/16d37d84-4184-4484-8cd6-9370fbd79a8f)

3. Expected behavior

  1. There should have been error while installing App if it has duplicate APIs.
  2. Even if App was installed, the other Apps should have been allowed to install / uninstall independently.

4. Actual behavior There is an error as shown on point # 1.

5. Versions:

  • AL Language: 14.2.1249978
  • Visual Studio Code: 1.96.2
  • Business Central: AU Business Central 18.1 (Platform 18.0.24800.26311 + Application 18.1.24822.26330)
  • List of Visual Studio Code extensions that you have installed: Name: AL Language extension for Microsoft Dynamics 365 Business Central Id: ms-dynamics-smb.al
  • Operating System:
    • [X] Windows
    • [ ] Linux
    • [ ] MacOS

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

ManishKutar avatar Feb 18 '25 02:02 ManishKutar

image

kalberes avatar Feb 18 '25 12:02 kalberes