blackbird icon indicating copy to clipboard operation
blackbird copied to clipboard

Occasional Bitstamp API error

Open LasseMoench opened this issue 8 years ago • 6 comments

Every now and then, I get an error like this:

Server Response: 503 - https://www.bitstamp.net/api/ticker
Error with JSON: '[' or '{' expected near '<'
Buffer:
<html style="height:100%"><head><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><meta name="format-detection" content="telephone=no"><meta name="viewport" content="initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></head><body style="margin:0px;height:100%"><iframe src="/_Incapsula_Resource?CWUDNSAI=21&xinfo=5-355317-0%20NNNN%20RT%281517935718253%2067%29%20q%280%200%20-1%20-1%29%20r%28152%20-1%29%20b6%20U10000&incident_id=514000270000000519-2195046149521845&edet=20&cinfo=ffffffff3250" frameborder=0 width="100%" height="100%" marginheight="0px" marginwidth="0px">Request unsuccessful. Incapsula incident ID: 514000270000000519-2195046149521845</iframe></body></html>
  Retry in 2 sec...

Usually, it only appears once, but today it happened continously for about 50 times or so and it's still happening. If anyone has any idea where it's coming from or why it is happening, feel free to comment here. It is weird, since it usually only happens once, so I guess there isn't actually a syntax error in the JSON on blackbirds side...

LasseMoench avatar Feb 06 '18 16:02 LasseMoench

Hi @LasseMoench take a look at this comment about a timeout issue with Bitstamp and Incapsula.

butor avatar Feb 06 '18 16:02 butor

Ok so according to that comment and the reddit thread mentioned there, Incapsula (Bitstamps anti-DDOS provider) is the reason for this. I will ask Bitstamp support if there is anything that can be done to avoid it, e.g. lowering the interval for querying.

LasseMoench avatar Feb 06 '18 17:02 LasseMoench

@LasseMoench did you get a response from Bitstamp support regarding this issue?

I'm experiencing the same, except I get a 400 status code (when fetching order books via their API). It's pretty annoying, since the 400 status code causes my app to stop retrying. And when I visit the iframe "src" URL in the HTML response it says www.bitstamp.net - Response Failed, Error code 5, There was an error in processing the server response which sounds like it should be categorized as a 500 status code.

runeksvendsen avatar Jul 22 '18 15:07 runeksvendsen

Did anyone here arrive at a strategy for handling this type of issue? I'm seeing long request duration's (which turn into timeouts for me).

earce avatar Jun 23 '20 00:06 earce

Did anyone here arrive at a strategy for handling this type of issue? I'm seeing long request duration's (which turn into timeouts for me).

My strategy is to handle this response as a special case and change the status code to 500, which then causes a retry.

runeksvendsen avatar Jun 23 '20 06:06 runeksvendsen

@runeksvendsen :(

earce avatar Jun 24 '20 02:06 earce