Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't start, got error code 3 connecting routing system #25

Closed
tbiancoar opened this issue Nov 6, 2020 · 13 comments
Closed

I can't start, got error code 3 connecting routing system #25

tbiancoar opened this issue Nov 6, 2020 · 13 comments

Comments

@tbiancoar
Copy link

tbiancoar commented Nov 6, 2020

I followed the steps and build my test in https://api-vroom.cr.onway.app/

But when I try with test request sometimes I got (using VROOM_ROUTER="ors"):

2020-11-06T13:05:18.465245743Z Fri, 06 Nov 2020 13:05:18 GMT: [Error]
2020-11-06T13:05:18.465584149Z Fri, 06 Nov 2020 13:05:18 GMT: Failed to connect to 0.0.0.0:5000
2020-11-06T13:05:18.465862641Z Fri, 06 Nov 2020 13:05:18 GMT:

Changing enviroment variables and using (VROOM_ROUTER="osrm") I got:

2020-11-06T13:12:49.048898242Z Fri, 06 Nov 2020 13:12:49 GMT: [Error]
2020-11-06T13:12:49.049249511Z Fri, 06 Nov 2020 13:12:49 GMT: Invalid profile: car.
2020-11-06T13:12:49.049500938Z Fri, 06 Nov 2020 13:12:49 GMT:

Any help?

@nilsnolde
Copy link
Collaborator

full docker-compose pls? also the conf/config.yml in case you changed anything..

@tbiancoar
Copy link
Author

tbiancoar commented Nov 6, 2020

I don't use docker-compose, I use dockerFile.

I didn't changed config file. This is my trace:

Uploading [====================] 100% (ETA 0.0s)
Upload done.

This might take several minutes. PLEASE BE PATIENT...

⠙ Building your source code...
------------------------- Fri Nov 06 2020 12:30:16 GMT+0000 (Coordinated Universal Time)
Build started for api-vroom
Step 1/19 : FROM debian:buster-slim as builder
⠹ Building your source code...
---> f49666103347
Step 2/19 : LABEL maintainer=nils@gis-ops.com

---> Running in da556a8de278
Removing intermediate container da556a8de278
---> 492fa9676a4b
Step 3/19 : WORKDIR /

---> Running in 85fc9845715e
Removing intermediate container 85fc9845715e
---> ca9292c25fbd
Step 4/19 : RUN echo "Updating apt-get and installing dependencies..." && apt-get -y update > /dev/null && apt-get -y install > /dev/null git-core build-essential g++ libssl-dev libasio-devpkg-config

---> Running in e3a5d3908be6
⠼ Building your source code...
debconf: delaying package configuration, since apt-utils is not installed
⠏ Building your source code...
Removing intermediate container e3a5d3908be6
---> 0359912c04c6
Step 5/19 : ARG VROOM_RELEASE=v1.8.0

⠋ Building your source code...
Removing intermediate container 9b12aeca3d39
---> 86f916bf794d
Step 6/19 : RUN echo "Cloning and installing vroom release ${VROOM_RELEASE}..." && git clone https://github.com/VROOM-Project/vroom.git && cd vroom && git fetch --tags && git checkout -q $VROOM_RELEASE && make -C /vroom/src && cd /

---> Running in b864ef736c3d
Cloning and installing vroom release v1.8.0...
Cloning into 'vroom'...

