Docker ExecutionException

Greetings,

Trying to follow the installation instructions to build a docker installation, I got stuck with the following error ERROR [routing.RoutingProfileManager] - java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: already initialized

app.config

{
“ors”:{
“info”:{
“base_url”:“https://openrouteservice.org/”,
support_mail":"support@openrouteservice.org”,
“author_tag”:“openrouteservice”,
“content_licence”:“LGPL 3.0”
},
“services”:{
“matrix”:{
“enabled”:true,
“maximum_locations”:200,
“maximum_visited_nodes”:100000,
“allow_resolve_locations”:true,
“attribution”:“openrouteservice.org, OpenStreetMap contributors”
},
“isochrones”:{
“enabled”:true,
“maximum_range_distance”:[
{
“profiles”:“any”,
“value”:50000
},
{
“profiles”:“driving-hgv”,
“value”:100000
}
],
“maximum_range_time”:[
{
“profiles”:“any”,
“value”:18000
},
{
“profiles”:“driving-hgv”,
“value”:3600
}
],
“maximum_intervals”:10,
“maximum_locations”:2,
“allow_compute_area”:true,
“attribution”:“openrouteservice.org, OpenStreetMap contributors”
},
“routing”:{
“enabled”:true,
“mode”:“normal”,
“sources”:[
“data/europe-latest.osm.pbf”
],
“init_threads”:2,
“attribution”:“openrouteservice.org, OpenStreetMap contributors”,
“distance_approximation”:true,
“profiles”:{
“active”:[
“vehicles-hgv”
],
“default_params”:{
“encoder_flags_size”:8,
“graphs_root_path”:“data/graphs”,
“elevation_provider”:“multi”,
“elevation_cache_path”:“data/elevation_cache”,
“elevation_clear_cache”:true,
“instructions”:true,
“maximum_distance”:6000000,
“maximum_segment_distance_with_dynamic_weights”:100000,
“maximum_alternative_routes”: 3,
“maximum_waypoints”:100
},
“profile-vehicles-hgv”:{
“profiles”:“driving-hgv”,
“parameters”:{
“encoder_options”:“consider_elevation=true|turn_costs=true|block_fords=false|use_acceleration=true”,
“elevation”:true,
“preparation”:{
“min_network_size”:200,
“min_one_way_network_size”:200,
“methods”:{
“ch”:{
“enabled”:true,
“threads”:8,
“weightings”:“recommended”
},
“lm”:{
“enabled”:true,
“threads”:8,
“weightings”:“recommended,fastest,shortest”,
“landmarks”:24
}
}
},
“execution”:{
“methods”:{
“astar”:{
“approximation”:“BeelineSimplification”,
“epsilon”:1
},
“ch”:{
“disabling_allowed”:true
},
“lm”:{
“disabling_allowed”:true,
“active_landmarks”:6
}
}
},
“ext_storages”:{
“WayCategory”:{},
“HeavyVehicle”:{
“restrictions”:true
},
“WaySurfaceType”:{},
“Tollways”:{},
“RoadAccessRestrictions”: {
“use_for_warnings”: true
}
}
}
}
}
}
},
“logging”:{
“enabled”:true,
“level_file”:“PRODUCTION_LOGGING.json”,
“location”:"/var/log/ors",
“stdout”:true
}
}
}

docker logs ors-app:

02 Oct 15:16:31 ERROR [routing.RoutingProfileManager] - java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: already initialized
[GC (Allocation Failure) 35247038K->35245365K(47180800K), 19.9689586 secs]
java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: already initialized
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at heigit.ors.routing.RoutingProfileManager.initialize(RoutingProfileManager.java:218)
at heigit.ors.routing.RoutingProfileManager.getInstance(RoutingProfileManager.java:66)
at heigit.ors.servlet.listeners.ORSInitContextListener.lambda$contextInitialized$0(ORSInitContextListener.java:43)
at java.lang.Thread.run(Thread.java:748)
[GC (Allocation Failure) 35574988K->35573046K(47180800K), 16.7544876 secs]
Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: already initialized
at com.graphhopper.routing.lm.LMAlgoFactoryDecorator.loadOrDoWork(LMAlgoFactoryDecorator.java:304)
at com.graphhopper.GraphHopper.loadOrPrepareLM(GraphHopper.java:1329)
at com.graphhopper.GraphHopper.postProcessing(GraphHopper.java:942)
at heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.postProcessing(ORSGraphHopper.java:497)
at com.graphhopper.GraphHopper.process(GraphHopper.java:719)
at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:688)
at heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.importOrLoad(ORSGraphHopper.java:158)
at heigit.ors.routing.RoutingProfile.initGraphHopper(RoutingProfile.java:185)
at heigit.ors.routing.RoutingProfile.(RoutingProfile.java:130)
at heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:37)
at heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:21)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
… 1 more
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: already initialized
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at com.graphhopper.routing.lm.LMAlgoFactoryDecorator.loadOrDoWork(LMAlgoFactoryDecorator.java:300)
… 16 more
Caused by: java.lang.IllegalStateException: already initialized
at com.graphhopper.storage.RAMDataAccess.loadExisting(RAMDataAccess.java:118)
at com.graphhopper.routing.lm.LandmarkStorage.loadExisting(LandmarkStorage.java:660)
at com.graphhopper.routing.lm.PrepareLandmarks.loadExisting(PrepareLandmarks.java:124)
at com.graphhopper.routing.lm.LMAlgoFactoryDecorator$1.run(LMAlgoFactoryDecorator.java:284)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
… 6 more

Hi @hamzarhaiem,
I’m not 100% sure why that error would come up, but at first look it seems that openrouteservice is either trying to load the profile twice, or it is trying to load some graph data that hasn’t been built properly. The main things I would suggest is to make sure that you are only running one instance of openrouteservice, and if that is true, then I would suggest dropping the init_threads property in the config file down to 1 as that can sometimes cause problems in Docker. If that still doesn’t work, then I would suggest deleting the contents of the graphs folder and then trying to build them again by restarting the container.

1 Like

Hi Adam and thanks for your answer,
I dropped init_threads from 2 to 1 and threads from 8 to 1 too! Is there any difference between the two parametres?

“init_threads”: 1,

“methods”:{
“ch”:{
“enabled”:true,
“threads”:1,
“weightings”:“recommended”
},
“lm”:{
“enabled”:true,
“threads”:1,
“weightings”:“recommended,fastest,shortest”,
“landmarks”:24
}

With that change made i have the same error again and again:

ERROR [routing.RoutingProfileManager] - java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: already initialized

I am doubting in weightings as i try to generate 3 different one (recommended,fastest,shortest) and the same one in ch and lm (the recommended one).

Need help!