ORS not recognizing GPS in Germany

I have a question regarding self-hosting ORS with Docker and using the latest German map from Geofabrik.

this url is working:

https://api.openrouteservice.org/v2/directions/driving-car?api_key=5b3ce3597851110001cf62[…]9a8f&start=7.479247,51.507849&end=6.71717300,51.52049300

but with our server same coordinates it is not working:

https://ors.kobra-dataworks.de/ors/v2/directions/driving-car?start=7.479247,51.507849&end=6.71717300,51.52049300

For some reason, I cannot get germany-latest.osm.pbf to load.

This is my docker-compose.yml:

# Docker Compose file for the openrouteservice (ORS) application
# Documentation and examples can be found on https://giscience.github.io/openrouteservice/run-instance/running-with-docker
version: '3.8'

services:
  # ----------------- ORS application configuration ------------------- #
  ors-app:
    # Activate the following lines to build the container from the repository
    # You have to add --build to the docker compose command to do so
    build:
      context: ./
    container_name: ors-app
    ports:
      - "8082:8082"  # Expose the ORS API on port 8080
      - "9002:9001"  # Expose additional port for monitoring (optional)
    image: openrouteservice/openrouteservice:v8.1.3
    # Advanced option! If you different ids to 0:0 and 1000:1000, you have to rebuild the container with the build args UID,GID.
    # The user command is useful if you want easier bind mount access or better security.
    #user: "1000:1000" # Run "mkdir -p ors-docker/config ors-docker/elevation_cache ors-docker/files ors-docker/graphs ors-docker/logs && sudo chown -R 1000:1000 ors" before starting the container!
    volumes:  # Mount relative directories. ONLY for local container runtime. To switch to docker managed volumes see 'Docker Volumes configuration' section below.
      - ./ors-docker:/home/ors  # Mount the ORS application directory (for logs, graphs, elevation_cache, etc.) into its own directory
      - ./graphs:/home/ors/graphs  # Mount graphs directory individually
      - ./elevation_cache:/home/ors/elevation_cache  # Mount elevation cache directory individually
      - ./config:/home/ors/config  # Mount configuration directory individually
      - ./logs:/home/ors/logs  # Mount logs directory individually
      - ./files:/home/ors/files  # Mount files directory individually
    environment:
      REBUILD_GRAPHS: True  # Set to True to rebuild graphs on container start.
      CONTAINER_LOG_LEVEL: INFO  # Log level for the container. Possible values: DEBUG, INFO, WARNING, ERROR, CRITICAL
      # If you don't want the default ors-config.yml you can specify a custom file name, that should match the file in
      # your 'config' volume mount.
      #ORS_CONFIG_LOCATION: /home/ors/config/my-ors-config.yml  # Location of your ORS configuration file in the docker container

      # ------------------ JAVA OPTS ------------------ #
      # Configure the memory settings for JAVA or pass additional opts
      # Fore more available ENV properties see Prepare CATALINA_OPTS and JAVA_OPTS
      # in https://github.com/GIScience/openrouteservice/blob/main/docker-entrypoint.sh
      XMS: 1g  # start RAM assigned to java
      XMX: 8g  # max RAM assigned to java. Rule of Thumb: <PBF-size> * <profiles> * 2
      # Example: 1.5 GB pbf size, two profiles (car and foot-walking)
      # -> 1.5 * 2 * 2 = 6. Set xmx to be AT LEAST `-Xmx6g`
      ADDITIONAL_JAVA_OPTS: ""  # further options you want to pass to the java command

      # ----------------- Properties configuration ------------------- #
      # Configure your whole container with only property ENVs.
      # These can be set alternatively or additionally to the yml configuration file.
      # Note, that any values set will override the corresponding values from the yml configuration file.
      # See the ors-config.env file for more options.
      # To have a configuration file-less container, uncomment at least the following properties.
      # The values are examples and provide the default configuration.
      ors.engine.source_file: /home/ors/files/germany-latest.osm.pbf
      ors.engine.graphs_root_path: /home/ors/graphs
      ors.engine.elevation.cache_path: /home/ors/elevation_cache
      ors.engine.profiles.car.enabled: true
      logging.level.org.heigit: INFO

    # ----------------- ENV file configuration ------------------- #
    # Too many variables for your 'environment:' section?
    # Use an env_file with the ENV properties instead and define everything in there:
    # Values will be overwritten if set in the 'environment' section.
    #env_file: ors-config.env

    # ----------------- Healthcheck configuration ------------------- #
    # The healthcheck is disabled by default. Uncomment the following lines to enable it.
    # The healthcheck allows you to monitor the status of the ORS application.
    # Be careful with long graph builds, as the healthcheck will fail and show 'unhealthy' during this time.
    # This is especially useful if you run your ORS container in a production environment.
    healthcheck:
      test: wget --no-verbose --tries=1 --spider https://ors.kobra-dataworks.de/ors/v2/health || exit 1
      start_period: 1m
      interval: 10s
      timeout: 2s
      retries: 3
      disable: false

