VarnishBackendSickException (Unknown Error)


#1

Hi, I’m trying your API for the first time, sending requests with Ajax. I’m trying to retrieve the network status. If I try my ID and Key on the website it works, if I paste the full url in the browser it works but if I use it in my code it will not work and return a HttpStatusCode 760.
I’m not sure where this issue is.

this is my code (I’m using React JS) to send the request

fetchTubeStatus = () => {
	var url = "https://api.tfl.gov.uk/NetworkStatus?app_id=id&app_key=key";

	$.ajax({
		url: url,
		dataType: "jsonp",
		type: "GET",
		success : this.parseTubeStatusResponse,
		error : function(req, err){ console.log('API call failed ' + err); }
	})
}

and this is the response I get

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
				 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
				  <head>
					<title>Unknown Error</title>
				  </head>
				  <body>
					<h1>VarnishBackendSickException</h1>
					<p>HttpStatus: Unknown Error</p>
					<p>HttpStatusCode: 760</p>				
					<p>Message: This service is currently unavailable</p>
					<p>RelativeUri:/JSONP-ESI-TEMPLATE</p>
					<hr>
					<p>Varnish cache server</p>
				  </body>
				</html>

any idea?
Thank you for your help.

Best

B.


#2

silly silly me, I copy/pasted another ajax I was using without realising that the type should be “json” and not "jsonp"
Fixed it, thanks anyway :slight_smile: