java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: Index 1048576 out of bounds for length 1048576

i am getting this below error if i use my custom pbf file with hgv profile.

| 01 Jun 17:26:51 INFO [ors.Application] - Starting Application v6.7.0 on 32c8b702c86f with PID 138 (/usr/local/tomcat/webapps/ors/WEB-INF/classes started by root in /ors-core)
ors-app | 01 Jun 17:26:51 DEBUG [ors.Application] - Running with Spring Boot v2.3.5.RELEASE, Spring v5.2.10.RELEASE
ors-app | 01 Jun 17:26:51 INFO [ors.Application] - No active profile set, falling back to default profiles: default
ors-app | SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
ors-app | SLF4J: Defaulting to no-operation (NOP) logger implementation
ors-app | SLF4J: See SLF4J Error Codes for further details.
ors-app | 01 Jun 17:26:54 INFO [ors.Application] - Started Application in 4.227 seconds (JVM running for 11.069)
ors-app | 01 Jun 17:26:54 INFO [logging.LoggingUtility] - Logging configuration loaded from DEBUG_LOGGING.json, logging to file /var/log/ors/ors-logs.log
ors-app | 01 Jun 17:26:54 INFO [routing.RoutingProfileManager] - Total - 1.00 GB, Free - 663.61 MB, Max: 2 GB, Used - 362.39 MB
ors-app | 01 Jun 17:26:54 INFO [routing.RoutingProfileManager] -
ors-app | 01-Jun-2022 17:26:54.822 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/ors.war] has finished in [10,104] ms
ors-app | 01-Jun-2022 17:26:54.824 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/ROOT]
ors-app | 01-Jun-2022 17:26:54.843 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/ROOT] has finished in [19] ms
ors-app | 01-Jun-2022 17:26:54.844 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/docs]
ors-app | 01-Jun-2022 17:26:54.860 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/docs] has finished in [16] ms
ors-app | 01-Jun-2022 17:26:54.860 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/host-manager]
ors-app | 01 Jun 17:26:54 INFO [routing.RoutingProfileManager] - ====> Initializing profiles from ‘data/osm_file.pbf’ (1 threads) …
ors-app | 01 Jun 17:26:54 INFO [routing.RoutingProfileManager] -
ors-app | 01 Jun 17:26:54 INFO [routing.RoutingProfileManager] -
ors-app | 01-Jun-2022 17:26:54.887 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/host-manager] has finished in [27] ms
ors-app | 01-Jun-2022 17:26:54.888 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/manager]
ors-app | 01 Jun 17:26:54 INFO [routing.RoutingProfile] - [1] Profiles: ‘driving-hgv’, location: ‘data/graphs/hgv’.
ors-app | 01-Jun-2022 17:26:54.906 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/manager] has finished in [18] ms
ors-app | 01-Jun-2022 17:26:54.907 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/examples]
ors-app | 01-Jun-2022 17:26:55.086 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/examples] has finished in [179] ms
ors-app | 01-Jun-2022 17:26:55.091 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [“http-nio-8080”]
ors-app | 01-Jun-2022 17:26:55.100 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 10449 ms
ors-app | 01 Jun 17:28:40 WARN [extensions.ORSOSMReader] - Index 1048576 out of bounds for length 1048576. Way id = 363083979
ors-app | 01 Jun 17:29:01 ERROR [routing.RoutingProfileManager] - java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: Index 1048576 out of bounds for length 1048576
ors-app | 01 Jun 17:29:01 ERROR [routing.RoutingProfileManager] - Failed to initialize RoutingProfileManager instance.
ors-app | java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: Index 1048576 out of bounds for length 1048576
ors-app | at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
ors-app | at java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
ors-app | at org.heigit.ors.routing.RoutingProfileManager.initialize(RoutingProfileManager.java:178) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.RoutingProfileManager.getInstance(RoutingProfileManager.java:72) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.servlet.listeners.ORSInitContextListener.lambda$contextInitialized$0(ORSInitContextListener.java:42) ~[classes/:6.7.0]
ors-app | at java.lang.Thread.run(Thread.java:829) [?:?]
ors-app | Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: Index 1048576 out of bounds for length 1048576
ors-app | at org.heigit.ors.routing.graphhopper.extensions.core.CoreAlgoFactoryDecorator.prepare(CoreAlgoFactoryDecorator.java:314) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.prepareCore(ORSGraphHopper.java:787) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.postProcessing(ORSGraphHopper.java:690) ~[classes/:6.7.0]
ors-app | at com.graphhopper.GraphHopper.process(GraphHopper.java:703) ~[graphhopper-core-v0.13.21.jar:?]
ors-app | at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:680) ~[graphhopper-core-v0.13.21.jar:?]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.importOrLoad(ORSGraphHopper.java:169) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.RoutingProfile.initGraphHopper(RoutingProfile.java:182) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.RoutingProfile.(RoutingProfile.java:126) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:35) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:21) ~[classes/:6.7.0]
ors-app | at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
ors-app | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
ors-app | at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
ors-app | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
ors-app | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
ors-app | … 1 more
ors-app | Caused by: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: Index 1048576 out of bounds for length 1048576
ors-app | at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
ors-app | at java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.core.CoreAlgoFactoryDecorator.prepare(CoreAlgoFactoryDecorator.java:310) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.prepareCore(ORSGraphHopper.java:787) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.postProcessing(ORSGraphHopper.java:690) ~[classes/:6.7.0]
ors-app | at com.graphhopper.GraphHopper.process(GraphHopper.java:703) ~[graphhopper-core-v0.13.21.jar:?]
ors-app | at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:680) ~[graphhopper-core-v0.13.21.jar:?]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.importOrLoad(ORSGraphHopper.java:169) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.RoutingProfile.initGraphHopper(RoutingProfile.java:182) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.RoutingProfile.(RoutingProfile.java:126) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:35) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:21) ~[classes/:6.7.0]
ors-app | at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
ors-app | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
ors-app | at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
ors-app | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
ors-app | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
ors-app | … 1 more
ors-app | Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1048576 out of bounds for length 1048576
ors-app | at com.graphhopper.util.BitUtilLittle.toShort(BitUtilLittle.java:32) ~[graphhopper-core-v0.13.21.jar:?]
ors-app | at com.graphhopper.storage.RAMDataAccess.getShort(RAMDataAccess.java:225) ~[graphhopper-core-v0.13.21.jar:?]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.storages.HeavyVehicleAttributesGraphStorage.hasEdgeRestriction(HeavyVehicleAttributesGraphStorage.java:163) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.edgefilters.core.HeavyVehicleCoreEdgeFilter.accept(HeavyVehicleCoreEdgeFilter.java:33) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.edgefilters.EdgeFilterSequence.accept(EdgeFilterSequence.java:29) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.core.PrepareCore.prepareNodes(PrepareCore.java:190) ~[classes/:6.7.0]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.core.PrepareCore.doSpecificWork(PrepareCore.java:175) ~[classes/:6.7.0]
ors-app | at com.graphhopper.routing.util.AbstractAlgoPreparation.doWork(AbstractAlgoPreparation.java:30) ~[graphhopper-core-v0.13.21.jar:?]
ors-app | at org.heigit.ors.routing.graphhopper.extensions.core.CoreAlgoFactoryDecorator.lambda$prepare$0(CoreAlgoFactoryDecorator.java:300) ~[classes/:6.7.0]
ors-app | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
ors-app | at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
ors-app | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
ors-app | at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
ors-app | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
ors-app | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
ors-app | … 1 more
ors-app | 01 Jun 17:29:01 INFO [routing.RoutingProfileManager] - ====> Recycling garbage…
ors-app | 01 Jun 17:29:01 INFO [routing.RoutingProfileManager] - Before: Total - 1.52 GB, Free - 1.31 GB, Max: 2 GB, Used - 217.96 MB
ors-app | 01 Jun 17:29:01 INFO [routing.RoutingProfileManager] - After: Total - 1024 MB, Free - 874.15 MB, Max: 2 GB, Used - 149.86 MB
ors-app | 01 Jun 17:29:01 INFO [routing.RoutingProfileManager] - ========================================================================
ors-app | 01 Jun 17:29:01 INFO [routing.RoutingProfileManager] - ====> Memory usage by profiles:
ors-app | 01 Jun 17:29:01 INFO [routing.RoutingProfileManager] - Total: 0 B (0.0%)
ors-app | 01 Jun 17:29:01 INFO [routing.RoutingProfileManager] - ========================================================================

