The Azure function failed to process, even though it was previously functioning correctly

Katy Haddad 5 Reputation points

Hi there, The Azure function in production was working as designed until 2023-04-18T11:59:22, and we haven't deployed any new code in production. I have tested the function in the UAT environment, and I am receiving an error message stating 'The reader's MaxDepth of 64 has been exceeded' in the Azure function. Could you please help me to find out the source of issue? the error details : 51bdda34-a821-4db7-be49-4176c6a613c0: Function 'dapiOrchestrator (Orchestrator)' failed with an error.
Reason: Message: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to
Stop: Activity function 'dapiGetContext' failed: The reader's MaxDepth of 64 has been exceeded. Path
'storageContext.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context.Context', line 1, position 20876., StackTrace: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task{{1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task}}1.get_Result() at Microsoft.Azure.WebJobs.Extensions.DurableTask.TaskOrchestrationShim.InvokeUserCodeAndHandleResults(RegisteredFunctionInfo orchestratorInfo, OrchestrationContext innerContext) in D:\a_work\1\s\src\WebJobs.Extensions.DurableTask\Listener
TaskOrchestrationShim.cs:line 150. IsReplay: False. State: Failed. HubName: taueasaufndapisftp. AppName: t-auea-sau-fn-dapi-sftp. SlotName: Production.
ExtensionVersion: 2.9.0. SequenceNumber: 16. TaskEventId: -1

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
3,691 questions
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
1,544 questions
{count} vote

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 63,511 Reputation points

    @Katy Haddad Thanks for reaching out.

    As per the error it looks like JSON payload being processed by the Azure Function has exceeded the maximum depth allowed by the JSON serializer. The full stack trace should provide you with more information about which piece of code is throwing the error. In case if it is Newtonsoft.Json library then you can try increasing

    JsonSerializerSettings.MaxDepth Property to higher value. It is always suggested Simplifying the JSON payload. If the JSON payload contains nested objects or arrays that are too deeply nested, you can try simplifying the payload by removing some of the nested objects or arrays.

    If the Azure Function code is processing the JSON payload in a way that causes it to exceed the maximum depth allowed by the JSON serializer, you can try optimizing the code to reduce the depth of the JSON payload.

    0 comments No comments