Custom file : ors-app exited with code 137

Hey,

Thanks for this amazing project !

The sample data works perfectly (i installed it with docker compose up method).
I would like to fetch elevations and directions data from France (hiking). So i downloaded the pbf file from Geofabrik : https://download.geofabrik.de/europe/france-latest.osm.pbf

The problem is the following :

ors-app    | 14-Mar-2023 17:11:21.056 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
ors-app    | 14-Mar-2023 17:11:21.064 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 6206 ms
ors-app    | 14 Mar 17:11:21 INFO [extensions.ORSGraphHopper] - version 4.0|2023-03-03T11:19:19Z (7,20,5,4,5,7)
ors-app    | 14 Mar 17:11:21 INFO [extensions.ORSGraphHopper] - graph hiking_ors|RAM_STORE|3D|turn_cost|,,,,, details:edges:0(0MB), nodes:0(0MB), name:(0MB), geo:0(0MB), bounds:1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308,1.7976931348623157E308,-1.7976931348623157E308
ors-app    | 14 Mar 17:11:21 INFO [extensions.ORSGraphHopper] - No custom areas are used, custom_areas.directory not given
ors-app    | 14 Mar 17:11:21 INFO [extensions.ORSGraphHopper] - start creating graph from /home/ors/ors-core/data/osm_file.pbf
ors-app    | 14 Mar 17:11:21 INFO [extensions.ORSGraphHopper] - using hiking_ors|RAM_STORE|3D|turn_cost|,,,,, memory:totalMB:1476, usedMB:149
ors-app    | 14 Mar 17:16:10 INFO [extensions.ORSGraphHopper] - call cleanUp for '/home/ors/ors-core/data/graphs/hiking' 
ors-app    | 14 Mar 17:16:10 INFO [extensions.ORSGraphHopper] - graph hiking_ors|RAM_STORE|3D|turn_cost|7,20,5,4,5, details:edges:17 646 026(606MB), nodes:13 698 988(262MB), name:(61MB), geo:141 644 152(541MB), bounds:-8.3230415,14.25475,35.2703341,53.3449967,0.0,0.0
ors-app    | 14 Mar 17:16:10 INFO [extensions.ORSGraphHopper] - will create PrepareRoutingSubnetworks with:
ors-app    | 	NodeCountBefore: '13698988'
ors-app    | 	getAllEdges().getMaxId(): '17646026'
ors-app    | 	List<FlagEncoder>: '[hiking_ors]'
ors-app    | 	minNetworkSize: '200'
ors-app    | 	minOneWayNetworkSize: '200'
ors-app    | 14 Mar 17:16:41 INFO [extensions.ORSGraphHopper] - nodes: 13 698 988, edges: 17 646 026
ors-app    | 14 Mar 17:16:43 INFO [extensions.ORSGraphHopper] - Bridge interpolation 0s, tunnel interpolation 0s, ferry interpolation 0s
ors-app exited with code 137

I got this error exited with code 137 at the same time.

I tried to increase my docker memory limit to 16GB and i put the Xmx to 13g but that did not solve my problem.

I tried with Belgium and a specific region in France the service works perfectly. Do you have an idea about this problem ?

Thanks a million,

Hey,

after looking through error codes for a bit, I think this is still related to OOM errors. 137 corresponds to SIGKILL, which in my opinion might only stem from the OOM-killer.

France is ~4GB in size, so if you’re trying to build all 9 profiles, 13GB of RAM might indeed be too few. Remember, we recommend roughly twice the PBF-size in RAM per profile (for building at least, for running, this reduces quite a bit.).

If you need all 9 profiles, try with a smaller pbf or with more RAM.
If not, delete all not needed profiles from the active: […]-section.

Best regards

Thanks for your reply!

I had only one profile into the active array “hiking”. I’m also trying to increase the RAM parameter.

Unfortunately, I still have the same problem :face_exhaling:

Here’s my ors-config.json file :

{
  "ors": {
    "info": {
      "base_url": "https://openrouteservice.org/",
      "swagger_documentation_url": "https://api.openrouteservice.org/",
      "support_mail": "support@openrouteservice.org",
      "author_tag": "openrouteservice",
      "content_licence": "LGPL 3.0"
    },
    "services": {
      "matrix": {
        "enabled": true,
        "maximum_routes": 100,
        "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
            },
            "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": [
          "/home/ors/ors-core/data/osm_file.pbf"
        ],
        "init_threads": 2,
        "attribution": "openrouteservice.org, OpenStreetMap contributors",
        "elevation_preprocessed": false,
        "profiles": {
          "active": [
            "hiking"
          ],
          "default_params": {
            "encoder_flags_size": 8,
            "graphs_root_path": "graphs",
            "elevation_provider": "multi",
            "elevation_cache_path": "cgiar_provider",
            "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": {
                  "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": {
                  "lm": {
                    "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": {
                  "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": {}
              }
            }
          },
          "profile-public-transport": {
            "profiles": "public-transport",
            "parameters": {
              "encoder_options": "block_fords=false",
              "elevation": true,
              "maximum_visited_nodes": 1000000,
              "gtfs_file": "openrouteservice-api-tests/data/vrn_gtfs.zip"
            }
          }
        }
      }
    },
    "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"
      }
    ]
  }
}

And my docker-compose.yml file :

version: '2.4'
services:
  ors-app:
    container_name: ors-app
    ports:
      - "8080:8080"
      - "9001:9001"
    image: openrouteservice/openrouteservice:latest
    user: "${UID:-0}:${GID:-0}"
    build:
      context: ../
      args:
        ORS_CONFIG: ./openrouteservice/src/main/resources/ors-config-sample.json
        OSM_FILE: ./openrouteservice/src/main/files/france-latest.osm.pbf
    volumes:
      - ./graphs:/home/ors/ors-core/data/graphs
      - ./elevation_cache:/home/ors/ors-core/data/elevation_cache
      - ./logs/ors:/home/ors/ors-core/logs/ors
      - ./logs/tomcat:/home/ors/tomcat/logs
      - ./conf:/home/ors/ors-conf
      # - ./data/france-latest.pbf:/home/ors/ors-core/data/france-latest.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 -Xmx16g"
      - "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"
    mem_limit: 16000m
    mem_reservation: 8000m

Thanks a million,

Hey,

this shouldn’t make a difference, but if you set -Xmx to 16G anyways, you could already start out with a bit more memory, i.e. -Xms=12G or something along those lines.

Apart from that, why is mounting the pbf commented in the docker-compose.yml?

If you’re getting belgium and parts of france to run and only show the hiking profile (to confirm that that’s the only one that’s being used), then I’m a bit confused as to why france wouldn’t work…

Could you confirm that belgium runs with just the hiking profile, and that it correctly builds and possibly re-builds graphs?

Best regards

Hey,

After a few hours of testing, I managed to build the graph for France! The problem was that my PC’s RAM was reached after a while. With Xmx9g, it worked!

Thanks man,

1 Like