riatelab/osrm

Local server error

erickfaria opened this issue · 2 comments

Dear all,

I would like to report an error I found in the package. This error has been reported by other users on platforms like StackoverFlow.

I created a docker backend image on my server, it's working fine. And when I run more than 100 distances, an error occurs.
Here I put the code I'm running and it works correctly.

library(osrm)
df <- read.table("C:\\Users\\df.txt", header=TRUE, sep='\t', encoding = "UTF-8")

options(osrm.server = "http://localhost:5000/", osrm.profile = "car")

travelTime<-osrmTable(loc=df[1:100, c("id", "lon", "lat")]) 

When I add just one more case as in the following example:

travelTime<-osrmTable(loc=df[1:101, c("id", "lon", "lat")])

I have this error.

The OSRM server returned an error:
Error in doTryCatch(return(expr), name, parentenv, handler): object 'res' not found

Hello,
If you did not have done it, you should set the --max-table-size argument to a large number when starting the OSRM server e.g.:

docker run -t -i --rm -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm --max-table-size=1000000000

@rCarto this seems like a common error, could we please get a clearer/nicer error message in this case?

The same error is thrown if osrm.server is missing a trailing slash