HTTP, 408 Request timeout - http

I have an application, written in C++.
This app dispatches a certain info to a script located on a remote website using HTTP POST requests. The app sends requests with a period from several seconds to several minutes.
The problem is that after about a half an hour of working without errors, the app starts to get a 408 Request timeout error from the web server. Then the app starts to retry posting but the server keeps on responding with 408 Request timeout.
An interesting observation: the error disappears after I access the website using a browser and the app works OK for about 30 minutes after that, then the issue comes back.
What could be the reason and is there any workaround to this?
PS: the app works on a usual PC with XP Workstation. The website is on GoDaddy web server.
thanks in advance

I know this is an old post but thought this might help someone since this problem cause me hours of frustration.
I was experiencing the same issue with a GoDaddy webserver. My Android app sent POST requests to the server and would work as expected but I started experiencing 408 Request timeout errors after 30 mins or so. I also noticed that the problem went away if I opened up a browser and opened my home page (PHP Wordpress site) from a PC or the Android device. The website was in test so web traffic was minimal and I was able to confirm this behaviour in the server logs fairly easily.
I logged a support call to GoDaddy but whilst their staff were responsive and helpful, they did not provide any useful information to explain the behaviour.
I was however able to work around the issue by simply executing a dummy GET request before my POST request and this 'woke up' the web server and it responded to all subsequent POST requests.

Related

Error 426 from newsapi.org once I deployed my site on Netlify

While I was trying my project on localhost it was working fine, using https://cors-anywhere.herokuapp.com/ since I got the CORS problem. But once I deployed the site on Netlify, it gave me the error 426 (Upgrade Required), with or without using https://cors-anywhere.herokuapp.com/.
These are the messages that appear on my console:
>Failed to load resource: the server responded with a status of 426 (Upgrade Required)
>Error: Request failed with status code 426
at createError.js:16
at settle.js:17
at XMLHttpRequest.<anonymous> (xhr.js:61)
I have been searching and some people seem to have similar problem to this. I have seen solutions like having my own server to pass the requests, but I don't know how to do it and, correct me if I am wrong, wouldn't that be the same as using https://cors-anywhere.herokuapp.com/?
Newsapi changed their pricing model.
You can't make requests from the browser anymore, you'll have to use a backend. I had the same problem and the easiest way around it was implementing a Node (Express) server.
I guess the free plan simply is not longer available in production.
"Requests from the browser are not allowed on the Developer plan, except from localhost."
Here's the updated plan page..
https://newsapi.org/pricing
Actually newsapi.org api in developer plan is no more working in production.
because in developer plan CORS is only enabled for localhost.
Developer Plan $0
CORS enabled for localhost.
https://newsapi.org/pricing
but if you want to fetch news in production then there is a alternative for this which have 1000 request per month free works in production also .
https://newsapi.in/
Newsapi.in this website provide api that have cors enabled for all origins.
Enjoy...
As others have mentioned, Newsapi no longer allows you to make requests from the browser.
newscatcher has a no-card free tier that allows for 10,000 requests. On top of that, depending on your use case you can even mail them to increase the limits for a short span of time, or to add extra data points.

Apify task suddenly returning 403 and 503 errors after working for months

Not sure why this is occurring. I've been using this daily for months and it suddenly broke this morning. Its returning the following error.
CrawlerError: The page couldn't be opened (status: fail, url: https://history.com/this-day-in-history/, lastResourceError: {"errorCode":403,"errorString":"Error downloading https://history.com/this-day-in-history/ - server replied: Service Unavailable","id":1,"status":503,"statusText":"Service Unavailable","url":"https://history.com/this-day-in-history/"}, lastResourceTimeoutResponse: null)
Nothing in the code has changed, website is still up and running fine. Is there any reason why it might stop working suddenly?
This might mean that the website now recognizes you as a bot and is blocking your requests. I would check some articles in this docs section. We are also working on anti-scraping guide.

Azure VM IIS HTTP Status Codes Changed