make: Entering directory '/vroom/src'
⠙ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c algorithms/munkres.cpp -o algorithms/munkres.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c algorithms/kruskal.cpp -o algorithms/kruskal.o
⠹ Building your source code...
⠸ Building your source code...
⠴ Building your source code...
⠴ Building your source code...
⠦ Building your source code...
⠧ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrp.cpp -o problems/vrp.o
⠇ Building your source code...
⠇ Building your source code...
⠏ Building your source code...
⠸ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/cvrp/operators/intra_mixed_exchange.cpp -o problems/cvrp/operators/intra_mixed_exchange.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/cvrp/operators/or_opt.cpp -o problems/cvrp/operators/or_opt.o
⠸ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/cvrp/operators/mixed_exchange.cpp -o problems/cvrp/operators/mixed_exchange.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/cvrp/operators/intra_relocate.cpp -o problems/cvrp/operators/intra_relocate.o
⠼ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/cvrp/operators/relocate.cpp -o problems/cvrp/operators/relocate.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/cvrp/operators/route_exchange.cpp -o problems/cvrp/operators/route_exchange.o
⠴ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/cvrp/operators/exchange.cpp -o problems/cvrp/operators/exchange.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/cvrp/operators/two_opt.cpp -o problems/cvrp/operators/two_opt.o
⠴ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/cvrp/operators/intra_exchange.cpp -o problems/cvrp/operators/intra_exchange.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/cvrp/operators/unassigned_exchange.cpp -o problems/cvrp/operators/unassigned_exchange.o
⠦ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrptw/operators/intra_mixed_exchange.cpp -o problems/vrptw/operators/intra_mixed_exchange.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrptw/operators/or_opt.cpp -o problems/vrptw/operators/or_opt.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrptw/operators/reverse_two_opt.cpp -o problems/vrptw/operators/reverse_two_opt.o
⠧ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrptw/operators/intra_relocate.cpp -o problems/vrptw/operators/intra_relocate.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrptw/operators/pd_shift.cpp -o problems/vrptw/operators/pd_shift.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrptw/operators/relocate.cpp -o problems/vrptw/operators/relocate.o
⠧ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrptw/operators/intra_cross_exchange.cpp -o problems/vrptw/operators/intra_cross_exchange.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrptw/operators/exchange.cpp -o problems/vrptw/operators/exchange.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrptw/operators/two_opt.cpp -o problems/vrptw/operators/two_opt.o
⠏ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrptw/operators/intra_exchange.cpp -o problems/vrptw/operators/intra_exchange.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/vrptw/operators/unassigned_exchange.cpp -o problems/vrptw/operators/unassigned_exchange.o
⠏ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c problems/tsp/heuristics/local_search.cpp -o problems/tsp/heuristics/local_search.o
⠋ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/generic/edge.cpp -o structures/generic/edge.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/generic/undirected_graph.cpp -o structures/generic/undirected_graph.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/vroom/job.cpp -o structures/vroom/job.o
⠙ Building your source code...
⠙ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/vroom/raw_route.cpp -o structures/vroom/raw_route.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/vroom/vehicle.cpp -o structures/vroom/vehicle.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/vroom/time_window.cpp -o structures/vroom/time_window.o
⠹ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/vroom/location.cpp -o structures/vroom/location.o
⠸ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/vroom/solution/summary.cpp -o structures/vroom/solution/summary.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/vroom/solution/route.cpp -o structures/vroom/solution/route.o
⠼ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/vroom/solution/computing_times.cpp -o structures/vroom/solution/computing_times.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/vroom/solution/solution.cpp -o structures/vroom/solution/solution.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c structures/cl_args.cpp -o structures/cl_args.o
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c utils/exception.cpp -o utils/exception.o
⠼ Building your source code...
⠦ Building your source code...
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -c utils/version.cpp -o utils/version.o
mkdir -p ../bin
g++ -MMD -MP -I. -std=c++17 -Wextra -Wpedantic -Wall -O3 -DASIO_STANDALONE -DNDEBUG -o ../bin/vroom main.o algorithms/munkres.o algorithms/kruskal.o algorithms/local_search/operator.o algorithms/local_search/local_search.o algorithms/heuristics/solomon.o routing/ors_wrapper.o routing/osrm_routed_wrapper.o routing/http_wrapper.o problems/vrp.o problems/cvrp/cvrp.o problems/vrptw/vrptw.o problems/tsp/tsp.o problems/cvrp/operators/intra_or_opt.o problems/cvrp/operators/intra_mixed_exchange.o problems/cvrp/operators/or_opt.o problems/cvrp/operators/reverse_two_opt.o problems/cvrp/operators/mixed_exchange.o problems/cvrp/operators/intra_relocate.o problems/cvrp/operators/pd_shift.o problems/cvrp/operators/relocate.o problems/cvrp/operators/route_exchange.o problems/cvrp/operators/intra_cross_exchange.o problems/cvrp/operators/exchange.o problems/cvrp/operators/two_opt.o problems/cvrp/operators/cross_exchange.o problems/cvrp/operators/intra_exchange.o problems/cvrp/operators/unassigned_exchange.o problems/vrptw/operators/intra_or_opt.o problems/vrptw/operators/intra_mixed_exchange.o problems/vrptw/operators/or_opt.o problems/vrptw/operators/reverse_two_opt.o problems/vrptw/operators/mixed_exchange.o problems/vrptw/operators/intra_relocate.o problems/vrptw/operators/pd_shift.o problems/vrptw/operators/relocate.o problems/vrptw/operators/route_exchange.o problems/vrptw/operators/intra_cross_exchange.o problems/vrptw/operators/exchange.o problems/vrptw/operators/two_opt.o problems/vrptw/operators/cross_exchange.o problems/vrptw/operators/intra_exchange.o problems/vrptw/operators/unassigned_exchange.o problems/tsp/heuristics/christofides.o problems/tsp/heuristics/local_search.o structures/generic/matrix.o structures/generic/edge.o structures/generic/undirected_graph.o structures/vroom/job.o structures/vroom/tw_route.o structures/vroom/break.o structures/vroom/raw_route.o structures/vroom/vehicle.o structures/vroom/time_window.o structures/vroom/solution_state.o structures/vroom/location.o structures/vroom/input/input.o structures/vroom/solution/summary.o structures/vroom/solution/route.o structures/vroom/solution/step.o structures/vroom/solution/computing_times.o structures/vroom/solution/solution.o structures/cl_args.o utils/exception.o utils/output_json.o utils/input_parser.o utils/version.o -lpthread -lssl -lcrypto
mkdir -p ../lib
ar cr ../lib/libvroom.a main.o algorithms/munkres.o algorithms/kruskal.o algorithms/local_search/operator.o algorithms/local_search/local_search.o algorithms/heuristics/solomon.o routing/ors_wrapper.o routing/osrm_routed_wrapper.o routing/http_wrapper.o problems/vrp.o problems/cvrp/cvrp.o problems/vrptw/vrptw.o problems/tsp/tsp.o problems/cvrp/operators/intra_or_opt.o problems/cvrp/operators/intra_mixed_exchange.o problems/cvrp/operators/or_opt.o problems/cvrp/operators/reverse_two_opt.o problems/cvrp/operators/mixed_exchange.o problems/cvrp/operators/intra_relocate.o problems/cvrp/operators/pd_shift.o problems/cvrp/operators/relocate.o problems/cvrp/operators/route_exchange.o problems/cvrp/operators/intra_cross_exchange.o problems/cvrp/operators/exchange.o problems/cvrp/operators/two_opt.o problems/cvrp/operators/cross_exchange.o problems/cvrp/operators/intra_exchange.o problems/cvrp/operators/unassigned_exchange.o problems/vrptw/operators/intra_or_opt.o problems/vrptw/operators/intra_mixed_exchange.o problems/vrptw/operators/or_opt.o problems/vrptw/operators/reverse_two_opt.o problems/vrptw/operators/mixed_exchange.o problems/vrptw/operators/intra_relocate.o problems/vrptw/operators/pd_shift.o problems/vrptw/operators/relocate.o problems/vrptw/operators/route_exchange.o problems/vrptw/operators/intra_cross_exchange.o problems/vrptw/operators/exchange.o problems/vrptw/operators/two_opt.o problems/vrptw/operators/cross_exchange.o problems/vrptw/operators/intra_exchange.o problems/vrptw/operators/unassigned_exchange.o problems/tsp/heuristics/christofides.o problems/tsp/heuristics/local_search.o structures/generic/matrix.o structures/generic/edge.o structures/generic/undirected_graph.o structures/vroom/job.o structures/vroom/tw_route.o structures/vroom/break.o structures/vroom/raw_route.o structures/vroom/vehicle.o structures/vroom/time_window.o structures/vroom/solution_state.o structures/vroom/location.o structures/vroom/input/input.o structures/vroom/solution/summary.o structures/vroom/solution/route.o structures/vroom/solution/step.o structures/vroom/solution/computing_times.o structures/vroom/solution/solution.o structures/cl_args.o utils/exception.o utils/output_json.o utils/input_parser.o utils/version.o
make: Leaving directory '/vroom/src'
Removing intermediate container b864ef736c3d
---> e32c67e783ba
Step 7/19 : ARG VROOM_EXPRESS_RELEASE=v0.7.0

