Docker: Unable to get an appropriate route profile for RoutePreference

I always get the following error message.
How can I fix this?

{
  "error": {
    "code": 2099,
    "message": "Unable to get an appropriate route profile for RoutePreference = driving-car"
  },
  "info": {
    "engine": {
      "build_date": "2023-06-13T12:36:00Z",
      "version": "7.1.0"
    },
    "timestamp": 1691352154417
  }
}

I installed it as described in Github (GitHub - GIScience/openrouteservice: 🌍 The open source route planner api with plenty of features.).

On my page /ors/v2/status I get the following result:

{
  "engine": {
    "build_date": "2023-06-13T12:36:00Z",
    "version": "7.1.0"
  }
}

And my ors-config.json looks like this.

{
  "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"
    },
    "api_settings": {
      "cors": {
        "allowed": {
          "origins": [
            "*"
          ],
          "headers": [
            "Content-Type",
            "X-Requested-With",
            "accept",
            "Origin",
            "Access-Control-Request-Method",
            "Access-Control-Request-Headers",
            "Authorization"
          ]
        },
        "exposed": {
          "headers": [
            "Access-Control-Allow-Origin",
            "Access-Control-Allow-Credentials"
          ]
        },
        "preflight_max_age": 600
      }
    },
    "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": [
          "data/osm_file.pbf"
        ],
        "init_threads": 1,
        "attribution": "openrouteservice.org, OpenStreetMap contributors",
        "elevation_preprocessed": false,
        "profiles": {
          "active": [
            "car",
            "driving-car"
          ],
          "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": {}
              }
            }
          },
          "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": "logs/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"
      }
    ]
  }
}

Hey @DerJustin,

your
/ors/v2/status
probably shows not ready.

Could you post the logs for the docker container?

Best regards

Do you mean the ors.log file? Am brand new to docker land…

2023-08-06 21:13:43,715 INFO [ors.Application] - Starting Application v7.1.0 using Java 17.0.7 on 48d4b82154b3 with PID 1 (/home/ors/tomcat/webapps/ors/WEB-INF/classes started by root in /home/ors)
2023-08-06 21:13:43,718 DEBUG [ors.Application] - Running with Spring Boot v2.7.12, Spring v5.3.27
2023-08-06 21:13:43,718 INFO [ors.Application] - No active profile set, falling back to 1 default profile: "default"
2023-08-06 21:13:46,891 INFO [ors.Application] - Started Application in 4.045 seconds (JVM running for 9.615)
2023-08-06 21:13:46,910 INFO [logging.LoggingUtility] - Logging configuration loaded from DEBUG_LOGGING.json, logging to file logs/ors/ors-logs.log
2023-08-06 21:13:46,920 INFO [routing.RoutingProfileManager] -  Total - 1024 MB, Free - 615.59 MB, Max: 2 GB, Used - 408.41 MB
2023-08-06 21:13:46,920 INFO [routing.RoutingProfileManager] -       
2023-08-06 21:13:46,954 INFO [routing.RoutingProfileManager] - ====> Initializing profiles from 'data/osm_file.pbf' (1 threads) ...
2023-08-06 21:13:46,959 INFO [routing.RoutingProfile] - [1] Profiles: 'driving-car', location: 'data/graphs/car'.
2023-08-06 21:13:46,956 ERROR [routing.RoutingProfileManager] - Failed to initialize RoutingProfileManager instance.
java.lang.NullPointerException: Cannot invoke "String.split(String)" because "this.profiles" is null
	at org.heigit.ors.routing.configuration.RouteProfileConfiguration.getProfilesTypes(RouteProfileConfiguration.java:135) ~[classes/:7.1.0]
	at org.heigit.ors.routing.RoutingProfileManager.initialize(RoutingProfileManager.java:167) ~[classes/:7.1.0]
	at org.heigit.ors.routing.RoutingProfileManager.getInstance(RoutingProfileManager.java:72) ~[classes/:7.1.0]
	at org.heigit.ors.servlet.listeners.ORSInitContextListener.lambda$contextInitialized$0(ORSInitContextListener.java:40) ~[classes/:7.1.0]
	at java.lang.Thread.run(Thread.java:833) [?:?]
