Openrouteservice for Germany not running

Hi,

I had ORS running for Germany for a long time now. I took it down to make some changes to the waypoint limits (and nothing else). Now When I rebuild and restart, no graphs are being built nor is the service “ready” after 2 days of the container being up.

This is my yaml file -

Blockquote
version: ‘3’
services:
ors-app:
container_name: ors-germ
image: docker_ors-app:latest
ports:
- 8095:8080
restart: unless-stopped
build:
context: …/
args:
APP_CONFIG: ./docker/conf/app.config.sample
OSM_FILE: ./docker/data/germany-latest.osm.pbf
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/app.config.sample:/ors-core/openrouteservice/target/classes/app.config
- ./data/germany-latest.osm.pbf:/ors-core/data/osm_file.pbf
environment:
- BUILD_GRAPHS=True # Forces the container to rebuild the graphs, e.g. when PBF is changed in app.conf
- “JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelGCThreads=4 -Xms16g -Xmx18g”
- “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”

I have a single profile so it shouldn’t take so much time
The only change to the config is changing the number of waypoints. I also checked and tried for the JAVA_OPTS and CATALINA_OPTS quotation marks like we discussed last time.

What’s the output of the docker logs for the container (docker logs --tail 200 ors-germ)?

Ah right there is a string error for the waypoint limit. I guess the number is too high. Sorry I did not check this before and I did not know the precision of the string.

    
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
rm: cannot remove '/ors-core/data/graphs': Device or resource busy
15-Jul-2020 11:12:21.392 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.32
15-Jul-2020 11:12:21.393 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Feb 2 2016 19:34:53 UTC
15-Jul-2020 11:12:21.393 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.32.0
15-Jul-2020 11:12:21.393 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
15-Jul-2020 11:12:21.393 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.15.0-106-generic
15-Jul-2020 11:12:21.393 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
15-Jul-2020 11:12:21.393 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/local/openjdk-8/jre
15-Jul-2020 11:12:21.393 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_252-b09
15-Jul-2020 11:12:21.393 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
15-Jul-2020 11:12:21.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
15-Jul-2020 11:12:21.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
15-Jul-2020 11:12:21.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
15-Jul-2020 11:12:21.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
15-Jul-2020 11:12:21.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
15-Jul-2020 11:12:21.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:TargetSurvivorRatio=75
15-Jul-2020 11:12:21.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:SurvivorRatio=64
15-Jul-2020 11:12:21.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:MaxTenuringThreshold=3
15-Jul-2020 11:12:21.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseConcMarkSweepGC
15-Jul-2020 11:12:21.394 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseParNewGC
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:ParallelGCThreads=4
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms16g
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx18g
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=9001
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.rmi.port=9001
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=localhost
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/usr/local/tomcat/endorsed
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
15-Jul-2020 11:12:21.395 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
15-Jul-2020 11:12:21.396 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
15-Jul-2020 11:12:21.396 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
15-Jul-2020 11:12:21.453 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
15-Jul-2020 11:12:21.461 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
15-Jul-2020 11:12:21.463 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
15-Jul-2020 11:12:21.464 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
15-Jul-2020 11:12:21.464 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 270 ms
15-Jul-2020 11:12:21.477 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
15-Jul-2020 11:12:21.477 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.32
15-Jul-2020 11:12:21.494 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /usr/local/tomcat/webapps/ors.war
15-Jul-2020 11:12:23.969 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.4.RELEASE)

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
<?xml version="1.0" ?>

  
    /var/log/ors/ors-logs.log
  

15 Jul 11:12:28 ERROR [routing.RoutingProfileManager] - Failed to initialize RoutingProfileManager instance.
java.lang.NumberFormatException: For input string: "50000000000"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_252]
        at java.lang.Integer.parseInt(Integer.java:583) ~[?:1.8.0_252]
        at java.lang.Integer.parseInt(Integer.java:615) ~[?:1.8.0_252]
        at org.heigit.ors.routing.configuration.RoutingManagerConfiguration.loadFromFile(RoutingManagerConfiguration.java:174) ~[classes/:6.1.0]
        at org.heigit.ors.routing.RoutingProfileManager.initialize(RoutingProfileManager.java:126) ~[classes/:6.1.0]
        at org.heigit.ors.routing.RoutingProfileManager.getInstance(RoutingProfileManager.java:57) ~[classes/:6.1.0]
        at org.heigit.ors.servlet.listeners.ORSInitContextListener.lambda$contextInitialized$0(ORSInitContextListener.java:40) ~[classes/:6.1.0]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
15-Jul-2020 11:12:28.325 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /usr/local/tomcat/webapps/ors.war has finished in 6,829 ms
15-Jul-2020 11:12:28.325 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/manager
15-Jul-2020 11:12:28.348 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/manager has finished in 23 ms
15-Jul-2020 11:12:28.349 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/docs
15-Jul-2020 11:12:28.361 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/docs has finished in 12 ms
15-Jul-2020 11:12:28.361 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/host-manager
15-Jul-2020 11:12:28.377 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/host-manager has finished in 16 ms
15-Jul-2020 11:12:28.377 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/examples
15-Jul-2020 11:12:28.513 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/examples has finished in 136 ms
15-Jul-2020 11:12:28.513 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat/webapps/ROOT
15-Jul-2020 11:12:28.524 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat/webapps/ROOT has finished in 11 ms
15-Jul-2020 11:12:28.527 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
15-Jul-2020 11:12:28.532 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
15-Jul-2020 11:12:28.532 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 7067 ms

Is there a need to copy the OSM file to the /ors-core/data inside the container? I have two services running, one for Ireland and one for Germany.

The Ireland one does not have the ireland pbf in the /ors-core/data, only ors_file.pbf (which I am guessing the docker-compose points to the docker/data folder). But this one is running fine.

