How troubleshoot bad request in Application Insights of Azure? - azure

I am receiving more tan 10.000 bad request in Application Insights of Azure, I know some details of the transaction but I can not find a thread to pull, and understand why those head requests are getting a 404 error, how can I troubleshoot those requests?

The problem can be resolved by making a valid "/" path in you application that returns a 200 response. Alternatively look at #RithwikBojja-MT refs.
The reason for this is actually that Azure pings the root path of your applications if you have the "Always-On" feature enabled.

Related

REST API In Node Deployed as Azure App Service 500 Internal Server Errors

I have looked at the request trace for several requests that resulted in the same outcome.
What will happen is I'll get a HttpModule="iisnode", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus=500, HttpReason="Internal Server Error", HttpSubstatus=1013, ErrorCode="The pipe has been ended. (0x6d)"
This is a production API. Fewer than 1% of requests get this result but it's not the requests themselves - I can reissue the same request and it'll work.
I log telemetry for every API request - basics on the way in, things like http status and execution time as the response is on its way out.
None of the requests that get this error are in telemetry which makes me think something is happening somewhere between IIS and iisnode.
If anyone has resolved this or has solid thoughts on how to pin down what the root issue is I'd appreciate it.
Well for me, what's described here covered the bulk of the issue: github.com/Azure/iisnode/issues/57 Setting keepAliveTimeout to 0 on the express server reduced the 500s significantly.
Once the majority of the "noise" was eliminated it was much easier to correlate the remaining 500s that would occur to things I could see in my logs. For example, I'm using a 3rd party node package to resize images and a couple of the "images" that were loaded into the system weren't images. Instead of gracefully throwing an exception, the package seems to exit out of the running node process. True story. So on Azure, it would get restarted, but while that was happening requests would get a 500 internal server error.

Unable to run the angular application. Getting error No such file exists robots933456.txt

I am running the angular application in Microsoft Teams and deploying it on Azure.
But it's not running up as it is looking for the robots933456.txt route.
It wasn’t the case before today.
Please guide me on how to proceed further.
On running the app the logs shows:
The error was natively on my side nothing to do with the above but pretty much seen and raised by people so thought of sharing below:
After doing some research figured out I can safely ignore this message. /robots933456.txt is a dummy URL
the path that App Service uses to check if the container is capable of serving
requests. A 404 response simply indicates that the path doesn't exist, but
it lets App Service know that the container is healthy and ready to respond
to requests.
https://github.com/MicrosoftDocs/azure-docs/issues/32472

Error 503 on Cloud Run for a simple messaging application

I have built a simple Python/Flask app for sending automatic messages in Slack and Telegram after receiving a post request in the form of:
response = requests.post(url='https://my-cool-endpoint.a.run.app/my-app/api/v1.0/',
json={'message': msg_body, 'urgency': urgency, 'app_name': app_name},
auth=(username, password))
, or even a similar curl request. It works well in localhost, as well as a containerized application. However, after deploying it to Cloud Run, the requests keep resulting in the following 503 Error:
POST 503 663 B 10.1 s python-requests/2.24.0 The request failed because either the HTTP response was malformed or connection to the instance had an error.
Does it have anything to do with a Flask timeout or something like that? I really don't understand what is happening, because the response doesn't take (and shouldn't) take more than a few seconds (usually less than 5s).
Thank you all.
--EDIT
Problem solved after thinking about AhmetB reply. I've found that I was setting the host as the public ip address of the SQL instance, and that is not the case when you post it to Cloud Run. For that to work out, you must replace host by unix_socket and then set its path.
Thanks you all! This question is closed.

Scale-in issue in Azure

I am not sure if this is the case, but I think I have the following problem.
After scale in happens some requests gets 5XX response. I am not sure if 5XX appears because of scale in, but it appears so. And what I think happens is that after scale in rule was applied my app instance is shut down before some requests got appropriate response.
Could it be the case? In case yes, maybe somebody knows the solution?
I am using Azure.
Update: currently I am getting 502 Bad Gateway, but the strange thing is that App Service is not showing any failures
My guess it the failure happens in IIS and it does not even reach my app. Could it be the case?

Get varnish error logs

I'm using varnish in my web infrastructure. My problem is that I'm loocking for a way to get varnish logs itself, actually error logs.
I mean error logs of varnish, not the one my web server as explained in this tuto https://www.garron.me/en/go2linux/configure-varnish-logs-varnishnsca-logrotate-and-awstats.html
Thus, what I wouls like is to catch varnish error logs. Can someone help me to reach this goal?
Thanks

Resources