openrouteservice icon indicating copy to clipboard operation
openrouteservice copied to clipboard

Unable to deploy server using docker-compose

Open Stephe193 opened this issue 3 years ago • 2 comments

I have tried to setup a local server using docker-compose. But I can't seem to get it to deploy correctly. Firstly I had a problem where only was able to calculate driving routes. Then I added my own ors-config.json file in order to combat that. Now I seem to have a problem when building the project where it does not seem to deploy correctly using the default ors-config.json. I have pasted a Github repository at the bottom of this post with all the files that I am using.

The problem I was facing next was that when I deployed the server it stated Initializing profiles from 'openrouteservice/src/main/files/heidelberg.osm.gz'. Because it was defined inside the ors-config.json file as follows:

"sources": [ "openrouteservice/src/main/files/andorra-latest.osm.pbf.osm.gz" ],

I have tried to change this by both the andorra-latest.osm.pbf and andorra-latest.osm.bz2 files. But then when I deployed the server it threw an error saying it was not able to read those file types.

Then I tried to just leave the sources array empty inside the ors-config.json but then I got the following error:

ors-app | Exception in thread "ORS-Kafka-Init" java.lang.ExceptionInInitializerError ors-app | at org.heigit.ors.routing.RoutingProfileManager.initialize(RoutingProfileManager.java:139) ors-app | at org.heigit.ors.routing.RoutingProfileManager.getInstance(RoutingProfileManager.java:70) ors-app | at org.heigit.ors.routing.RoutingProfileManager.isInitComplete(RoutingProfileManager.java:666) ors-app | at org.heigit.ors.servlet.listeners.ORSKafkaConsumerInitContextListener.lambda$contextInitialized$0(ORSKafkaConsumerInitContextListener.java:47) ors-app | at java.base/java.lang.Thread.run(Thread.java:829) ors-app | Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 ors-app | at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ors-app | at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ors-app | at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248) ors-app | at java.base/java.util.Objects.checkIndex(Objects.java:372) ors-app | at java.base/java.util.ArrayList.get(ArrayList.java:459) ors-app | at org.heigit.ors.services.routing.RoutingServiceSettings.init(RoutingServiceSettings.java:52) ors-app | at org.heigit.ors.services.routing.RoutingServiceSettings.<clinit>(RoutingServiceSettings.java:37) ors-app | ... 5 more

I am using the Andorra version for testing purposes. Because it is a small file size. I am also very new to both openrouteservice and docker.

I have created a Github repository which includes all the files except the PBF and bz2 files: https://github.com/Stephe193/ors-docker

Stephe193 avatar Oct 01 '21 12:10 Stephe193

Hey,

this is a follow-up to this post in the ask-forum.

I'll try to answer to the problems here once again for completenes. As stated, this is using docker-compose.

Firstly I had a problem where only was able to calculate driving routes.

If you don't provide a config file yourself via the docker-compose.yml-file, the ors will use the sample ors-config-sample.json file and deactivate all but the car profile.

Then I added my own ors-config.json file in order to combat that. […] The problem I was facing next was that when I deployed the server it stated Initializing profiles from 'openrouteservice/src/main/files/heidelberg.osm.gz'.

If you copy the ors-config-sample.json over, it'll use the default osm file.

Because it was defined inside the ors-config.json file as follows: "sources": [ "openrouteservice/src/main/files/andorra-latest.osm.pbf.osm.gz" ]

Since you would have to use the .pbf-file from where it is mounted inside the docker container, this should read something like

"sources": ["data/osm_file.pbf"]

I have created a Github repository which includes all the files except the PBF and bz2 files: The config file here leaves "sources" : [] empty. Specify as above :)

Best regards, Jakob

koebi avatar Oct 05 '21 11:10 koebi

Hi, I've been unable to start the API, I install it via docker but is saying that the osr-config.json file does not found on the folder, I saw the sample but I don't know where to copy it.

f1lander avatar Jul 25 '22 20:07 f1lander

Does this project actually work (w/ docker-compose) ? Nothing seems to work -

Default install - url from documentation, not working

http://localhost:8080/ors/v2/directions/foot-walking?start=8.676581,49.418204&end=8.692803,49.409465

Then trying to build a new graph; Docker starts, builds graphs, but never finishes.

Then it complains about: Deprecation notice: Old configuration method with JSON files is deprecated. Switch to ors-config.yml file while it is using a yml file.

I am truly confused about this project.

bakman2 avatar Oct 20 '23 14:10 bakman2

@bakman2 Thanks for your feedback.

Did you use the docker-compose.yml from nightly?

Unfortunately, the former docs always advised that, which can make it incompatible with earlier versions. This is due to our nightly based development process.

We just updated the docs for you to make the usage of versioned openrouteservice a bit clearer and would advise you use the recommmended way from now on (v7.1.0):

  1. Readme adjustment: https://github.com/GIScience/openrouteservice#installation
  2. Docs adjustment: https://giscience.github.io/openrouteservice/installation/Running-with-Docker.html

For more help and future confusions, you're welcome to come over to our ask forum and discuss your problems there: https://ask.openrouteservice.org

MichaelsJP avatar Oct 27 '23 16:10 MichaelsJP

@f1lander If you're still experiencing this problem after all that time, feel free to reopen this issue or head over to our forum: https://ask.openrouteservice.org

MichaelsJP avatar Oct 27 '23 16:10 MichaelsJP