Is it possible to relaunch Graphhopper without deleting the gh folder?

Hi,

thanks for creating this excellent routing engine! It was easy to follow the instructions to either using a binary or github build

xxx://github.com/graphhopper/graphhopper/blob/master/docs/web/quickstart.md
xxx://github.com/graphhopper/graphhopper/blob/master/docs/core/quickstart-from-source.md

My issue is that for some reason I can only launch the software once. After the gh folder is created, running the same command causes an error (I would’ve assumed it would load much faster into the memory).

Am I missing something? The only workaround is to delete the berlin-latest.osm-gh folder and use the command again. Which is a bit hassle as soon as I’m trying to use north-america-latest (which takes a while to process).

1st launch

Mac environment

Settings:

  • berlin-latest.osm.pbf -> xxx://download.geofabrik.de/europe/germany/berlin.html
  • graphhopper-web-0.13-20190718.095513-95.jar -> xxx://oss.sonatype.org/content/groups/public/com/graphhopper/graphhopper-web/0.13-SNAPSHOT/
  • config-example.yml -> xxx://raw.githubusercontent.com/graphhopper/graphhopper/master/config-example.yml

Log:

retro:graphhopper lmuller$ java -Dgraphhopper.datareader.file=berlin-latest.osm.pbf -jar *.jar server config-example.yml
2019-07-18 15:44:42.607 [main] INFO  i.d.server.DefaultServerFactory - Registering jersey handler with root path prefix: /
2019-07-18 15:44:42.610 [main] INFO  i.d.server.DefaultServerFactory - Registering admin handler with root path prefix: /
2019-07-18 15:44:43.205 [main] INFO  i.d.b.assets.ConfiguredAssetsBundle - Registering ConfiguredAssetBundle with name: assets for path /maps/*
2019-07-18 15:44:43.218 [main] INFO  io.dropwizard.server.ServerFactory - Starting GraphHopperApplication
                        _     _
   __ _ _ __ __ _ _ __ | |__ | |__   ___  _ __  _ __   ___ _ __
  / _` | '__/ _` | '_ \| '_ \| '_ \ / _ \| '_ \| '_ \ / _ \ '__|
 | (_| | | | (_| | |_) | | | | | | | (_) | |_) | |_) |  __/ |
  \__, |_|  \__,_| .__/|_| |_|_| |_|\___/| .__/| .__/ \___|_|
  |___/          |_|                     |_|   |_|

2019-07-18 15:44:43.306 [main] INFO  o.e.jetty.setuid.SetUIDListener - Opened application@551e4c6d{HTTP/1.1,[http/1.1]}{localhost:8989}
2019-07-18 15:44:43.306 [main] INFO  o.e.jetty.setuid.SetUIDListener - Opened admin@625a9c5d{HTTP/1.1,[http/1.1]}{localhost:8990}
2019-07-18 15:44:43.308 [main] INFO  org.eclipse.jetty.server.Server - jetty-9.4.z-SNAPSHOT; built: 2019-04-29T20:42:08.989Z; git: e1bc35120a6617ee3df052294e433f3a25ce7097; jvm 1.8.0_181-b13
2019-07-18 15:44:43.335 [main] INFO  c.g.reader.osm.GraphHopperOSM - version 0.13|2019-07-18T09:47:06Z (5,14,4,3,3,2)
2019-07-18 15:44:43.341 [main] INFO  c.g.reader.osm.GraphHopperOSM - graph CH|car|RAM_STORE|2D|NoExt|,,,,, details:edges:0(0MB), nodes:0(0MB), name:(0MB), geo:0(0MB), bounds:1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308, CHGraph|fastest|car, shortcuts:0, nodesCH:(0MB)
2019-07-18 15:44:43.371 [main] INFO  c.g.reader.osm.GraphHopperOSM - start creating graph from berlin-latest.osm.pbf
2019-07-18 15:44:43.372 [main] INFO  c.g.reader.osm.GraphHopperOSM - using CH|car|RAM_STORE|2D|NoExt|,,,,, memory:totalMB:172, usedMB:45
2019-07-18 15:44:46.223 [main] INFO  com.graphhopper.reader.osm.OSMReader - creating graph. Found nodes (pillar+tower):248 721, totalMB:893, usedMB:264
2019-07-18 15:44:48.245 [main] INFO  com.graphhopper.reader.osm.OSMReader - 5 324 039, now parsing ways
2019-07-18 15:44:49.925 [main] INFO  com.graphhopper.reader.osm.OSMReader - 6 107 073, now parsing relations
2019-07-18 15:44:49.931 [main] INFO  com.graphhopper.reader.osm.OSMReader - finished way processing. nodes: 99066, osmIdMap.size:253043, osmIdMap:3MB, nodeFlagsMap.size:4322, relFlagsMap.size:0, zeroCounter:4322 totalMB:1365, usedMB:763
2019-07-18 15:44:49.938 [main] INFO  com.graphhopper.reader.osm.OSMReader - time pass1:2s, pass2:3s, total:6s
2019-07-18 15:44:49.940 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - start finding subnetworks (min:200, min one way:200) totalMB:1365, usedMB:764
2019-07-18 15:44:50.046 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - car-access|version=-1397436430|bits=1|index=0|shift=24|store_both_directions=true findComponents time:0.10617314, size:3536
2019-07-18 15:44:50.111 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - 12080 subnetworks found for car, totalMB:1365, usedMB:795
2019-07-18 15:44:50.130 [main] INFO  c.g.r.s.PrepareRoutingSubnetworks - optimize to remove subnetworks (12080), unvisited-dead-end-nodes (8930), maxEdges/node (6)
2019-07-18 15:44:50.175 [main] INFO  c.g.reader.osm.GraphHopperOSM - edges: 123 522, nodes 86 988, there were 12 080 subnetworks. removed them => 12 078 less nodes
2019-07-18 15:44:50.332 [main] INFO  c.g.storage.index.LocationIndexTree - location index created in 0.1477858s, size:104 739, leafs:7 808, precision:300, depth:4, checksum:86988, entries:[16, 16, 16, 4], entriesPerLeaf:13.414319
2019-07-18 15:44:50.345 [main] INFO  c.g.r.ch.CHAlgoFactoryDecorator - 1/1 calling node-based CH prepare.doWork for fastest|car ... (totalMB:1365, usedMB:824)
2019-07-18 15:44:50.820 [fastest_car_node] INFO  c.g.r.c.PrepareContractionHierarchies - nodes:     86 988, shortcuts:          0, updates:  0, checked-nodes:          0, t(total):   0.47,  t(period):   0.46, t(lazy):   0.00, t(neighbor):   0.00, t(contr):   0.00, t(other) :   0.02, dijkstra-ratio:  32.25%, meanDegree: 1.00, dijkstras:    346 895, mem:        1MB, totalMB:1365, usedMB:834
2019-07-18 15:44:52.532 [fastest_car_node] INFO  c.g.r.c.PrepareContractionHierarchies - nodes:     69 590, shortcuts:         14, updates:  1, checked-nodes:     17 398, t(total):   2.18,  t(period):   2.05, t(lazy):   0.00, t(neighbor):   0.06, t(contr):   0.02, t(other) :   0.06, dijkstra-ratio:  68.57%, meanDegree: 1.00, dijkstras:    635 588, mem:        1MB, totalMB:1365, usedMB:844
2019-07-18 15:44:54.319 [fastest_car_node] INFO  c.g.r.c.PrepareContractionHierarchies - nodes:     52 192, shortcuts:     10 609, updates:  2, checked-nodes:     34 796, t(total):   3.97,  t(period):   3.46, t(lazy):   0.00, t(neighbor):   0.21, t(contr):   0.20, t(other) :   0.10, dijkstra-ratio:  73.71%, meanDegree: 2.31, dijkstras:    894 002, mem:        1MB, totalMB:1365, usedMB:854
2019-07-18 15:44:55.882 [fastest_car_node] INFO  c.g.r.c.PrepareContractionHierarchies - nodes:     34 794, shortcuts:     25 127, updates:  3, checked-nodes:     52 194, t(total):   5.53,  t(period):   4.31, t(lazy):   0.00, t(neighbor):   0.52, t(contr):   0.56, t(other) :   0.15, dijkstra-ratio:  76.32%, meanDegree: 2.00, dijkstras:  1 119 857, mem:        1MB, totalMB:1365, usedMB:867
2019-07-18 15:44:57.213 [fastest_car_node] INFO  c.g.r.c.PrepareContractionHierarchies - nodes:     17 396, shortcuts:     49 891, updates:  4, checked-nodes:     69 592, t(total):   6.87,  t(period):   4.88, t(lazy):   0.00, t(neighbor):   0.89, t(contr):   0.90, t(other) :   0.18, dijkstra-ratio:  78.00%, meanDegree: 2.06, dijkstras:  1 348 173, mem:        1MB, totalMB:1365, usedMB:877
2019-07-18 15:44:58.520 [fastest_car_node] INFO  c.g.r.c.PrepareContractionHierarchies - nodes:      2 461, shortcuts:     76 799, updates:  5, checked-nodes:     86 990, t(total):   8.17,  t(period):   5.04, t(lazy):   0.30, t(neighbor):   1.37, t(contr):   1.25, t(other) :   0.22, dijkstra-ratio:  79.50%, meanDegree: 6.39, dijkstras:  1 667 221, mem:        1MB, totalMB:1365, usedMB:888
2019-07-18 15:44:59.616 [fastest_car_node] INFO  c.g.r.c.PrepareContractionHierarchies - nodes:          0, shortcuts:     86 917, updates:  5, checked-nodes:     90 518, t(total):   9.27,  t(period):   5.04, t(lazy):   0.62, t(neighbor):   1.93, t(contr):   1.45, t(other) :   0.22, dijkstra-ratio:  81.17%, meanDegree: 0.96, dijkstras:  1 885 175, mem:        1MB, totalMB:1365, usedMB:893
2019-07-18 15:44:59.617 [fastest_car_node] INFO  c.g.r.c.PrepareContractionHierarchies - new shortcuts: 86 917, initSize:86 988, prepare|fastest, periodic:20, lazy:10, neighbor:20, t(total):   9.27,  t(period):   5.04, t(lazy):   0.62, t(neighbor):   1.93, t(contr):   1.45, t(other) :   0.23, dijkstra-ratio:  81.16%, lazy-overhead: 4%, totalMB:1365, usedMB:893
2019-07-18 15:44:59.617 [fastest_car_node] INFO  c.g.r.c.PrepareContractionHierarchies - took: 9s, graph now - num edges: 123 522, num nodes: 86 988, num shortcuts: 86 917
2019-07-18 15:44:59.617 [main] INFO  c.g.reader.osm.GraphHopperOSM - flushing graph CH|car|RAM_STORE|2D|NoExt|5,14,4,3,3, details:edges:123 522(4MB), nodes:86 988(1MB), name:(1MB), geo:301 730(2MB), bounds:13.06978847242419,13.764083879383293,52.333058655255854,52.67961645900346, CHGraph|fastest|car, shortcuts:86 917, nodesCH:(1MB), totalMB:1365, usedMB:893)
2019-07-18 15:44:59.645 [main] INFO  c.g.reader.osm.GraphHopperOSM - flushed graph totalMB:1365, usedMB:927)
2019-07-18 15:44:59.646 [main] INFO  c.g.http.GraphHopperManaged - loaded graph at:berlin-latest.osm-gh, data_reader_file:berlin-latest.osm.pbf, encoded values:roundabout|version=2007680761|bits=1|index=0|shift=0|store_both_directions=false,road_class|version=-995933888|bits=5|index=0|shift=1|store_both_directions=false,road_class_link|version=1875788669|bits=1|index=0|shift=6|store_both_directions=false,road_environment|version=-892889145|bits=3|index=0|shift=7|store_both_directions=false,max_speed|version=1204350172|bits=5|index=0|shift=10|store_both_directions=true,road_access|version=-6677865|bits=4|index=0|shift=20|store_both_directions=false, edges:123 522(4MB), nodes:86 988(1MB), name:(1MB), geo:301 730(2MB), bounds:13.06978847242419,13.764083879383293,52.333058655255854,52.67961645900346, CHGraph|fastest|car, shortcuts:86 917, nodesCH:(1MB)
2019-07-18 15:45:00.190 [main] INFO  i.d.jersey.DropwizardResourceConfig - The following paths were found for the configured resources:

    GET     / (com.graphhopper.http.resources.RootResource)
    GET     /i18n (com.graphhopper.resources.I18NResource)
    GET     /i18n/{locale} (com.graphhopper.resources.I18NResource)
    GET     /info (com.graphhopper.resources.InfoResource)
    GET     /isochrone (com.graphhopper.resources.IsochroneResource)
    GET     /mvt/{z}/{x}/{y}.mvt (com.graphhopper.resources.MVTResource)
    GET     /nearest (com.graphhopper.resources.NearestResource)
    GET     /route (com.graphhopper.resources.RouteResource)
    GET     /spt (com.graphhopper.resources.SPTResource)

2019-07-18 15:45:00.191 [main] INFO  o.e.j.server.handler.ContextHandler - Started i.d.j.MutableServletContextHandler@4dc52559{/,null,AVAILABLE}
2019-07-18 15:45:00.195 [main] INFO  io.dropwizard.setup.AdminEnvironment - tasks =

    POST    /tasks/log-level (io.dropwizard.servlets.tasks.LogConfigurationTask)
    POST    /tasks/gc (io.dropwizard.servlets.tasks.GarbageCollectionTask)

2019-07-18 15:45:00.199 [main] INFO  o.e.j.server.handler.ContextHandler - Started i.d.j.MutableServletContextHandler@285a4fe3{/,null,AVAILABLE}
2019-07-18 15:45:00.215 [main] INFO  o.e.jetty.server.AbstractConnector - Started application@551e4c6d{HTTP/1.1,[http/1.1]}{localhost:8989}
2019-07-18 15:45:00.216 [main] INFO  o.e.jetty.server.AbstractConnector - Started admin@625a9c5d{HTTP/1.1,[http/1.1]}{localhost:8990}
2019-07-18 15:45:00.217 [main] INFO  org.eclipse.jetty.server.Server - Started @19653ms

== killed instance using Ctrl-C ==

^C2019-07-18 15:45:08.790 [Thread-11] INFO  o.e.jetty.server.AbstractConnector - Stopped application@551e4c6d{HTTP/1.1,[http/1.1]}{localhost:8989}
2019-07-18 15:45:08.792 [Thread-11] INFO  o.e.jetty.server.AbstractConnector - Stopped admin@625a9c5d{HTTP/1.1,[http/1.1]}{localhost:8990}
2019-07-18 15:45:08.793 [Thread-11] INFO  o.e.j.server.handler.ContextHandler - Stopped i.d.j.MutableServletContextHandler@285a4fe3{/,null,UNAVAILABLE}
2019-07-18 15:45:08.802 [Thread-11] INFO  o.e.j.server.handler.ContextHandler - Stopped i.d.j.MutableServletContextHandler@4dc52559{/,null,UNAVAILABLE}

2nd launch

retro:graphhopper lmuller$ java -Dgraphhopper.datareader.file=berlin-latest.osm.pbf -jar *.jar server config-example.yml
2019-07-18 15:45:15.741 [main] INFO  i.d.server.DefaultServerFactory - Registering jersey handler with root path prefix: /
2019-07-18 15:45:15.742 [main] INFO  i.d.server.DefaultServerFactory - Registering admin handler with root path prefix: /
2019-07-18 15:45:16.087 [main] INFO  i.d.b.assets.ConfiguredAssetsBundle - Registering ConfiguredAssetBundle with name: assets for path /maps/*
2019-07-18 15:45:16.095 [main] INFO  io.dropwizard.server.ServerFactory - Starting GraphHopperApplication
                        _     _
   __ _ _ __ __ _ _ __ | |__ | |__   ___  _ __  _ __   ___ _ __
  / _` | '__/ _` | '_ \| '_ \| '_ \ / _ \| '_ \| '_ \ / _ \ '__|
 | (_| | | | (_| | |_) | | | | | | | (_) | |_) | |_) |  __/ |
  \__, |_|  \__,_| .__/|_| |_|_| |_|\___/| .__/| .__/ \___|_|
  |___/          |_|                     |_|   |_|

2019-07-18 15:45:16.159 [main] INFO  o.e.jetty.setuid.SetUIDListener - Opened application@551e4c6d{HTTP/1.1,[http/1.1]}{localhost:8989}
2019-07-18 15:45:16.159 [main] INFO  o.e.jetty.setuid.SetUIDListener - Opened admin@625a9c5d{HTTP/1.1,[http/1.1]}{localhost:8990}
2019-07-18 15:45:16.161 [main] INFO  org.eclipse.jetty.server.Server - jetty-9.4.z-SNAPSHOT; built: 2019-04-29T20:42:08.989Z; git: e1bc35120a6617ee3df052294e433f3a25ce7097; jvm 1.8.0_181-b13
2019-07-18 15:45:16.195 [main] ERROR io.dropwizard.cli.ServerCommand - Unable to start server, shutting down
java.lang.IllegalStateException: Encoded values do not match:
Graphhopper config: roundabout|version=2007680761|bits=1|index=0|shift=0|store_both_directions=false,road_class|version=-644477472|bits=5|index=0|shift=1|store_both_directions=false,road_class_link|version=1875788669|bits=1|index=0|shift=6|store_both_directions=false,road_environment|version=-1410007715|bits=3|index=0|shift=7|store_both_directions=false,max_speed|version=1204350172|bits=5|index=0|shift=10|store_both_directions=true,road_access|version=1747147331|bits=4|index=0|shift=20|store_both_directions=false
Graph: roundabout|version=2007680761|bits=1|index=0|shift=0|store_both_directions=false,road_class|version=-995933888|bits=5|index=0|shift=1|store_both_directions=false,road_class_link|version=1875788669|bits=1|index=0|shift=6|store_both_directions=false,road_environment|version=-892889145|bits=3|index=0|shift=7|store_both_directions=false,max_speed|version=1204350172|bits=5|index=0|shift=10|store_both_directions=true,road_access|version=-6677865|bits=4|index=0|shift=20|store_both_directions=false
Change configuration to match the graph or delete berlin-latest.osm-gh/
at com.graphhopper.storage.GraphHopperStorage.loadExisting(GraphHopperStorage.java:266)
at com.graphhopper.GraphHopper.load(GraphHopper.java:772)
at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:629)
at com.graphhopper.http.GraphHopperManaged.start(GraphHopperManaged.java:74)
at io.dropwizard.lifecycle.JettyManaged.doStart(JettyManaged.java:27)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
at org.eclipse.jetty.server.Server.start(Server.java:418)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:382)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:53)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:44)
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)
java.lang.IllegalStateException: Encoded values do not match:
Graphhopper config: roundabout|version=2007680761|bits=1|index=0|shift=0|store_both_directions=false,road_class|version=-644477472|bits=5|index=0|shift=1|store_both_directions=false,road_class_link|version=1875788669|bits=1|index=0|shift=6|store_both_directions=false,road_environment|version=-1410007715|bits=3|index=0|shift=7|store_both_directions=false,max_speed|version=1204350172|bits=5|index=0|shift=10|store_both_directions=true,road_access|version=1747147331|bits=4|index=0|shift=20|store_both_directions=false
Graph: roundabout|version=2007680761|bits=1|index=0|shift=0|store_both_directions=false,road_class|version=-995933888|bits=5|index=0|shift=1|store_both_directions=false,road_class_link|version=1875788669|bits=1|index=0|shift=6|store_both_directions=false,road_environment|version=-892889145|bits=3|index=0|shift=7|store_both_directions=false,max_speed|version=1204350172|bits=5|index=0|shift=10|store_both_directions=true,road_access|version=-6677865|bits=4|index=0|shift=20|store_both_directions=false
Change configuration to match the graph or delete berlin-latest.osm-gh/
at com.graphhopper.storage.GraphHopperStorage.loadExisting(GraphHopperStorage.java:266)
at com.graphhopper.GraphHopper.load(GraphHopper.java:772)
at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:629)
at com.graphhopper.http.GraphHopperManaged.start(GraphHopperManaged.java:74)
at io.dropwizard.lifecycle.JettyManaged.doStart(JettyManaged.java:27)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
at org.eclipse.jetty.server.Server.start(Server.java:418)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:119)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:382)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at io.dropwizard.cli.ServerCommand.run(ServerCommand.java:53)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:44)
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)

Can you try with this version: https://github.com/graphhopper/graphhopper/commit/2a971fc4043f9a003338e663fb9dfe9a32649e10 ?

This looks to be the same as [Android v 0.13] Cannot find EncodedValue roundabout in collection: null

1 Like

Easbar: Thanks! I build it from that commit and it relaunches fine on my Mac OS 10.14.5

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.