Skip to content

Improve matrix error message in case route could not be computed #2077

@clementcolin

Description

@clementcolin

Is there an existing issue for this?

  • I have searched the existing issues

Where did you encounter this issue?

self-hosted instance

Request URL

http://localhost:8082/ors/v2/matrix/

POST Request Body

{
    "locations": [ [2.323259,48.868848],[2.25,48.1],[4.922056,45.791143]],
    "id": "my_request",
    "sources": "all",
    "destinations": "all",
    "metrics": ["duration","distance"],
    "resolve_locations": false,
    "units": "m"
}

Response

Response
Error : 500 The matrix calculation task couldn't be submitted to ORS service, body request={"coordinates":[[2.323259,48.868848],[4.922056,45.791143]],"id":"my_request","units":"m"}body response={"error":{"code":2099,"message":"Unable to compute a route"},"info":{"engine":{"build_date":"2025-05-06T08:31:01Z","graph_version":"1","graph_date":"2025-05-21T13:48:51Z","version":"9.2.0"},"timestamp":1748340035410}}

Current behavior

Hello everyone.

When encountering a routing error with the matrix endpoint, the error returned is a routingErrorCode that lacks details about the problematic coordinates. This makes it difficult to address issues, especially with large matrices.
Additionally, the computation stops completely, resulting in the loss of all progress made, which can be time-consuming when dealing with large matrices.

Expected behavior

To improve this, two changes in behavior could be helpful:

  • The error returned could be more specific, displaying the index of the problematic locations.
  • The calculation could use default values when a routing error is encountered, allowing it to continue.

Openrouteservice Version

9.2.0

Build date

2025-05-06T08:31:01Z

Graph date

2025-05-21T13:48:51Z

Forum Topic Link

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions