Docker run error with OSM FILE found by graphhopper.sh

Hello I’m trying to start graphhopper with docker
During starting, the OSM File is found by graphhopper.sh. 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

./graphhopper.sh: 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=0.0.0.0 -Ddw.server.applicationConnectors[0].port=8989

./graphhopper.sh: 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(GraphHopper.java:474)
at com.graphhopper.http.GraphHopperManaged.(GraphHopperManaged.java:89)
at com.graphhopper.http.GraphHopperBundle.run(GraphHopperBundle.java:192)
at com.graphhopper.http.GraphHopperBundle.run(GraphHopperBundle.java:53)
at io.dropwizard.setup.Bootstrap.run(Bootstrap.java:200)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:42)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
at io.dropwizard.cli.Cli.run(Cli.java:78)
at io.dropwizard.Application.run(Application.java:93)
at com.graphhopper.http.GraphHopperApplication.main(GraphHopperApplication.java:36)

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

Thanks

Maybe just try setting graphhopper.datareader.file in the config.yml and see if the file is found? Also see this discussion: Command line arguments in graphhopper.sh not working with current config-example.yml · Issue #1921 · graphhopper/graphhopper · GitHub

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.

:sleepy:

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?

Thanks

@YannaY

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. graphhopper.sh ?
  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?