I’m using the Route Editor to test the Route Optimization API. Unfortunately it throws an Internal Server Error after adding all my data (relations, services, vehicles). The error-message is not helpful at all unfortunately!
Here’s my problem description: https://gist.github.com/zuper-tom/182b68bbbbb38f7403d3522278f8ce86
The error looks like this:
{
“message”: “Internal Server Error”,
“hints”: [
{
“message”: “Index: 1, Size: 1”,
“details”: “class java.lang.IndexOutOfBoundsException”
}
]
}
Verified my guess that the problem is caused by my relations. If I remove them the error doesn’t occur. Guessing by the error-message I thought it might be related to the number of ids specified for a relation, but specifying three ids didn’t help. Neither did removing all but one relations. Triple-checked the documentation and as far as I can see I do everything exactly as documented?
After reducing the problem description even further I found out that everything works fine if I specify just one relation “in_same_route”:
Thanks for reporting this, @zuper-tom. It is fixed now! The strings “pickup” and “delivery” are used also in our special ids (see our doc how to set relations for shipments). It happened that the “delivery” string in your id within the context of relations made the system thinking that it needs to deal with a shipment (which involves two locations, a pickup and a delivery loaction) rather than an ordinary delivery service. Thus, it tries to get two activities/locations even there is only one. This causes this error.
Thanks for that guys! Did you also deploy a new version of the Route Editor? It doesn’t work for me any longer, throwing a silent error in the Javascript console when I click “show problem”: leaflet.js?v=0.7.3:7 Uncaught TypeError: Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'. (tested with same code as posted above)
Should I create a new discussion for that? @stefan
Thanks guys, this only seems to happen after the previous problem failed to be parsed. (e.g. “lat” missing from an address) So not important at all… Refreshing the page solves the problem.
In case you want to reproduce the problem yourself: copy this problem, click “show problem” (Uncaught TypeError: Cannot read property 'lat' of null printed to the console). All other problems copied into editor will fail now with aforementioned error message (Uncaught TypeError: Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'.)