---> Running in c7e43f60ff56
Removing intermediate container c7e43f60ff56
---> 0a932a3d31a5
Step 8/19 : RUN echo "Cloning and installing vroom-express release ${VROOM_EXPRESS_RELEASE}..." && git clone https://github.com/VROOM-Project/vroom-express.git && cd vroom-express && git fetch --tags && git checkout $VROOM_EXPRESS_RELEASE

---> Running in da611b1da0e1
Cloning and installing vroom-express release v0.7.0...
Cloning into 'vroom-express'...
⠦ Building your source code...
Note: checking out 'v0.7.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at 365754d Bump version number.

Removing intermediate container da611b1da0e1
---> 709c8c9b395d
Step 9/19 : FROM node:12-buster-slim as runstage
⠧ Building your source code...
---> 63d87d6740f6
Step 10/19 : COPY --from=builder /vroom-express/. /vroom-express

---> 23a6fb50e6cb
Step 11/19 : COPY --from=builder /vroom/bin/vroom /usr/local/bin

---> 44fa8f92eb11
Step 12/19 : WORKDIR /vroom-express

---> Running in 36e4d53c8913
Removing intermediate container 36e4d53c8913
---> 8782439b137b
Step 13/19 : RUN apt-get update > /dev/null && apt-get install -y --no-install-recommends libssl1.1 curl > /dev/null && rm -rf /var/lib/apt/lists/* && npm config set loglevel error && npm install && mkdir /conf

⠏ Building your source code...
debconf: delaying package configuration, since apt-utils is not installed
⠴ Building your source code...

husky@2.7.0 install /vroom-express/node_modules/husky
node husky install
husky > Setting up git hooks
husky > Done
husky > Like husky? You can support the project on Patreon:
husky > https://www.patreon.com/typicode 🐕
added 458 packages from 254 contributors and audited 458 packages in 15.063s
15 packages are looking for funding
run npm fund for details
⠇ Building your source code...
Removing intermediate container cd3cedf77a78
---> cf49f5013351
Step 14/19 : COPY ./docker-entrypoint.sh /docker-entrypoint.sh

---> f1df61115897
Step 15/19 : ENV VROOM_DOCKER=osrm VROOM_LOG=/conf

---> Running in 99b67f3ca1d1
Removing intermediate container 99b67f3ca1d1
---> ed3f139c88f2
Step 16/19 : HEALTHCHECK --start-period=10s CMD curl --fail -s http://localhost:3000/health || exit 1

---> Running in 978afb9d7c5b
Removing intermediate container 978afb9d7c5b
---> fbf3682c0189
Step 17/19 : EXPOSE 3000

---> Running in e213da66571c
Removing intermediate container e213da66571c
---> f418f05680aa
Step 18/19 : ENTRYPOINT ["/bin/bash"]

---> Running in 096c3ffdbc4f
Removing intermediate container 096c3ffdbc4f
---> a39d4ed909d2
Step 19/19 : CMD ["/docker-entrypoint.sh"]

---> Running in 72acca1ed520
Removing intermediate container 72acca1ed520
---> 745f3c68ac6e
Successfully built 745f3c68ac6e
Successfully tagged img-captain-api-vroom:latest
Build has finished successfully!

Deployed successfully api-vroom
App is available at http://api-vroom.cr.onway.app

@nilsnolde
Copy link
Collaborator

this is not reproducible for me.. you're using default here. meaning osrm, which expects profile: car (or other osrm profile, see here).

do you have osrm or ors available on that machine?

@nilsnolde
Copy link
Collaborator

with that config, what's the failing request then?

@tbiancoar
Copy link
Author

how i can check if OSRM is up in docker?

@nilsnolde
Copy link
Collaborator

not sure what you mean here.. did you explicitly start a OSRM instance?

@tbiancoar
Copy link
Author

how i can check in container if OSRM instance already up

@nilsnolde
Copy link
Collaborator

no idea if it has a health endpoint. just make a request.. http://project-osrm.org/docs/v5.23.0/api/

how are you running osrm? what is the failing request?

@AhtashamImtiyaz
Copy link

AhtashamImtiyaz commented Nov 29, 2020

I followed the steps and build my test in https://api-vroom.cr.onway.app/

But when I try with test request sometimes I got (using VROOM_ROUTER="ors"):

2020-11-06T13:05:18.465245743Z Fri, 06 Nov 2020 13:05:18 GMT: [Error]
2020-11-06T13:05:18.465584149Z Fri, 06 Nov 2020 13:05:18 GMT: Failed to connect to 0.0.0.0:5000
2020-11-06T13:05:18.465862641Z Fri, 06 Nov 2020 13:05:18 GMT:

Changing enviroment variables and using (VROOM_ROUTER="osrm") I got:

2020-11-06T13:12:49.048898242Z Fri, 06 Nov 2020 13:12:49 GMT: [Error]
2020-11-06T13:12:49.049249511Z Fri, 06 Nov 2020 13:12:49 GMT: Invalid profile: car.
2020-11-06T13:12:49.049500938Z Fri, 06 Nov 2020 13:12:49 GMT:

Any help?

You are receiving error because you need to install osrm locally or use any external service and add that serivice api in your config. Incase of ors, you can visit their website. And then in vehicles, you need to use the profile accordingly (Car is for osrm). If you dont specify a profile, VRoom will make it Car profile (its default in Vroom) but in docker, ors is default.

@renannery
Copy link

Not sure if related.

But I'm trying to deploy one image VROOM+ORS and I keep getting the following error when I'm testing the following request:

Failed Request

curl --location --request POST 'https://here-is-my-host.a.run.app' \
--header 'Content-Type: application/json' \
--data-raw '{
    "vehicles": [
        {
            "id": 0,
            "profile": "driving-car",
            "start": [
                2.3526,
                48.8604
            ],
            "end": [
                2.3526,
                48.8604
            ]
        }
    ],
    "jobs": [
        {
            "id": 0,
            "location": [
                2.3691,
                48.8532
            ]
        },
        {
            "id": 1,
            "location": [
                2.2911,
                48.8566
            ]
        }
    ],
    "options": {
        "g": true
    }
}'

Failed Response

{
    "code": 3,
    "error": "Failed to connect to 0.0.0.0:8080"
}

Interestingly it works when I change the coordinates to something "closer"

Success Request

curl --location --request POST 'https://vroom-3000-bqa4v2wf7a-uc.a.run.app' \
--header 'Content-Type: application/json' \
--data-raw '{
    "vehicles": [
        {
            "id": 0,
            "profile": "driving-car",
            "start": [
                -1,
                0
            ],
            "end": [
                -1,
                0
            ]
        }
    ],
    "jobs": [
        {
            "id": 0,
            "location": [
                -1,
                0
            ]
        },
        {
            "id": 1,
            "location": [
                -1,
                0
            ]
        }
    ]
}'

Success Response

{
    "code": 0,
    "summary": {
        "cost": 0,
        "unassigned": 0,
        "service": 0,
        "duration": 0,
        "waiting_time": 0,
        "priority": 0,
        "computing_times": {
            "loading": 0,
            "solving": 0
        }
    },
.....

docker-compose.yml

version: "2.4"
services:
  vroom:
    network_mode: host
    image: vroomvrp/vroom-docker:v1.8.0
    container_name: vroom
    volumes:
      - ./vroom-conf/:/conf
    environment:
      - VROOM_ROUTER=ors
    depends_on:
      - ors

  ors:
    container_name: ors
    ports:
      - 8080:8080
    image: openrouteservice/openrouteservice:latest
    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:/ors-conf
      - ./path/to/pbf/my_region_file.osm.pbf:/ors-core/data/osm_file.pbf
    environment:
      - BUILD_GRAPHS=False
      - "JAVA_OPTS=-Djava.awt.headless=true -server -XX:TargetSurvivorRatio=75 -XX:SurvivorRatio=64 -XX:MaxTenuringThreshold=3 -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:ParallelGCThreads=4 -Xms2g -Xmx4g"
      - "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"

config.yml

I tried to change the host from 0.0.0.0 to ors based on other project but no luck

cliArgs:
  geometry: false # retrieve geometry (-g)
  threads: 4 # number of threads to use (-t)
  explore: 5 # exploration level to use (0..5) (-x)
  limit: "1mb" # max request size
  logdir: "/.." # the path for the logs relative to ./src
  maxlocations: 1000 # max number of jobs/shipments locations
  maxvehicles: 200 # max number of vehicles
  override: true # allow cli options override (-g, -t and -x)
  path: "" # VROOM path (if not in $PATH)
  port: 3000 # expressjs port
  router: "ors" # routing backend (osrm, libosrm or ors)
  timeout: 300000 # milli-seconds
  baseurl: "/" #base url for api
routingServers:
  ors:
    driving-car:
      host: "ors"
      port: "8080"
    driving-hgv:
      host: "ors"
      port: "8080"
    cycling-regular:
      host: "ors"
      port: "8080"
    cycling-mountain:
      host: "ors"
      port: "8080"
    cycling-road:
      host: "ors"
      port: "8080"
    cycling-electric:
      host: "ors"
      port: "8080"
    foot-walking:
      host: "ors"
      port: "8080"
    foot-hiking:
      host: "ors"
      port: "8080"

I'm basically composing vroom-docker with docker-compose up --build --force-recreate -d and pushing the image to my server. From my understanding, I don't need to push a different image of ORS docker and refer the external host on the config.yml.

Which would be something like:

ors:
    driving-car:
      host: "externalhost.net"
      port: "8080"

Would appreciate any help. Tks!

@jcoupey
Copy link
Contributor

jcoupey commented Dec 15, 2020

The reason why it "works" in your second example is that there is only one location in the problem so we use a trivial matrix and bypass the routing engine call. Just slightly change any of the coordinates and you'll hit the same error.

So it all comes down to: there is something wrong which prevents reaching your ORS endpoint.

@nilsnolde
Copy link
Collaborator

You're not doing anything wrong actually. However, use 0.0.0.0 for localhost, not the service name ors as long as you operate vroom in network_mode=host. Remove that, install a private docker network and you can use the service names and don't have to expose the ORS port.

You're probably hitting this one: GIScience/openrouteservice#839. Follow the advice I gave there.

You can confirm when you're looking at the ORS logs.

@nilsnolde
Copy link
Collaborator

closing this. weirdest title anyways. @renannery if your issue still persists, probably you'll need to debug the ORS container. The setup in this repository should work if the OSRM and ORS images and runtime containers are not faulty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants