question

FerencSzab-4432 avatar image
0 Votes"
FerencSzab-4432 asked FerencSzab-4432 commented

Azure APIM response code 0

We are seeing requests in API Management logged in Application Insights with the response code:
0 [not sent in full (see exception telemetries)]
On the client side, the response is "503 Service Unavailable". We are not really sure what this phenomenon is, what's in between the client and the APIM we are not aware of that's canceling the request and responding with the 503.
Any insights into this?

azure-api-management
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @FerencSzab-4432, apologies for the delay. AFAIK response code 0 might have multiple reasons behind it as it basically means as "undefined". If possible can you please run a trace for that particular call? as it will help in pin pointing the exact issue. Please let me know if there are any concerns. Thank you!


0 Votes 0 ·

Hello Chaitanya,

Sorry for the late response, we were very busy with our launch. What we are seeing in App Insights are requests received by the Api Management and forwarded to the backend service which results with an exception called "ClientConnectionFailure at forward-request"

93007-image.png

But we also see traces like
93114-image.png

And we are not really sure whether these are actually cancelled by the end users (as some stack overflow threads would indicate) or a network error on our side.
Would exception handling and/or retry logics mitigate these?

Thank you,
Feri

0 Votes 0 ·
image.png (24.5 KiB)
image.png (48.7 KiB)

Hi @ChaitanyaNaykodiMSFT-9638, any ideas? Interestingly enough we are seeing this much more often from our Samsung Tizen and the LG webOS clients than the SPA clients, which indicates this is a client side issue, even though it seems like the APIM loses connection to the backend App Service.

Thank you,
Feri

0 Votes 0 ·

Hello @FerencSzab-4432, my sincere apologies for the delay. The observation made is correct. ClientConnectIonFailure means client connected to APIM aborted pending request. In the case APIM aborts corresponding request to backend. From the screenshots above we can see that the duration is not that high for the failed responses as well, so it does look like Client side issue as observed by you. I think reproducing the error from client side might help in determining the root cause of the issue. Please let me know if there are any concerns.

0 Votes 0 ·

Hi Chaitanya,

What's confusing is that in the first case the backend doesn't seem to be called at all, that's why we thought that there's a connectivity issue between the APIM and the backend. But I guess the best solution would be checking from the client-side.
But aside from this, we would be interested in our options of troubleshooting API errors. We don't see more details in the logs when we change the Verbosity to Verbose from Information. Are we missing some logs? We also have the "Diagnostic Settings" enabled, but the GatewayLogs does not contain anything useful either.

Thank you!
Feri

0 Votes 0 ·

1 Answer

ChaitanyaNaykodiMSFT-9638 avatar image
0 Votes"
ChaitanyaNaykodiMSFT-9638 answered

Hello @FerencSzab-4432, this is the data which gets added to Application insights. You can also add trace policy to do custom logging for the API. Additionally in the advanced options while setting up application insights you can decide on how backend & frontend requests/responses are logged and please be aware of performance implications of logging in APIM.

96583-image.png

Also regarding the verbosity level if this is the case please be aware that the setting applied at individual API level will over-ride the setting for All API levels.
96534-image.png

You can also refer to this tutorial to understand more about monitoring published API's. Please let me know if there are any concerns. Thank you!



image.png (19.8 KiB)
image.png (49.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.