Please help me in this.

Thanks for reaching out!

In order to investigate the issue we would need to reproduce it. Therefore, could you maybe provide the pbf file you mentioned along with the openrouteservice config file you use for the build?

Cheers!
Andrzej

1 Like

my config file -

{
“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_routes”: 1000000,
“maximum_routes_flexible”: 25,
“maximum_search_radius”: 5000,
“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-car, driving-hgv”,
“value”: 100000
}
],
“maximum_range_time”: [
{
“profiles”: “any”,
“value”: 18000
},
{
“profiles”: “driving-car, driving-hgv”,
“value”: 3600
}
],
“fastisochrones”: {
“maximum_range_distance”: [
{
“profiles”: “any”,
“value”: 50000
},
{
“profiles”: “driving-car, driving-hgv”,
“value”: 500000
}
],
“maximum_range_time”: [
{
“profiles”: “any”,
“value”: 18000
},
{
“profiles”: “driving-car, driving-hgv”,
“value”: 10800
}
],
“profiles”: {
“default_params”: {
“enabled”: false,
“threads”: 12,
“weightings”: “recommended”,
“maxcellnodes”: 5000
},
“profile-hgv”: {
“enabled”: false,
“threads”: 12,
“weightings”: “recommended, shortest”,
“maxcellnodes”: 5000
}
}
},
“maximum_intervals”: 10,
“maximum_locations”: 2,
“allow_compute_area”: true
},
“routing”: {
“enabled”: true,
“mode”: “normal”,
“routing_description”: “This is a routing file from openrouteservice”,
“routing_name”: “openrouteservice routing”,
“sources”: [
“data/osm_file.pbf”
],
“init_threads”: 1,
“attribution”: “openrouteservice.org, OpenStreetMap contributors”,
“elevation_preprocessed”: false,
“profiles”: {
“active”: [
“hgv”
],
“default_params”: {
“encoder_flags_size”: 8,
“graphs_root_path”: “data/graphs”,
“elevation_provider”: “multi”,
“elevation_cache_path”: “data/elevation_cache”,
“elevation_cache_clear”: false,
“instructions”: true,
“maximum_distance”: 100000,
“maximum_distance_dynamic_weights”: 100000,
“maximum_distance_avoid_areas”: 100000,
“maximum_waypoints”: 50,
“maximum_snapping_radius”: 400,
“maximum_avoid_polygon_area”: 200000000,
“maximum_avoid_polygon_extent”: 20000,
“maximum_distance_alternative_routes”: 100000,
“maximum_alternative_routes”: 3,
“maximum_distance_round_trip_routes”: 100000,
“maximum_speed_lower_bound”: 80,
“preparation”: {
“min_network_size”: 200,
“min_one_way_network_size”: 200,
“methods”: {
“lm”: {
“enabled”: true,
“threads”: 1,
“weightings”: “recommended,shortest”,
“landmarks”: 16
}
}
},
“execution”: {
“methods”: {
“lm”: {
“disabling_allowed”: true,
“active_landmarks”: 8
}
}
}
},
“profile-car”: {
“profiles”: “driving-car”,
“parameters”: {
“encoder_flags_size”: 8,
“encoder_options”: “turn_costs=true|block_fords=false|use_acceleration=true”,
“maximum_distance”: 100000,
“elevation”: true,
“maximum_snapping_radius”: 350,
“preparation”: {
“min_network_size”: 200,
“min_one_way_network_size”: 200,
“methods”: {
“ch”: {
“enabled”: true,
“threads”: 1,
“weightings”: “fastest”
},
“lm”: {
“enabled”: false,
“threads”: 1,
“weightings”: “fastest,shortest”,
“landmarks”: 16
},
“core”: {
“enabled”: true,
“threads”: 1,
“weightings”: “fastest,shortest”,
“landmarks”: 64,
“lmsets”: “highways;allow_all”
}
}
},
“execution”: {
“methods”: {
“ch”: {
“disabling_allowed”: true
},
“lm”: {
“disabling_allowed”: true,
“active_landmarks”: 6
},
“core”: {
“disabling_allowed”: true,
“active_landmarks”: 6
}
}
},
“ext_storages”: {
“WayCategory”: {},
“HeavyVehicle”: {},
“WaySurfaceType”: {},
“RoadAccessRestrictions”: {
“use_for_warnings”: true
}
}
}
},
“profile-hgv”: {
“profiles”: “driving-hgv”,
“parameters”: {
“encoder_flags_size”: 8,
“encoder_options”: “turn_costs=true|block_fords=false|use_acceleration=true”,
“maximum_distance”: 100000,
“elevation”: true,
“preparation”: {
“min_network_size”: 200,
“min_one_way_network_size”: 200,
“methods”: {
“ch”: {
“enabled”: true,
“threads”: 1,
“weightings”: “recommended”
},
“core”: {
“enabled”: true,
“threads”: 1,
“weightings”: “recommended,shortest”,
“landmarks”: 64,
“lmsets”: “highways;allow_all”
}
}
},
“execution”: {
“methods”: {
“ch”: {
“disabling_allowed”: true
},
“core”: {
“disabling_allowed”: true,
“active_landmarks”: 6
}
}
},
“ext_storages”: {
“WayCategory”: {},
“HeavyVehicle”: {
“restrictions”: true
},
“WaySurfaceType”: {}
}
}
},
“profile-bike-regular”: {
“profiles”: “cycling-regular”,
“parameters”: {
“encoder_options”: “consider_elevation=true|turn_costs=true|block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-bike-mountain”: {
“profiles”: “cycling-mountain”,
“parameters”: {
“encoder_options”: “consider_elevation=true|turn_costs=true|block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-bike-road”: {
“profiles”: “cycling-road”,
“parameters”: {
“encoder_options”: “consider_elevation=true|turn_costs=true|block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-bike-electric”: {
“profiles”: “cycling-electric”,
“parameters”: {
“encoder_options”: “consider_elevation=true|turn_costs=true|block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-walking”: {
“profiles”: “foot-walking”,
“parameters”: {
“encoder_options”: “block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-hiking”: {
“profiles”: “foot-hiking”,
“parameters”: {
“encoder_options”: “block_fords=false”,
“elevation”: true,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“HillIndex”: {},
“TrailDifficulty”: {}
}
}
},
“profile-wheelchair”: {
“profiles”: “wheelchair”,
“parameters”: {
“encoder_options”: “block_fords=true”,
“elevation”: true,
“maximum_snapping_radius”: 50,
“ext_storages”: {
“WayCategory”: {},
“WaySurfaceType”: {},
“Wheelchair”: {
“KerbsOnCrossings”: “true”
},
“OsmId”: {}
}
}
}
}
}
},
“logging”: {
“enabled”: true,
“level_file”: “DEBUG_LOGGING.json”,
“location”: “/var/log/ors”,
“stdout”: true
},
“system_message”: [
{
“active”: false,
“text”: “This message would be sent with every routing bike fastest request”,
“condition”: {
“request_service”: “routing”,
“request_profile”: “cycling-regular,cycling-mountain,cycling-road,cycling-electric”,
“request_preference”: “fastest”
}
},
{
“active”: false,
“text”: “This message would be sent with every request for geojson response”,
“condition”: {
“api_format”: “geojson”
}
},
{
“active”: false,
“text”: “This message would be sent with every request on API v1 from January 2020 until June 2050”,
“condition”: {
“api_version”: 1,
“time_after”: “2020-01-01T00:00:00Z”,
“time_before”: “2050-06-01T00:00:00Z”
}
},
{
“active”: false,
“text”: “This message would be sent with every request”
}
]
}
}

docker-compose.yml below -

version: ‘2.4’
services:
ors-app:
container_name: ors-app
ports:
- 8080:8080
- 9001:9001
image: openrouteservice/openrouteservice:latest
build:
context: …/
args:
ORS_CONFIG: ./openrouteservice/src/main/resources/ors-config-sample.json
OSM_FILE: ./openrouteservice/src/main/files/bengaluru.pbf
user: “${ORS_UID:-0}:${ORS_GID:-0}”
volumes:
- ./graphs:/ors-core/data/graphs
- ./elevation_cache:/ors-core/data/elevation_cache
- ./logs/ors:/var/log/ors
- ./logs/tomcat:/usr/local/tomcat/logs
- ./conf:/ors-conf
#- ./your_osm.pbf:/ors-core/data/osm_file.pbf
environment:
- BUILD_GRAPHS=False # Forces the container to rebuild the graphs, e.g. when PBF is changed
- “JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g”
- “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”

my pbf file link - Easyupload.io - Upload files for free and transfer big files easily.

Thank you for providing the data illustrating the problem. I was able to reproduce the error and I’ve opened a dedicated issue on GitHub in order to keep track of it. It looks like an actual bug to me. I will try to look into it sometime next week, so stay tuned.

In the meantime, in order to circumvent the issue and be able to build the graph you could disable the core routing algorithm in your config file.

Cheers,
Andrzej

1 Like

thanks . i have cloned new repository and that error gone but now new error is coming. i am using hgv profile.

post url - http://localhost:8080/ors/v2/matrix/driving-hgv
request body in json -

{
    "locations": [
      [
        77.6450753832665,
        12.890161192241047
      ],
      [
        77.58014653879195,
        12.93696097321439
      ],
      [
        77.7211134,
        12.9342266
      ],
      [
        77.61899183967064,
        12.942851647333391
      ]
    ],
    "sources": [
      0
    ],
    "metrics": [
      "distance"
    ],
    "units": "km"
  }
error response i got - {
    "error": {
        "code": 6099,
        "message": "Unable to compute a distance/duration matrix."
    },
    "info": {
        "engine": {
            "version": "6.7.0",
            "build_date": "2022-07-01T16:32:53Z"
        },
        "timestamp": 1656697880409
    }
}

my pbf file is - Easyupload.io - Upload files for free and transfer big files easily.

my docker file -

FROM openjdk:11-jdk

ENV MAVEN_OPTS="-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
ENV MAVEN_CLI_OPTS="--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"

ARG ORS_CONFIG=./openrouteservice/src/main/resources/ors-config-sample.json
ARG OSM_FILE=./openrouteservice/src/main/files/bengaluru.pbf
ENV BUILD_GRAPHS="False"
ARG UID=1000
ARG TOMCAT_VERSION=8.5.69

# Create user
RUN useradd -u $UID -md /ors-core ors

# Create directories
RUN mkdir -p /usr/local/tomcat /ors-conf /var/log/ors && \
    chown ors:ors /usr/local/tomcat /ors-conf /var/log/ors

# Install dependencies and locales
RUN apt-get update -qq && \
    apt-get install -qq -y locales nano maven moreutils jq && \
    rm -rf /var/lib/apt/lists/* && \
    locale-gen en_US.UTF-8

USER ors:ors
WORKDIR /ors-core

COPY --chown=ors:ors openrouteservice /ors-core/openrouteservice
COPY --chown=ors:ors $OSM_FILE /ors-core/data/osm_file.pbf
COPY --chown=ors:ors $ORS_CONFIG /ors-core/openrouteservice/src/main/resources/ors-config-sample.json
COPY --chown=ors:ors ./docker-entrypoint.sh /ors-core/docker-entrypoint.sh

# Install tomcat
RUN wget -q https://archive.apache.org/dist/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz -O /tmp/tomcat.tar.gz && \
    cd /tmp && \
    tar xvfz tomcat.tar.gz && \
    cp -R /tmp/apache-tomcat-${TOMCAT_VERSION}/* /usr/local/tomcat/ && \
    rm -r /tmp/tomcat.tar.gz /tmp/apache-tomcat-${TOMCAT_VERSION}

# Configure ors config
RUN cp /ors-core/openrouteservice/src/main/resources/ors-config-sample.json /ors-core/openrouteservice/src/main/resources/ors-config.json && \
    # Replace paths in ors-config.json to match docker setup
    jq '.ors.services.routing.sources[0] = "data/osm_file.pbf"' /ors-core/openrouteservice/src/main/resources/ors-config.json |sponge /ors-core/openrouteservice/src/main/resources/ors-config.json && \
    jq '.ors.services.routing.profiles.default_params.elevation_cache_path = "data/elevation_cache"' /ors-core/openrouteservice/src/main/resources/ors-config.json |sponge /ors-core/openrouteservice/src/main/resources/ors-config.json && \
    jq '.ors.services.routing.profiles.default_params.graphs_root_path = "data/graphs"' /ors-core/openrouteservice/src/main/resources/ors-config.json |sponge /ors-core/openrouteservice/src/main/resources/ors-config.json && \
    # init_threads = 1, > 1 been reported some issues
    jq '.ors.services.routing.init_threads = 1' /ors-core/openrouteservice/src/main/resources/ors-config.json |sponge /ors-core/openrouteservice/src/main/resources/ors-config.json && \

    # Delete all profiles but car
    jq 'del(.ors.services.routing.profiles.active[1,2,3,4,5,6,7,8])' /ors-core/openrouteservice/src/main/resources/ors-config.json |sponge /ors-core/openrouteservice/src/main/resources/ors-config.json

# Make all directories writable, to allow the usage of other uids via "docker run -u"
RUN chmod -R go+rwX /ors-core /ors-conf /usr/local/tomcat /var/log/ors

# Define volumes
VOLUME ["/ors-core/data/graphs", "/ors-core/data/elevation_cache", "/ors-conf", "/usr/local/tomcat/logs", "/var/log/ors"]

# Start the container
EXPOSE 8080
ENTRYPOINT ["/bin/bash", "/ors-core/docker-entrypoint.sh"]

docker-compose.yml file-

version: '2.4'
services:
  ors-app:
    container_name: ors-app
    ports:
      - 8080:8080
      - 9001:9001
    image: openrouteservice/openrouteservice:latest
    build:
      context: ../
      args:
        ORS_CONFIG: ./openrouteservice/src/main/resources/ors-config-sample.json
        OSM_FILE: ./openrouteservice/src/main/files/bengaluru.pbf
    user: "${ORS_UID:-0}:${ORS_GID:-0}"
    volumes:
      - ./graphs:/ors-core/data/graphs
      - ./elevation_cache:/ors-core/data/elevation_cache
      - ./logs/ors:/var/log/ors
      - ./logs/tomcat:/usr/local/tomcat/logs
      - ./conf:/ors-conf
      # - ./your_osm.pbf:/ors-core/data/osm_file.pbf
    environment:
      - BUILD_GRAPHS=False  # Forces the container to rebuild the graphs, e.g. when PBF is changed
      - "JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:ParallelGCThreads=4 -Xms1g -Xmx2g"
      - "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"

my ors-config.json file is -

{
  "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_routes": 1000000,
        "maximum_routes_flexible": 25,
        "maximum_search_radius": 5000,
        "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-car, driving-hgv",
            "value": 100000
          }
        ],
        "maximum_range_time": [
          {
            "profiles": "any",
            "value": 18000
          },
          {
            "profiles": "driving-car, driving-hgv",
            "value": 3600
          }
        ],
        "fastisochrones": {
          "maximum_range_distance": [
            {
              "profiles": "any",
              "value": 50000
            },
            {
              "profiles": "driving-car, driving-hgv",
              "value": 500000
            }
          ],
          "maximum_range_time": [
            {
              "profiles": "any",
              "value": 18000
            },
            {
              "profiles": "driving-car, driving-hgv",
              "value": 10800
            }
          ],
          "profiles": {
            "default_params": {
              "enabled": false,
              "threads": 12,
              "weightings": "recommended",
              "maxcellnodes": 5000
            },
            "profile-hgv": {
              "enabled": false,
              "threads": 12,
              "weightings": "recommended, shortest",
              "maxcellnodes": 5000
            }
          }
        },
        "maximum_intervals": 10,
        "maximum_locations": 2,
        "allow_compute_area": true
      },
      "routing": {
        "enabled": true,
        "mode": "normal",
        "routing_description": "This is a routing file from openrouteservice",
        "routing_name": "openrouteservice routing",
        "sources": [
          "data/osm_file.pbf"
        ],
        "init_threads": 1,
        "attribution": "openrouteservice.org, OpenStreetMap contributors",
        "elevation_preprocessed": false,
        "profiles": {
          "active": [
            "hgv"
          ],
          "default_params": {
            "encoder_flags_size": 8,
            "graphs_root_path": "data/graphs",
            "elevation_provider": "multi",
            "elevation_cache_path": "data/elevation_cache",
            "elevation_cache_clear": false,
            "instructions": true,
            "maximum_distance": 100000,
            "maximum_distance_dynamic_weights": 100000,
            "maximum_distance_avoid_areas": 100000,
            "maximum_waypoints": 50,
            "maximum_snapping_radius": 400,
            "maximum_avoid_polygon_area": 200000000,
            "maximum_avoid_polygon_extent": 20000,
            "maximum_distance_alternative_routes": 100000,
            "maximum_alternative_routes": 3,
            "maximum_distance_round_trip_routes": 100000,
            "maximum_speed_lower_bound": 80,
            "preparation": {
              "min_network_size": 200,
              "min_one_way_network_size": 200,
              "methods": {
                "lm": {
                  "enabled": true,
                  "threads": 1,
                  "weightings": "recommended,shortest",
                  "landmarks": 16
                }
              }
            },
            "execution": {
              "methods": {
                "lm": {
                  "disabling_allowed": true,
                  "active_landmarks": 8
                }
              }
            }
          },
          "profile-car": {
            "profiles": "driving-car",
            "parameters": {
              "encoder_flags_size": 8,
              "encoder_options": "turn_costs=true|block_fords=false|use_acceleration=true",
              "maximum_distance": 100000,
              "elevation": true,
              "maximum_snapping_radius": 350,
              "preparation": {
                "min_network_size": 200,
                "min_one_way_network_size": 200,
                "methods": {
                  "ch": {
                    "enabled": true,
                    "threads": 1,
                    "weightings": "fastest"
                  },
                  "lm": {
                    "enabled": false,
                    "threads": 1,
                    "weightings": "fastest,shortest",
                    "landmarks": 16
                  },
                  "core": {
                    "enabled": true,
                    "threads": 1,
                    "weightings": "fastest,shortest",
                    "landmarks": 64,
                    "lmsets": "highways;allow_all"
                  }
                }
              },
              "execution": {
                "methods": {
                  "ch": {
                    "disabling_allowed": true
                  },
                  "lm": {
                    "disabling_allowed": true,
                    "active_landmarks": 6
                  },
                  "core": {
                    "disabling_allowed": true,
                    "active_landmarks": 6
                  }
                }
              },
              "ext_storages": {
                "WayCategory": {},
                "HeavyVehicle": {},
                "WaySurfaceType": {},
                "RoadAccessRestrictions": {
                  "use_for_warnings": true
                }
              }
            }
          },
          "profile-hgv": {
            "profiles": "driving-hgv",
            "parameters": {
              "encoder_flags_size": 8,
              "encoder_options": "turn_costs=true|block_fords=false|use_acceleration=true",
              "maximum_distance": 100000,
              "elevation": true,
              "preparation": {
                "min_network_size": 200,
                "min_one_way_network_size": 200,
                "methods": {
                  "ch": {
                    "enabled": true,
                    "threads": 1,
                    "weightings": "recommended"
                  },
                  "core": {
                    "enabled": true,
                    "threads": 1,
                    "weightings": "recommended,shortest",
                    "landmarks": 64,
                    "lmsets": "highways;allow_all"
                  }
                }
              },
              "execution": {
                "methods": {
                  "ch": {
                    "disabling_allowed": true
                  },
                  "core": {
                    "disabling_allowed": true,
                    "active_landmarks": 6
                  }
                }
              },
              "ext_storages": {
                "WayCategory": {},
                "HeavyVehicle": {
                  "restrictions": true
                },
                "WaySurfaceType": {}
              }
            }
          },
          "profile-bike-regular": {
            "profiles": "cycling-regular",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-bike-mountain": {
            "profiles": "cycling-mountain",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-bike-road": {
            "profiles": "cycling-road",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-bike-electric": {
            "profiles": "cycling-electric",
            "parameters": {
              "encoder_options": "consider_elevation=true|turn_costs=true|block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-walking": {
            "profiles": "foot-walking",
            "parameters": {
              "encoder_options": "block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-hiking": {
            "profiles": "foot-hiking",
            "parameters": {
              "encoder_options": "block_fords=false",
              "elevation": true,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "HillIndex": {},
                "TrailDifficulty": {}
              }
            }
          },
          "profile-wheelchair": {
            "profiles": "wheelchair",
            "parameters": {
              "encoder_options": "block_fords=true",
              "elevation": true,
              "maximum_snapping_radius": 50,
              "ext_storages": {
                "WayCategory": {},
                "WaySurfaceType": {},
                "Wheelchair": {
                  "KerbsOnCrossings": "true"
                },
                "OsmId": {}
              }
            }
          }
        }
      }
    },
    "logging": {
      "enabled": true,
      "level_file": "DEBUG_LOGGING.json",
      "location": "/var/log/ors",
      "stdout": true
    },
    "system_message": [
      {
        "active": false,
        "text": "This message would be sent with every routing bike fastest request",
        "condition": {
          "request_service": "routing",
          "request_profile": "cycling-regular,cycling-mountain,cycling-road,cycling-electric",
          "request_preference": "fastest"
        }
      },
      {
        "active": false,
        "text": "This message would be sent with every request for geojson response",
        "condition": {
          "api_format": "geojson"
        }
      },
      {
        "active": false,
        "text": "This message would be sent with every request on API v1 from January 2020 until June 2050",
        "condition": {
          "api_version": 1,
          "time_after": "2020-01-01T00:00:00Z",
          "time_before": "2050-06-01T00:00:00Z"
        }
      },
      {
        "active": false,
        "text": "This message would be sent with every request"
      }
    ]
  }
}

please help me in this

There’s an open issue on this, see here.