question

PrakharSinha-3818 avatar image
5 Votes"
PrakharSinha-3818 asked HOLDENNicholas-6718 answered

Nodejs Web App on Azure

2020-12-18T17:39:06.652323823Z [41m [30mfail [39m [22m [49m: Middleware[0]
2020-12-18T17:39:06.652355023Z Failed to forward request to application. Encountered a System.Net.Http.HttpRequestException exception after 30585.959ms with message: An error occurred while sending the request.. Check application logs to verify the application is properly handling HTTP traffic.

Have tried to debug my application but havent been able to pin down the exact reason. What maybe causing this error for a nodejs webapp?

azure-webapps
· 11
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.

we've got the same result

2021-07-01T13:29:19.378594865Z: [INFO] Failed to forward request to application. Encountered a System.Net.Http.HttpRequestException exception after 60167.224ms with message: Error while copying content to a stream.. Check application logs to verify the application is properly handling HTTP traffic.

du to the file upload action.
but some time it may not happen!

1 Vote 1 ·

Hi @PrakharSinha-3818,

Sorry to hear you're experiencing this issue. The log snippet you provided doesn't provide much to go on. It sounds like you've already enabled logging. If you could include more of the log, that would be helpful, including:

  • Is this a brand new app or has been deployed for awhile and just starting to experience this issue?

  • Does the error occur app startup?

  • Does it occur when navigating to specific URI?

  • What app plan is your app hosted in...Windows or Linux? Are you using a docker image?

Regards,
Ryan








0 Votes 0 ·

The same problem happened to me as well.
The previous deploy of NodeJS Web App has no problem, but the next deploy caught in trouble with error message as PrakharSinha-3818:
2020-12-22T00:52:31.830632540Z: [INFO] [41m [30mfail [39m [22m [49m: Middleware[0]
2020-12-22T00:52:31.832529518Z: [INFO] Failed to forward request to application. Encountered a System.Net.Http.HttpRequestException exception after 120105.137ms with message: An error occurred while sending the request.. Check application logs to verify the application is properly handling HTTP traffic.

0 Votes 0 ·

I had the same exact issue and all I did to fix it was change the name of the node js server's route. However I still don't understand why this fixed the issue. I would like to know the cause of the issue so that I can prevent it in the future.

example:
previous route name: serverURL.com/old-route-name
new route name: serverURL.com/new-route-name

0 Votes 0 ·

I still got the problem.

0 Votes 0 ·
Show more comments
ryanchill avatar image
0 Votes"
ryanchill answered

@PrakharSinha-3818 @AlexeiChizmakov-9992 @BenoitLacelle-2502 seeing that the exceptions are reporting high timeouts, it may be occurring timing out on the Front-End load balancer. Long running requests upwards of 30s will have significantly high failures counts. @BenoitLacelle-2502, 5MB doesn't sound large to me but still could be same issue.

https://techcommunity.microsoft.com/t5/apps-on-azure/azure-storage-blob-upload-from-browser/ba-p/392687 is a blog post that provides a workaround for uploading files using Azure Storage and freeing up the web server. You can have your app generate a storage blob's SAS Key with write access which is sent back to the browser and used to upload to storage.

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.

HOLDENNicholas-6718 avatar image
0 Votes"
HOLDENNicholas-6718 answered

I'm also getting this error on python 3.9 azure app service. I found it in the easyauth docker log, note the seemingly v quick timeout? Diagnostic doesn't show anything about running out of sockets etc.


2021-09-28T13:23:46.973948204Z Updating certificates in /etc/ssl/certs...
2021-09-28T13:23:57.598799636Z 11 added, 0 removed; done.
2021-09-28T13:23:57.599145637Z Running hooks in /etc/ca-certificates/update.d...
2021-09-28T13:23:57.604871265Z done.
2021-09-28T13:23:57.610101990Z Updated CA certificates

2021-09-28T14:05:43.941258580Z [41m [30mfail [39m [22m [49m: Middleware[0]
2021-09-28T14:05:43.941295880Z Failed to forward request to application. Encountered a System.Net.Http.HttpRequestException exception after 2.002ms with message: An error occurred while sending the request.. Check application logs to verify the application is properly handling HTTP traffic.

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.