Share via

Getting Intermittent Exceptions from the function app "An operation was attempted on a nonexistent network connection"

Mustaq Tailor 0 Reputation points
2023-12-12T10:22:19.54+00:00

We have HTTP Function App wired up to APIM. This works fine 99% of the time but every now and then we get following exceptions. We have try catch in the function app code which never gets triggered. "Getting Intermittent Exceptions from the function app "An operation was attempted on a nonexistent network connection"

problemId

System.Runtime.InteropServices.COMException at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw

type

System.Runtime.InteropServices.COMException

assembly

System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e

method

System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw

outerType

Microsoft.Azure.WebJobs.Host.FunctionInvocationException

outerMessage

Exception while executing function: func-etrading-AcceptNewOrder

outerAssembly

System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e

outerMethod

System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw

innermostType

System.Runtime.InteropServices.COMException

innermostMessage

An operation was attempted on a nonexistent network connection. (0x800704CD)

cloud_RoleInstance

cd766f454650b75a320d3e3ddcda04f526f706d2bd81000f7615b148aee920df

appId

a7d0a46a-31ed-45d1-8508-669ed5d59f25

appName

/subscriptions/094aae7f-a790-44a6-b53d-57b5454f57bd/resourcegroups/rg-uks-prod-apim/providers/microsoft.insights/components/ai-uks-prod-apim

iKey

d4c85a5a-665e-4672-b1a4-3248196884f3

sdkVersion

azurefunctions: 4.27.5.21549

itemId

8896e06c-9850-11ee-9936-000d3a0b5716

itemCount

1

_ResourceId

/subscriptions/094aae7f-a790-44a6-b53d-57b5454f57bd/resourcegroups/rg-uks-prod-apim/providers/microsoft.insights/components/ai-uks-prod-apim

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 29,446 Reputation points Moderator
    2023-12-19T16:11:17.9966667+00:00

    @Mustaq Tailor Thanks for reaching out. It's possible that the "An operation was attempted on a nonexistent network connection" error message could occur if APIM times out while waiting for a response from the Function App.

    When APIM sends a request to the Function App, it establishes a network connection to the Function App and waits for a response. If the Function App takes too long to respond, APIM may time out and close the network connection. If the Function App then tries to send a response over the closed connection, it may trigger the "nonexistent network connection" error message.

    You can check the logs for both APIM and the Function App to see if there are any errors or exceptions that may be related to the timeout issue.

    In case if you have validated this and still facing the issue then I will suggest you review the Diagnose and solve problems blade on your Function app to validate if there are any insights that provide more details on your error/exception/issue and mitigation steps to resolve the issue.

    if the above doesn't help, then I can help to review your function logs/metrics to at my end to assist you further.
    Feel free to get back to me if you have any queries or concerns.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.