I go an error that germany.pbf does not exist in /ors-core/data and that graphs cannot be deleted from the ors-core/data/graphs.

 ERROR [routing.RoutingProfileManager] - Failed to initialize RoutingProfileManager instance.
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Your specified OSM file does not exist:/ors-core/data/germany-latest.osm.pbf
        at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_252]
        at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_252]
        at org.heigit.ors.routing.RoutingProfileManager.initialize(RoutingProfileManager.java:162) ~[classes/:6.1.0]
        at org.heigit.ors.routing.RoutingProfileManager.getInstance(RoutingProfileManager.java:57) ~[classes/:6.1.0]
        at org.heigit.ors.servlet.listeners.ORSInitContextListener.lambda$contextInitialized$0(ORSInitContextListener.java:40) ~[classes/:6.1.0]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
Caused by: java.lang.IllegalStateException: Your specified OSM file does not exist:/ors-core/data/germany-latest.osm.pbf
        at com.graphhopper.reader.osm.OSMReader.readGraph(OSMReader.java:169) ~[graphhopper-reader-osm-v0.13.2.jar:?]
        at com.graphhopper.GraphHopper.importData(GraphHopper.java:735) ~[graphhopper-core-v0.13.2.jar:?]
        at com.graphhopper.GraphHopper.readData(GraphHopper.java:714) ~[graphhopper-core-v0.13.2.jar:?]
        at com.graphhopper.GraphHopper.process(GraphHopper.java:701) ~[graphhopper-core-v0.13.2.jar:?]
        at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:680) ~[graphhopper-core-v0.13.2.jar:?]
        at org.heigit.ors.routing.graphhopper.extensions.ORSGraphHopper.importOrLoad(ORSGraphHopper.java:131) ~[classes/:6.1.0]
        at org.heigit.ors.routing.RoutingProfile.initGraphHopper(RoutingProfile.java:181) ~[classes/:6.1.0]
        at org.heigit.ors.routing.RoutingProfile.(RoutingProfile.java:127) ~[classes/:6.1.0]
        at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:35) ~[classes/:6.1.0]
        at org.heigit.ors.routing.RoutingProfileLoader.call(RoutingProfileLoader.java:21) ~[classes/:6.1.0]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_252]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_252]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_252]
        ... 1 more

OK, so with the graphs part, if you are building the same profile in the two containers, then you would need to provide a different graph folder for each instance on your local machine, else both containers will try to work with the same folder when they handle graphs and that will cause things to go wrong.

- ./data/germany-latest.osm.pbf:/ors-core/data/osm_file.pbf - That line in the compose file is basically telling it to create a link to the file ./data/germany-latest.osm.pbf outside the container with the file /ors-core/data/osm_file.pbf inside the container. That means that inside the config file, the osm file should be osm_file.pbf rather than germany-latest.osm.pbf

Hi Adam,

Thank you for all your help. Both the services are running now.

But just to clarify, I had only osm_file.pbf inside the /ors-core/data folder. I assumed the same as you said, that the docker-compose will point the germany-latest.pbf from the docker folder to the ors-core. But for some reason it did not and I still got this error even after rebuilding the image over and over. I am not sure if this is a bug. It was resolved when I downloaded the Germany pbf inside /ors-core/data using docker exec.

Again, thank you for your help

Glad you got it working. Normally what you would see is the osm_file.pbf in the ors-core/data folder and nothing else as docker-compose would in effect copy whatever file you told it to into the ors_core/data folder as the name osm_file.pbf. Then the standard app.config would reference /ors-core/data/osm_file.pbf in the "sources": ["..."] property. I guess that you have altered the config file to point to germany-latest.osm.pbf.

Looking at the latest Dockerfile though it should replace the path to germany-latest.osm.pbf in the app.config with a path to the osm_file.pbf, so I am not sure why that is not happening. Out of curiosity, can you post the part of the app.config from within the container (should be at /ors-core/openrouteservice/src/main/resources/app.config) that references the germany-latest.osm.pbf file?

Hi Adam,

Now I actually understand how it is all connected. Thank you for the information.

Here is my app.config file. Is this the part you are looking for?

I had a few deadlines and was trying to get the services back up so I had changed the source in app.config.sample file in ./docker/conf to point to Germany pbf after looking at a post on the forum. But I changed it back later and rebuild the image from scratch. I still had this issue.

        "maximum_intervals":10,
        "maximum_locations":10,
        "allow_compute_area":true,
        "attribution":"openrouteservice.org, OpenStreetMap contributors"
     },
     "routing":{
        "enabled":true,
        "mode":"normal",
        "sources":[
           "data/osm_file.pbf"
        ],
        "init_threads":1,
        "attribution":"openrouteservice.org, OpenStreetMap contributors",
        "distance_approximation":true,
        "profiles":{
           "active":[
               "pedestrian-walk"
           ],
           "default_params": {
               "encoder_flags_size": 8,
               "graphs_root_path": "data/graphs",
               "elevation_provider": "multi",
                   "elevation_cache_path": "data/elevation_cache",
               "elevation_clear_cache": true,
               "instructions": true,
               "maximum_distance": 1000000,
               "maximum_segment_distance_with_dynamic_weights": 1000000,
               "maximum_distance_round_trip_routes": 1000000,
               "maximum_waypoints": 50000000
               "maximum_avoid_polygon_area": 20000,
               "maximum_avoid_polygon_extent": 2000,

Yeh, looking at that it should work ok…

Ultimately, the configuration that is used in tomcat is inside the webapps folder (/usr/local/tomcat/webapps/ors/WEB-INF/classes/app.config) so maybe in that one it was pointing to the germany file. There is a pull request on GitHub at the minute that when finished should hopefully make things a bit easier to run with customised config files.