I have a couple Azure VMs behind a Basic Load Balancer with an HTTP URL Health Probe for the Backend Pool. To mark a server down, that URL returns Status Code 503 (Service Unavailable), but when I call that page from those VMs, the Status Code returned is 403. That still has the desired effect, I suppose, of marking the server down - but I dont understand why the code I set has changed.
This is from an ASP.NET web forms application on the VMs. I look at developer tools in the browser, and from my local machine or from a Dev server on our local network, that page returns Status Code 503, but calling that page from the VMs in Azure, the Status Code is 403.
Here's where I set the Status Code in that page:
Response.Clear()
Response.StatusCode = 503
Response.Flush()
I suppose I should mention that my local is a Windows 10 box, and the server VM is Windows Server 2016. Both are running IIS 10. The application is compiled with .NET Framework 4.6.
Here's the dev tools from my localhost:
Here's the dev tools from the server in azure:
Why the change? Anything I can do to stop this behavior?
So today I tried enabling Failed Request Tracing, but either something wasnt set up correctly, or the error was being handled elsewhere, and didnt result in any failed requests being logged.
Since I wasnt getting any failed requests logged, I opened up Process Monitor and could see that immediately after the call to my Health Probe page, I was getting a call to my custom HTTP Error page. That page must have been what was giving the 403 (dont know why, b/c that page works correctly for other HTTP Errors with a friendly error message and logging of the error to my custom error tracking solution).
I was going to change the Status Code to see if there was something special with the 503 that I was setting that was handled differently in IIS, but that got me thinking about how I was setting the status code...
In my research today, I saw this page https://www.leansentry.com/HowTo/AspNet-Response-Flush-Poor-Performance which cautions against using Response.Flush(). The code that I had implemented was in the Page_PreRender method, so there's not really a need to Flush there anyway.
I removed the Response.Flush and of course, my troubles went away.
The Health Probe page no longer triggers an Error from the Azure VM, and therefore, the status code that I get in my client browser is the 503 that I set in code.
So I guess this case is closed. I will need to figure out why the HTTP Error page was throwing a 403 instead of returning the friendly error message, but that should be easy enough...

IIS Requests stay alive

Currently I have a problem. Some times when the user loads a page a request gets stuck in IIS (see screenshot). These request are made with AJAX.
For the user everything goes fine, he/she gets all the data and request ends with a 200 status code.
From my understanding the users page request should be stuck since IIS only handles 1 request per session when "EnableSessionState" is set to true, which it is, or am I wrong?
What do status 4096 and 1177224886 mean?
But what i really want to know is:
What is the best way to try and find the source of the problem. I already tried to use the "Failed Requests Tracing" but cant discover anything strange.

3 requests for every resource (2 x 401.2 and 1 x 200) in a windows authenticated asp.net mvc app

I was trying to track down why my site was so painfully slow in IE9 when I pulled out Fiddler and realised that every request is being sent 3 times (twice I get 401.2 and then a success). I verified this happens on all browsers, its just that Chrome's speed was masking this (or it could be that this has nothing to do with my sites performance issues in IE).
I've set up break points in my begin/end request handlers and the request comes in for say a css file. It is not authenticated and the response goes out with a 401.2, I doubled checked that I'm not setting the response status anywhere myself, so somewhere between begin_request and end_request the status is changing to 401.2
Note: I have the runAllManagedModulesForAllRequests=true so I can configure compression, however this setting does not affect this (from what I can see from Fiddler).
I am very ignorant on kerberos/active directory in general but I just cannot fathom that this is a normal handshaking protocol for every single request (perhaps for the first? but not all).
I have scoured the googles and nothing seems to help (adding/removing modules/authentication providers, etc). I mean my site works just fine, its only once you look under the hood that I see the treplicated requests. Note: This also happens when I deploy to production so its not a server specific issue.
Has anyone ever seen this? thanks in advance.
I think this is how NTLM authentication works. The process is discussed here. Note that you will want to set AuthPersistSingleRequest to false to cut down on the number of 401s

Resources