Docker set up fails on own data

I have set up docker and the plugin for qgis for the first time.
Now I’m struggling to use my own osm.pbf files.

Explanation: first, installing docker for windows, cloning the copy of openrouteservice to my C drive and running

curl -O https://raw.githubusercontent.com/GIScience/openrouteservice/master/docker-compose.yml

After this I get the docker-compose.yml where I change BUILD_GRAPHS to true.
now, running

docker compose up

starts the docker image and the plugin in qgis starts working for the Heidelberg region.

Then I go into the docker/conf/ors-config.yml file and change source to my own osm.pbf file I downloaded from geofabrik.

I run

docker compose up

again and now qgis returns:

Feature ID None caused a GenericServerError:
500 ({"error":{"message":"Cannot invoke \"org.heigit.ors.routing.RoutingProfile.getGraphhopper()\" because the return value of \"org.heigit.ors.routing.RoutingProfilesCollection.getRouteProfile(int)\" is null"},"info":{"engine":{"build_date":"2023-11-28T10:04:13Z","version":"8.0"},"timestamp":1702901090307}})

Eventhough I’m setting the starting point of the isochrone into the region of the pbf file. What am I missing?

Hi @mundf and welcome to our forum. Please provide us with the output of the two endpoints: health and status and your docker-compose.yml. So, we better know what’s going on with your instance.

Besides, make sure your pbf is available inside the docker container. The container can’t access files outside its own file system or mounted volumes.

Dear Jules,
Thanks for the quick reply. the pbf is inside the docker container: docker/data/alsace-latest.osm.pbf

health:

{
    "status": "not ready"
}

while using the osm_file.pbf file it’s "status" : "ready"

status:

{
    "languages": [
        "cs",
        "cs-cz",
        "de",
        "de-de",
        "en",
        "en-us",
        "eo",
        "eo-eo",
        "es",
        "es-es",
        "fr",
        "fr-fr",
        "gr",
        "gr-gr",
        "he",
        "he-il",
        "hu",
        "hu-hu",
        "id",
        "id-id",
        "it",
        "it-it",
        "ja",
        "ja-jp",
        "ne",
        "ne-np",
        "nl",
        "nl-nl",
        "pl",
        "pl-pl",
        "pt",
        "pt-pt",
        "ro",
        "ro-ro",
        "ru",
        "ru-ru",
        "tr",
        "tr-tr",
        "zh",
        "zh-cn"
    ],
    "engine": {
        "build_date": "2023-12-18T12:47:38Z",
        "version": "8.0"
    },
    "profiles": {
        "profile 1": {
            "storages": {
                "WayCategory": {
                    "gh_profile": "car_ors_fastest_with_turn_costs"
                },
                "HeavyVehicle": {
                    "gh_profile": "car_ors_fastest_with_turn_costs"
                },
                "WaySurfaceType": {
                    "gh_profile": "car_ors_fastest_with_turn_costs"
                },
                "RoadAccessRestrictions": {
                    "gh_profile": "car_ors_fastest_with_turn_costs",
                    "use_for_warnings": "true"
                }
            },
            "profiles": "driving-car",
            "creation_date": "",
            "limits": {
                "maximum_distance": 100000,
                "maximum_waypoints": 50,
                "maximum_distance_dynamic_weights": 100000,
                "maximum_distance_avoid_areas": 100000
            }
        }
    },
    "services": [
        "routing",
        "isochrones",
        "matrix",
        "snap"
    ]
}

docker-compose.yml:

version: '2.4'
services:
  ors-app:
    container_name: ors-app
    ports:
      - "8080:8080"
      - "9001:9001"
    image: openrouteservice/openrouteservice:nightly
    user: "${UID:-0}:${GID:-0}"
    volumes:
      - ./docker/graphs:/home/ors/ors-core/data/graphs
      - ./docker/elevation_cache:/home/ors/ors-core/data/elevation_cache
      - ./docker/logs/ors:/home/ors/logs
      - ./docker/logs/tomcat:/home/ors/tomcat/logs
      - ./docker/conf:/home/ors/ors-conf
      - ./docker/data:/home/ors/ors-core/data
    environment:
      - BUILD_GRAPHS=True
      - "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"
      - ORS_CONFIG=/home/ors/ors-conf/ors-config.json

here’s ors-config.yml:

ors:
  engine:
    source_file: ./ors-core/data/alsace-latest.osm.pbf # or osm_file.pbf by default
    graphs_root_path: ./ors-core/data/graphs
    elevation:
      cache_path: ./ors-core/data/elevation_cache

    profiles:
      car:
        profile: driving-car
        elevation: true
        encoder_options:
          turn_costs: true
          block_fords: false
          use_acceleration: true
        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

How exactly are you getting that pbf into the image? From what I see there is no reference to where that pbf is, you just have it listed in ors-core which would require your own custom image.

To do it the way you are suggesting, you would need to have a separate dockerfile that builds off the nightly and imports your pbf to the ors-core directory.

@Rennoldsb thank you so much for your reply.
I’m just starting to use docker and, obviously, haven’t grasped the whole concept fully yet.

How would I have a separate dockerfile? Is this the most straightforward way?

@mundf Depending on how you are trying to deploy. I deployed my instance to Azure which was a big challenge, and the drawback is I won’t get nightly builds, I built it on one nightly image and that’s what I’m stuck with unless I rebuild it.

The Dockerfile I created is this:

FROM openrouteservice/openrouteservice:nightly

COPY ./us-latest.osm.pbf /home/ors/ors-core/data/osm_file.pbf

COPY ./ors-config.json /home/ors/ors-conf/ors-config.json

This uses the ORS nightly build as the base image, then I import my own pbf as literaly ‘osm_file.pbf’ so I don’t need to futz with the basic compose YAML.

If you don’t want to do that, take a look at the docs here: [Advanced Docker Setup | openrouteservice backend documentation Advanced Docker Setup | openrouteservice backend documentation (giscience.github.io)

Thank you @Rennoldsb

Your method helped me to get it working!

1 Like