Project-OSRM / osrm-frontend

Modular rewrite of the OSRM frontend using LRM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Route not provided when start and end address provided

ubalaji opened this issue · comments

I have installed latest dcoker images of both osrm-frontend and osrm-backend on Linux. When I type start address the location is showing. After typing end address the route is not showing. The is recognized when I type end address but route is not showing.

My docker port for frontend is 8080 and backend port is 80.

Also I have modified leaflet_options.js file to AS follows.

services: [{
label: 'Car (fastest)',
path: 'http://localhost:80/route/v1'
}],

Also I have env variable "OSRM_BACKEND=http://localhost:80"
When I use http://map.project-osrm.org url, use same start and end address would provide route.

I am not sure why I am not able to see route on local. Would any of you experienced similar issue and how did you resolve?

Same issue here.. you could solve it?

Hi,
I had similar issue and solved it by setting right env variables in the command when launchinf the container.
Problem was network Connectivity. The container could'nt connect to localhost or to 127.0.0.1. I had to specify IP of the docker server hosting the container. Here are the variables passed in the command :
docker run -p 9966:9966 -e OSRM_BACKEND='http://192.168.100.122:5000' -e OSRM_CENTER='48.859903,2.338919' -e OSRM_ZOOM='13' -e OSRM_LANGUAGE='fr' -e OSRM_LABEL='Car (fastest)' osrm/osrm-frontend

Hope it helps

Hello

I have the same issue here, both backend and front end are running in containers. I run the following command docker run -p 9966:9966 -e OSRM_BACKEND='http://172.0.0.2:5000' -e OSRM_CENTER='48.859903,2.338919' -e OSRM_ZOOM='13' -e OSRM_LANGUAGE='fr' -e OSRM_LABEL='Car (fastest)' osrm/osrm-frontend

http://172.0.0.2:5000 : Is the container ip running the backend
But still no routes generated in the Front.

I checked to src/leaflet_options.js and noticed that it got the ENV variable 172.0.0.2:5000
Also tried to curl 172.0.0.2:5000 from the container hosting the Front and it seems to respond.

Do you have any idea what could be the problem with the front and back?

Same issue, running on docker containers

I managed to get it working using the public ip instead of the container ip

Didn't help me, but I'm able to connect to the backend with curl :(

docker run -p 9966:9966 -e OSRM_BACKEND='http://<MYPUBLIC_IP>:5000' -e OSRM_ZOOM='13' -e OSRM_LABEL='Car (fastest)' osrm/osrm-frontend

tried this way, is it was you meant?

Since it is the user's browser making the call to the backend, the public IP (or localhost) needs to be used. The front-end does not call the back-end directly.

Hope this explains the trouble and why the solution is to use an IP address the browser can hit. I spent several hours on this, before I found this issue. It seems important to document the reason why this works, so others can benefit from our experience.