Docker run error with OSM FILE found by

Hello I’m trying to start graphhopper with docker
During starting, the OSM File is found by The application .jar is called with:

exec "$JAVA" $JAVA_OPTS -Ddw.graphhopper.datareader.file="$OSM_FILE" -Ddw.graphhopper.graph.location="$GRAPH" \
                 $GH_WEB_OPTS -jar "$JAR" server $CONFIG 

But in GraphHopper::init(GraphHopperConfig ghConfig), the datareader.file is not found :-/. Could I help me?

The error:

using java 1.8.0_242 (64bit) from /usr/local/openjdk-8

./ line 138: mvn: command not found

using existing osm file /data/europe_germany_berlin.pbf

existing jar found web/target/graphhopper-web-1.0-SNAPSHOT.jar

now web. JAVA_OPTS=-server -Xconcurrentio -Xmx1g -Xms1g -XX:+UseG1GC -Ddw.server.applicationConnectors[0].bindHost= -Ddw.server.applicationConnectors[0].port=8989

./ line 258: echo## OSM FILE: /data/europe_germany_berlin.pbf, ## GRAPh: /data/europe_germany_berlin-gh: No such file or directory
2020-02-26 08:45:20.241 [main] INFO i.d.server.DefaultServerFactory - Registering jersey handler with root path prefix: /
2020-02-26 08:45:20.252 [main] INFO i.d.server.DefaultServerFactory - Registering admin handler with root path prefix: /
java.lang.IllegalArgumentException: If no graph.location is provided you need to specify an OSM file.
at com.graphhopper.GraphHopper.init(
at com.graphhopper.http.GraphHopperManaged.(
at com.graphhopper.http.GraphHopperApplication.main(

Question: the file config.yml is it used with docker starting?


Maybe just try setting graphhopper.datareader.file in the config.yml and see if the file is found? Also see this discussion:

It runs, i think the overwrtie -Ddw.grapphopper.datareader.file doesn’t work in command:

exec "$JAVA" $JAVA_OPTS -Ddw.graphhopper.datareader.file="$OSM_FILE" -Ddw.graphhopper.graph.location="$GRAPH" \
                 $GH_WEB_OPTS -jar "$JAR" server $CONFIG

I try too create empty object in config.yml --> datareader.file:{}, and hope to overflow by docker started…

It doesn’t work. I use v0.13

Are you sure? It should work, but only if the graphhopper.datareader.file property exists in config.yml (the value can be overwritten, but it cannot be added)

Ah yes in 0.13 this is different. You need to change -Ddw.graphhopper... to -Dgraphhopper.... (You need to do this with all arguments (datareader.file and graph.location in your example)

1 Like

Ok thanks, i was on master branch :woozy_face::woozy_face::woozy_face:

So now i would like to run grapphopper on my virtual machine and i’ve got :slight_smile:
here is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (mmap) failed to map 1073741824 bytes for committing reserved memory.


To help you here please share your VM specs and also the Xmx values you used. Plus the exact stacktrace.

Hello, excuse is an error, i had many ide runned simultaneously.

But when i runs, for the first time, my graphhopper docker, 1Gb is used by jar, the second time, only 300Mb?



But when i runs, for the first time, my graphhopper docker, 1Gb is used by jar, the second time, only 300Mb?

Not sure, but my guess is it has something to do with having to build the graphs the first time, but every other time it wouldn’t. If you delete the docker image, and build it again it would probably run at 1Gb again.

PS. I think I’m having the exact same problem as you initially had, but even when i git checkout 0.13 and switch to ‘0.13’ branch, I cannot get graphhopper to start!

@YannaY, what changes did you make to your

  1. Dockerfile ?
  2. ?
  3. config-example.yml?

Aren’t those the only three files you need to modify to setup graphhopper with your own local .osm.pbf file?? What did you change in those files? Is there any other file I am missing?