# ----------------- Docker Volumes configuration ------------------- #
# Define the Docker managed volumes for the ORS application. For more info on Docker Volumes see https://docs.docker.com/compose/compose-file/07-volumes/
# Volumes are used to persist the data and configuration of the ORS application.
# If you want to use volumes, uncomment the following lines and remove the ./ prefix from the volume paths in 'services.ors-app.volumes'.
#volumes:
#    graphs:
#    elevation_cache:
#    config:
#    logs:
#    files:

The map file is located under files/germany-latest.osm.pbf

In the start process, the container says:

2024-09-20 03:25:51 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]   
2024-09-20 03:25:51 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]   Failed to either read or execute the ors configuration and its parameters: java.lang.IllegalStateException: Your specified OSM file does not exist:/home/ors/files/germany-latest.osm.pbf

I am stuck here, please help.

Hey,

in general, it is recommended to either use the ors-docker application directory or to use individually mounted directories, i.e. either the first line in volumes or all but the first.

Other than that, this should work.
Please also provide an output of tree or similar on your directory containing the docker-compose.yml, if not.

Best regards

1 Like

Thank you for the quick response, Jakob!

This is the tree output (2 level deep):

jan@ThinkCentre-M900:/var/www/ors-docker$ tree -L 2
.
├── config
│   ├── example-ors-config.env
│   ├── example-ors-config.yml
│   └── ors-config.yml
├── docker-compose.yml
├── elevation_cache
│   ├── 50n000e_20101117_gmted_mea075.gh
│   ├── 50n000e_20101117_gmted_mea075.tif
│   ├── srtm_38_01.gh
│   ├── srtm_38_01.zip
│   ├── srtm_38_02.gh
│   ├── srtm_38_02.zip
│   ├── srtm_38_03.gh
│   ├── srtm_38_03.zip
│   ├── srtm_39_01.gh
│   ├── srtm_39_01.zip
│   ├── srtm_39_02.gh
│   ├── srtm_39_02.zip
│   ├── srtm_39_03.gh
│   ├── srtm_39_03.zip
│   ├── srtm_40_02.gh
│   └── srtm_40_02.zip
├── files
│   └── germany-latest.osm.pbf
├── graphs
├── logs
│   └── ors.log
└── ors-config.env

I noticed this error in the logs of the container while it is starting up:

STORE|3D|turn_cost|,,,,, memory:totalMB:1024, usedMB:230
2024-09-24 20:11:54 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]   
2024-09-24 20:11:54 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]   Failed to either read or execute the ors configuration and its parameters: java.lang.IllegalStateException: Your specified OSM file does not exist:/home/ors/files/germany-latest.osm.pbf
2024-09-24 20:11:54 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]   

This error just came up when requesting the direction from the link above:

2024-09-24 20:16:42 WARN                                            ORS-pl-car [ c.g.r.d.GMTEDProvider                    ]   cannot load 50n000e_20101117_gmted_mea075, error: Not a GraphHopper file /home/ors/elevation_cache/50n000e_20101117_gmted_mea075.gh! Expected 'GH' as file marker but was 
2024-09-24 20:16:45 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]   
2024-09-24 20:16:45 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]   Failed to either read or execute the ors configuration and its parameters: java.lang.RuntimeException: Couldn't process file /home/ors/files/germany-latest.osm.pbf, error: Can't decode 50n000e_20101117_gmted_mea075.tif
2024-09-24 20:16:45 ERROR                                             ORS-Init [ o.h.o.r.RoutingProfileManager            ]