2023-08-06 21:13:46,960 INFO [routing.RoutingProfileManager] - ====> Recycling garbage...
2023-08-06 21:13:46,961 INFO [routing.RoutingProfileManager] - Before:  Total - 1024 MB, Free - 606.59 MB, Max: 2 GB, Used - 417.41 MB
2023-08-06 21:13:47,008 INFO [routing.RoutingProfileManager] - After:  Total - 1024 MB, Free - 991.14 MB, Max: 2 GB, Used - 32.86 MB
2023-08-06 21:13:47,008 INFO [routing.RoutingProfileManager] - ========================================================================
2023-08-06 21:13:47,008 INFO [routing.RoutingProfileManager] - ====> Memory usage by profiles:
2023-08-06 21:13:47,009 INFO [routing.RoutingProfileManager] - Total: 0 B (0.0%)
2023-08-06 21:13:47,009 INFO [routing.RoutingProfileManager] - ========================================================================
2023-08-06 21:13:47,246 INFO [core.CoreLMPreparationHandler] - Loaded landmark splitting collection from 
2023-08-06 21:13:47,278 INFO [extensions.ORSGraphHopper] - version 4.0|2023-06-12T14:59:08Z (7,20,5,4,5,7)
2023-08-06 21:13:47,282 INFO [extensions.ORSGraphHopper] - graph CH|car_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, shortcuts:0 (0MB), nodesCH:-1 (0MB), shortcuts:0 (0MB), nodesCH:-1 (0MB), shortcuts:0 (0MB), nodesCH:-1 (0MB)
2023-08-06 21:13:47,414 INFO [extensions.ORSGraphHopper] - No custom areas are used, custom_areas.directory not given
2023-08-06 21:13:47,424 INFO [extensions.ORSGraphHopper] - start creating graph from data/osm_file.pbf
2023-08-06 21:13:47,442 INFO [extensions.ORSGraphHopper] - using CH|car_ors|RAM_STORE|3D|turn_cost|,,,,, memory:totalMB:1024, usedMB:132

Hi @amandus
I have the same error and this is the error in the docker build

`ERROR [routing.RoutingProfileManager] - java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Your specified OSM file does not exist:/home/ors/ors-core/data/osm_file.pbf

Is there nobody who can help?

I thought you just download it, start the whole thing and it runs, but that it comes to these problems and really nobody can help?
I would not have thought that.

Hi @Jorge_Criollo,
Hi @DerJustin,

yeah… there are currently a lot of changes with the config going on, and i’m lost a bit here as well.
It seems the docker-compose.yml that is downloaded from the main branch of the repo doesn’t fit with the docker image which is behind some commits.

Best regards
You could try using the nightly image instead (which has all of the current changes to configs):
Change the line in docker-compose.yml
image: openrouteservice/openrouteservice:latest

image: openrouteservice/openrouteservice:nightly
before doing a docker compose up -d
Then it should find the pbf file properly and you can adjust the config afterwards.

@amandus I tried again after 5 days and it seems to work better this time, however I have the HTTP/HTTPS problem.
My site runs over HTTPS, but Docker over HTTP which doesn’t work.
How can I fix the problem?

Hi @DerJustin,

you can configure a webserver like apache or nginx to expose your openrouteservice API over HTTPS. You can use letsencrypt to generate a security certificate.

I think it’s also possible to directly add the relevant settings to the docker container, but not sure.

For both options, best check the relevant documentation on how to set it up.

Best regards

I have the same problem. Running a fresh vm of Linux Mint.
My http://localhost:8080/ors/v2/status is

engine	
build_date	"2023-06-13T12:36:00Z"
version	"7.1.0"

And http://localhost:8080/ors/v2/directions/driving-car?start=8.681495,49.41461&end=8.687872,49.420318

Returns

error	
code	2099
message	"Unable to get an appropriate route profile for RoutePreference = driving-car"
info	
engine	
build_date	"2023-06-13T12:36:00Z"
version	"7.1.0"
timestamp	1693670624958

I tried amandus’ suggestion to change to nightly in the .yml but then I got this error during build:

Error response from daemon: unexpected error reading Dockerfile: read /var/lib/docker/tmp/docker-builder2576348024/Dockerfile: is a directory