This entry is about on how you can get a more detailed information whey you get “Message not shown because the NavBaseException constructor was used without privacy classification” in the telemetry from Business Central if and only if you are running OnPrem. Spoiler, telemetry errors are shown in the eventviewer.
A colleague of mine was renaming a record and got an error that it couldn’t do it because of unmatching field types (!). The error message and “Copy Information” didn’t give a clue what the error was so he called me. I opened up the application insights for the customer to look at the telemetry with a query taken from here.
Unfortunately the telemetry error log gave as little as the original BC error message…
What I got was:
failureReason : NavNSValidationFailed:InvalidType
alErrorMessage: Message not shown because the NavBaseException constructor was used without privacy classification
This doesn’t really give me much information! Unfortunately this isn’t the first time telemetry fails my troubleshooting dreams. Some context to why it doesn’t show the message can be found here:
Time to do my option B, debugging. But that didn’t help at all. The snapshot debugger didn’t catch the error and running classic was out of the questions since there were ~300 users in production and I didn’t want to create any table locks. So what’s left? Rolling around on the floor crying? No, I have another trick up the sleeve. The customer is running OnPrem (puh!) that means that I can do the old school trick to look in the eventviewer.
After some scrolling i finally found it
Here is a sample of the error text:
Server instance: BC220_DEBUG
Category: Runtime
ClientSessionId: e847f437-2cd4-4d2b-954e-59df43a094c1
ClientActivityId: 6926947e-4f54-d8e4-5a02-8e3d377000a0
ServerSessionUniqueId: 17d53620-1164-42db-9b00-5e9abf845256
ServerActivityId: a1b18242-4db4-4725-9d0f-53226a0982a9
EventTime: 01/03/2024 10:15:35
Message (NavNSValidationFailedException): Sending exception to client. Session terminating: False
ParentException: NavNSValidationFailedException
Message not shown because the NavBaseException constructor was used without privacy classification
ExceptionStackTrace:
at Microsoft.Dynamics.Nav.Service.NSField.Validate(NavSession session)
at Microsoft.Dynamics.Nav.Service.NSService.ValidateField(FieldRequest fieldRequest, NavRecordState dataSetState)
at Microsoft.Dynamics.Nav.Service.NSService.Microsoft.Dynamics.Nav.Types.IClientApi.ValidateField(FieldRequest fieldRequest, NavRecordState dataSetState)
--- End of stack trace from previous location ---
at Microsoft.Dynamics.Nav.Service.AspNetCore.ClientService.ServiceOperationPipelineDispatchProxy`1.<>c.<Invoke>b__8_0(ServiceOperationContext context)
at Microsoft.Dynamics.Nav.Service.ServiceOperationPipeline.AddToThreadSchedulerCombinator(ServiceOperationContext context, ServiceOperation innerOperation)
at Microsoft.Dynamics.Nav.Service.ServiceOperationPipeline.RunInTransactionCombinator(ServiceOperationContext context, ServiceOperation innerOperation)
at Microsoft.Dynamics.Nav.Service.ServiceOperationPipeline.TransientErrorRetryCombinator(ServiceOperationContext context, ServiceOperation innerOperation)
at Microsoft.Dynamics.Nav.Service.ServiceOperationPipeline.ErrorMappingCombinator(ServiceOperationContext context, ServiceOperation innerOperation, Boolean useCoreWcfFaultException)
InnerException:
ParentException: NavNCLInvalidTypeException
Det gick inte att byta namn på posten. Ett fel uppstod under typkonvertering vid uppdatering av referensfältet Arbetsorder.Objekt serviceintervall. Posten har datatypen Code och refererande fält har datatypen Integer.
ExceptionStackTrace:
As you can see I finally found the real error message at the end after ParentExecption.
The error message is in swedish but roughly means “Can’t rename the record. An error appeared when casting of field X. The record has datatype code and refering field has datatype integer“.
This helped my colleague to find the error which was a faulty tablerelation.
Summary
When you can’t get enough detailed error in telemetry you always have the option to look in the eventviewer and hope that what your are looking four can be found there, IF you are running on OnPrem.