Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsure error with wrong routing endpoint #471

Closed
afontenot opened this issue Mar 19, 2021 · 5 comments · Fixed by #477
Closed

Obsure error with wrong routing endpoint #471

afontenot opened this issue Mar 19, 2021 · 5 comments · Fixed by #477

Comments

@afontenot
Copy link

afontenot commented Mar 19, 2021

When trying to use vroom to solve a problem with ~200 tasks, I get an odd error:

{"code":1,"error":"basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 465)"}

Looks to me like maybe the index into the string is going negative and overflowing?

This maybe the result of trying to use the public project-osrm server with too many tasks, but I was hoping that vroom would intelligently break the duration matrix into chunks so that it wouldn't overflow the API limits. In any case I think this specific error should probably not be happening.

I'm still trying to get it working locally to see if it's a problem there. The OSRM documentation leaves a lot to be desired.

@jcoupey
Copy link
Collaborator

jcoupey commented Mar 19, 2021

Looks like an internal problem we catch and only report the (not very useful) exception message. Hard to say much more based on the output, can you share an input file along with the command you've used to allow reproducing?

@afontenot
Copy link
Author

Let me see if I can anonymize the data sufficiently and get back to you.

@afontenot
Copy link
Author

Okay, attached. Some of the locations might not be routable (because they were slightly randomized), but I get exactly the same error.

Running with vroom -i tasks2.json -a router.project-osrm.org -p 80

Vroom was built from the latest stable release.

tasks2.txt

@jcoupey
Copy link
Collaborator

jcoupey commented Mar 19, 2021

The error is clearer when running in debug mode (e.g. from current master) because we hit this assertion:

auto start = response.find("{");
assert(start != std::string::npos);

What happens is the result we get from the table request does not contain valid json. Printing out the response yields:

HTTP/1.1 404 Not Found
Date: Fri, 19 Mar 2021 11:44:23 GMT
Server: Apache/2.4.38 (Debian)
Content-Length: 285
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.38 (Debian) Server at router.project-osrm.org Port 80</address>
</body></html>

This means that:

  • you should make sure to use a working routing endpoint, either local or remote;
  • we should turn those asserts into routing errors with a message along the lines of "Invalid routing response.".

@jcoupey jcoupey changed the title With too many tasks, vroom prints a confusing string error Obsure error with wrong routing endpoint Mar 19, 2021
@afontenot
Copy link
Author

afontenot commented Mar 19, 2021

Thanks for looking into this. That's what I figured it was, but didn't know of any way of checking. I figured the error message was inscrutable enough that it was worth fixing either way.

I did manage to get it working with a local OSRM after raising the maximum table size.

Note that you do get a sensible error from this end point if you send it a smaller number of locations. At around a hundred, I saw the expected too many locations error. So the endpoint isn't broken exactly, it's some kind of DDOS protection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants