HTTP Error 502: Bad Gateway


#1

I’m using the python module openrouteservice to download several distance matrices. I often get a 502 error. Even retrying several times after several minutes doesn’t help.

The last days it happened occasionally, so I assumed the reason was querying too heavily. However I’m not even near the limits of my token. And currently I don’t get any positive response at all from the server.

I found no other information about this problem, so I hope someone can guide me :slight_smile:

Edit: I’m also not violating any restrictions mentioned here: https://openrouteservice.org/restrictions/
The foot-walking distances are < 10 km, and even though one dimension of my matrix is > 50, it contains < 2500 elements.


#2

Hi @ascripter

I am moving this across to the Python SDK section as it probably fits better there.

Do you have an example of the query you are using?


#3

Hi @adam, thanks for your reply. I think I’ve resolved the issue by splitting my matrices - the problem seems to only occur if one dimension of the matrix is >> 50 (while in total still having < 2500 elements). 200 still seems to work, 500 not. Haven’t figured out the exact limit however.


#4

Sorry, lost track of this.

I am not sure entirely how the python SDK handles the error responses from ors in terms of passing down the error codes, but normally hitting limits would send back a specific response quickly saying that. It may well be that it was just taking too long to process and the Python tool ended up thinking that it was not getting any responses.