Timeout when using Matrix API call to openrouteservice.org

I am calling distance_matrix from python using the openrouteservice package. Yesterday, I was able to call and receive data (distance matrix) for up to 30 sites. If I tried a larger number (e.g., 40), I ran into the “too big” error, which I understand.

However, today, I haven’t been able to get any calls to work, with even a small-ish list of 10 sites. I’ve tried multiple times with lists of various small sizes, and I keep getting a timeout error. The error stack is large, but the first error is this:

Traceback (most recent call last):
File “/Users/m.webb/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 384, in _make_request
six.raise_from(e, None)
File “”, line 2, in raise_from
File “/Users/m.webb/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 380, in _make_request
httplib_response = conn.getresponse()
File “/Users/m.webb/opt/anaconda3/lib/python3.7/http/client.py”, line 1336, in getresponse
response.begin()
File “/Users/m.webb/opt/anaconda3/lib/python3.7/http/client.py”, line 306, in begin
version, status, reason = self._read_status()
File “/Users/m.webb/opt/anaconda3/lib/python3.7/http/client.py”, line 267, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), “iso-8859-1”)
File “/Users/m.webb/opt/anaconda3/lib/python3.7/socket.py”, line 589, in readinto
return self._sock.recv_into(b)
File “/Users/m.webb/opt/anaconda3/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py”, line 310, in recv_into
raise timeout(‘The read operation timed out’)
socket.timeout: The read operation timed out

with a few more exceptions. The final listed exception is:

openrouteservice.exceptions.Timeout

I was able to get the API example on the website to work (https://openrouteservice.org/dev/#/api-docs/v2/matrix/{profile}/post), but it took 28 seconds to respond, which seems awfully slow for such a simple request.

Is there an issue with the server on openrouteservice.org at this time? The status page shows nothing.

My dashboard says all my privileges are green, with an essentially full quota.

Can you try again? And if it’s still timing out or you’re expecting > 1 sec response time for 10 locations call, can you please “curlify” the request, i.e. append a dry_run=true to the parameter list of the endpoint and paste here?

We did put another major ORS version live yesterday, so it’s entirely possible that things are not entirely smooth yet. We’ll work it out as issues are reported. Yours could be related to a short while in which we changed the servers.

I tried again with 30 locations, which worked two days ago, and got another timeout. Same with 20 locations. I tried with 10 locations, and that worked once and failed once. This is the url for the 10 locations call (note that I removed most of my authorization key so I could post here in the forum):

url:
https://api.openrouteservice.org/v2/matrix/driving-car/json?
Headers:
{
  "headers": {
    "User-Agent": "ORSClientPython.v2.2.3",
    "Content-type": "application/json",
    "Authorization": "5b3.....ef"
  },
  "timeout": 60,
  "json": {
    "locations": [
      [
        "-106.525301",
        "35.167684"
      ],
      [
        "-84.362394",
        "33.931896"
      ]
    ],
    "profile": "driving-car",
    "metrics": [
      "distance"
    ],
    "units": "mi"
  }
}

One more thing: I’ve discovered that I can accomplish what I’m trying to do (find the distance matrix between approximately 90 sites) by constructing that matrix “row by row”: I do this by cycling through each site and making it the sole “source” for that particular call. By doing this and waiting several seconds between each call, I was able to get the full distance matrix (and not violate the rate limit of 40 calls/minute).

I’ll try this tmrw. Sounds weird…

Don’t do the workaround once I got it working. It’s so much slower for you and so much more resource intense for us. After all, that’s exactly what the matrix API is for.

Hello.

I am facing the same issue with the matrix API.
For some reason, I get responses for driving distances but not for walking distances.
I was able to do that fine before yesterday, but now requests fail even for 10 locations.

Note: even the API calls performed on the documentation page seem to fail in the case of walking distance calculation. So it’s probably something on the server side.

Regards,
Alex

Walking distance calculation using the matrix api is still down today, is there any prediction for when it’s going to be live again?

It’s not exactly down, but for some reason a request with 20 locations takes > 30 secs. That’s not good at all. Means there’s a misconfig on the server or in the code.

@HendrikLeuschner @adam I’m not sure how to debug this. It doesn’t feel like this is RPHAST calculating the matrix. 20 locations around Karlsruhe:

curl --location --request POST 'https://api.openrouteservice.org/v2/matrix/driving-car' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer key' \
--data-raw '{
    "locations": [
      [
        8.281229189634367,
        48.6027875888449
      ],
      [
        8.684633085592075,
        49.286822327091286
      ],
      [
        8.377796391832012,
        49.1078048227408
      ],
      [
        8.428335802294114,
        49.23330245100958
      ],
      [
        8.032927873618082,
        48.7076893009972
      ],
      [
        8.602080793502783,
        49.49707036753639
      ],
      [
        7.978944193179752,
        48.716025097240845
      ],
      [
        8.793725724351207,
        48.73308567569807
      ],
      [
        8.488410990341638,
        49.318491083249796
      ],
      [
        8.358750765940362,
        48.57312525980959
      ],
      [
        8.00152032189773,
        48.72185019847082
      ],
      [
        8.30131935889082,
        48.51916904940689
      ],
      [
        8.87286839597583,
        49.29417754169645
      ],
      [
        8.552809599500772,
        48.80178292734986
      ],
      [
        8.655521528944977,
        48.6326871211805
      ],
      [
        8.60189260849157,
        49.104198957267094
      ],
      [
        8.300180904929304,
        48.57233923538494
      ],
      [
        8.634665241656725,
        48.84362398908912
      ],
      [
        8.696685101701126,
        48.76507057735732
      ],
      [
        8.752175968213974,
        48.88935628811035
      ]
    ]
  }'

Thanks for your response.

As far as I can tell, even the sample call from the matrix API playground fails when set to walking distance, and that features only four locations.

I think we found the issue, now we just have to hot-fix it. We’ll update the open threads once it’s fixed.

fixed nowwwwwwwwwwww