Hi all, I’m currently making a project for research and am using OpenRouteService. This is my first time setting up a backend and running it locally (Windows 10 machine), and ran in to an issue with Docker.
I’m running this command:
docker run -dt --name ors-app -p 8080:8080 -e BUILD_GRAPHS=True -v /var/lib/docker/graphs:/ors-core/data/graphs -v /var/lib/docker/elevation_cache:/ors-core/data/elevation_cache -v C:/ors-config:/ors-conf -v C:/OSMFiles/north-america-latest.osm.pbf:/ors-core/data/osm_file.pbf -e “JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g” -e “CATALINA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9001 -Dcom.sun.management.jmxremote.rmi.port=9001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost” openrouteservice/openrouteservice:latest
This gets the ors-app up and running on port 8080 through Docker, and even after creating a separate folder (C:/OSMFiles), I successfully am able to map the ors-config:
ors-config.json exists in ors-conf folder. Copy config to /ors-core/openrouteservice/src/main/resources/ors-config.json
I am receiving the following error:
18 Apr 18:30:24 ERROR [routing.RoutingProfileManager] - Failed to initialize RoutingProfileManager instance.
java.util.concurrent.ExecutionException: java.lang.RuntimeException: Directory data/graphs/car does not exist and cannot be created to place lock file there: data/graphs/car/gh.lock
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
at java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
at org.heigit.ors.routing.RoutingProfileManager.initialize(RoutingProfileManager.java:178) ~[classes/:6.7.0]
at org.heigit.ors.routing.RoutingProfileManager.getInstance(RoutingProfileManager.java:72) ~[classes/:6.7.0]
at org.heigit.ors.servlet.listeners.ORSInitContextListener.lambda$contextInitialized$0(ORSInitContextListener.java:41) ~[classes/:6.7.0]
at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.RuntimeException: Directory data/graphs/car does not exist and cannot be created to place lock file there: data/graphs/car/gh.lock
at com.graphhopper.storage.NativeFSLockFactory$NativeLock.tryLock(NativeFSLockFactory.java:110) ~[graphhopper-core-v0.13.21.jar:?]
at com.graphhopper.GraphHopper.process(GraphHopper.java:697) ~[graphhopper-core-v0.13.21.jar:?]
at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:680) ~[graphhopper-core-v0.13.21.jar:?]
at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.importOrLoad(ORSGraphHopper.java:163) ~[classes/:6.7.0]
at org.heigit.ors.routing.RoutingProfile.initGraphHopper(RoutingProfile.java:184) ~[classes/:6.7.0]
at org.heigit.ors.routing.RoutingProfile.<init>(RoutingProfile.java:128) ~[classes/:6.7.0]
at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:35) ~[classes/:6.7.0]
at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:21) ~[classes/:6.7.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
This results in the following error when visiting http://localhost:8080/ors/v2/directions/driving-car?start=40.59521011,-74.19850153&end=40.59521011,-74.19469144
:
{“error”:{“code”:2099,“message”:“Unable to get an appropriate route profile for RoutePreference = driving-car”},“info”:{“engine”:{“version”:“6.7.0”,“build_date”:“2022-04-18T18:28:38Z”},“timestamp”:1650306762174}}
Not really too sure what to do here, so any help would be much appreciated. Thanks.