Splash regularly falls with status code 520 - scrapy-splash

I am scraping website using scrapy-splash + lua script. Sometimes (randomly) scraping falls in random piece of code ( always in different piece) with such error:
"status_code": 520, "client_ip": "...", "error": {"error": 520, "type": "CancelledError", "description": "Render is cancelled", "info": {"remaining": 59988.849385261536}}}
But it happens not very often, mostly I have correct result, but it's not allowed for me to have that error even very rarely.
in source code I see
if timer is not None and timer.cancelled:
ex = CancelledError(msg)
return self._write_error(request, 520, ex)
But unfortunately it doesn't give me enough information what might be wrong. Any ideas/recommendations?

Related

HTTP 500 on Podio GET item

When fetching GET https://api.podio.com/item/1259778758 (other items work fine), I get the following error:
HTTP 500
with response body:
{
"error_parameters": {},
"error_detail": null,
"error_propagate": false,
"request": {
"url": "http://api.podio.com/item/1259778758",
"query_string": "",
"method": "GET"
},
"error_description": "An unexpected error occured during execution",
"error": "unexpected"
}
I assume this is due to some field value, but cannot figure this out. Can you please check an fix this?
Additional notes:
It is not possible to open this item in the browser as well
The filter operation in the API fails as well when this item is in the result.
It sounds like this should be escalated with Podio technical support.

Amadeus API returns Internal error with all requests (Production Key)

{
"errors": [
{
"code": "38189",
"title": "Internal error",
"detail": "An internal error occured, please contact your administrator",
"status": "500"
}
]
}
I get this error when I use production key to send requests to AMADEUS API, this error returns just with production key but not with test key. Despite I updated header to " Accept application/vnd.amadeus+json" the error still returns.
Here one of the requests:
https://api.amadeus.com/v1/shopping/flight-offers?origin=MAD&destination=PAR&departureDate=2019-08-01&adults=1&nonStop=false&max=6
We had a configuration issue on our side. Everything has been fixed, You should be able to use all the APIs in production.
Sorry for the inconvenience.

Google Search Console - Internal error encountered

Recently when calling the api for Google Search Console, I'm getting:
"Internal error encountered"
Everything is working well last week but until now still getting the issue. Is there any problem with Google Search Console?
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
Even your search api tool in google.developer page is not working. Here's a screenshot

JSON RPC 2.0 standard responses

I am currently looking into implementing some JSON RPC 2.0 responses in my code. However, I'm a little unclear on what are the standard practices of using it:
1) When the user sends a request with invalid parameters, should I just return verbatim default error message
{"jsonrpc": "2.0", "error": {"code": -32602, "message": " Invalid params"}, "id": "1"}
Or can the message be more specific, like:
{"jsonrpc": "2.0", "error": {"code": -32602, "message": " Invalid params: invalid username"}, "id": "1"}
Or should such custom messages have their own error code?
2) If the user say, requests data from the database and the response is "data is not present", as in we encountered no errors but still didn't return anything, should that be returned as a JSON RPC error, or should it be more of response indicating data wasn't found? In other words, is the convention in JSON RPC to use errors as normal return conditions like in Google Go, or is it more akin to "something really messed up" panics?
According to the specification (http://www.jsonrpc.org/specification#error_object) you must use the optional property data for your additional information about the error, so, in your case the response must be:
{"jsonrpc": "2.0", "error": {"code": -32602, "message": " Invalid params", "data":"invalid username"}, "id": "1"}
You can create your own personal error codes in the range -32000 to -32099, but I would do it only when necessary, that is, unless your client application should behave in this case ("invalid username") different than in any other -32602 case.
That is up to you. It is a design question with a broader scope than JSON-RCP. You can find some opinions at this post: when-to-throw-an-exception

Unable to retrieve page insights using Graph API explorer

I have the 'Insights Analyst' permission to my facebook page, and I try to use Graph API Explorer to get the metric page_fans
I "Get Access Token" with 'read_insights' and 'manage_pages', and "Submit" a graph API call that looks something like
GET /<page_id>/insights/page_fans
But then I get an empty response. (This occurs for all metrics except page_story_adds_unique, page_storytellers, and page_admin_num_posts)
{
"data": [
],
"paging": {
"previous": "https://graph.facebook.com/<page_id>/insights/post_storytellers/?since=1369004893&until=1369264093",
"next": "https://graph.facebook.com/<page_id>/insights/post_storytellers/?since=1369523293&until=1369782493"
}
}
What permissions am I missing? What am I doing wrong?
There seems to be a larger than usual backlog of data missing in the insights at the moment. Use values for since and until to see where the data is.
/<page_id>/insights/page_fans?since=1369008000&until=1371686400
The numbers are unix timestamps to specify the date range you want. If the range is too large then you will get
"error": {
"message": "Unsupported operation",
"type": "FacebookApiException",
"code": 100
}
I know it's very frustrating and Facebook seems to not have any proper way of checking that the data is backlogged.