nextcloud / maps

🌍🌏🌎 The whole world fits inside your cloud!
https://apps.nextcloud.com/apps/maps
GNU Affero General Public License v3.0
481 stars 87 forks source link

osrm routing not working #429

Open mggcodes opened 3 years ago

mggcodes commented 3 years ago

Hi Guys,

I have a problem with the maps app and my osrm routing server. The osrm Server run's correctly. When I try routing in the Nextcloud Maps app I get an error "Routing Error: undefined" and no routing is present.

I installed both services at the same server. The server is running on Ubuntu. I also see no communication in any logfile when I get the error.

I used the outgoing IP address in the configuration, no localhost.

Nextcloud Version: 19.0.1 Maps Version: 0.1.6

develroo commented 3 years ago

Ditto. Manually connecting to the server is fine and I can see it working. But the settings do not seem to reach out to the server. Where is the debugging information so we can see where the app is falling over ? There seems to be no logging done in nextcloud itself which seems strange.

pwepwe973 commented 3 years ago

Hello,

Same problem for me. the OSRM server responds well to the request with the urls

http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true

but impossible to carry out requests with maps app, I added in the parameters of nextcloud the address of the servers: http: // address-ip / route / v1 but when I launch a request with maps app, this message appears: Routing error: undefined

pwepwe973 commented 3 years ago

hello, you have not a solution for this probleme?

mggcodes commented 3 years ago

I find out that this is an error occurring in Safari Browser because of CORS checks. I tried something on the apache security configuration but the error still occurs. The request is blocked by the browser so no log file on the server is written. Can anybody help here? Maybe the Ajax request can be changed?

[Error] Not allowed to request resource (anonyme Funktion) (script.js:75:17602) route (script.js:75:485275) route (script.js:75:451596) _onWaypointsChanged (script.js:75:450490) fire (script.js:6:4889) _fireChanged (script.js:75:493214) spliceWaypoints (script.js:75:490811) spliceWaypoints (script.js:75:448460) setRouteTo (script.js:104:26053) select (script.js:104:33225) _trigger (main.js:1:934664) menuselect (main.js:1:990484) s (main.js:1:933362) dispatch (main.js:1:40264) (anonyme Funktion) (main.js:1:38350) trigger (main.js:1:69522) (anonyme Funktion) (main.js:1:925304) (anonyme Funktion) (main.js:1:70035) each (main.js:1:3754) each (main.js:1:1732) trigger (main.js:1:70007) _trigger (main.js:1:934627) select (main.js:1:987094) (anonyme Funktion) (main.js:1:928077) keydown (main.js:1:988437) s (main.js:1:933362) dispatch (main.js:1:40264) (anonyme Funktion) (main.js:1:38350) [Error] XMLHttpRequest cannot load http://192.168.2.198:8081/route/v1/car/11.875963,50.7480404;10.0197398,54.421985?overview=false&alternatives=true&steps=true&hints=; due to access control checks. (anonyme Funktion) (script.js:75:17602) route (script.js:75:485275) route (script.js:75:451596) _onWaypointsChanged (script.js:75:450490) fire (script.js:6:4889) _fireChanged (script.js:75:493214) spliceWaypoints (script.js:75:490811) spliceWaypoints (script.js:75:448460) setRouteTo (script.js:104:26053) select (script.js:104:33225) _trigger (main.js:1:934664) menuselect (main.js:1:990484) s (main.js:1:933362) dispatch (main.js:1:40264) (anonyme Funktion) (main.js:1:38350) trigger (main.js:1:69522) (anonyme Funktion) (main.js:1:925304) (anonyme Funktion) (main.js:1:70035) each (main.js:1:3754) each (main.js:1:1732) trigger (main.js:1:70007) _trigger (main.js:1:934627) select (main.js:1:987094) (anonyme Funktion) (main.js:1:928077) keydown (main.js:1:988437) s (main.js:1:933362) dispatch (main.js:1:40264) (anonyme Funktion) (main.js:1:38350)

Following Headers I tried: HTTP/1.1 200 OK Keep-Alive: timeout=5, max=99 Content-Encoding: gzip Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE Content-Security-Policy: script-src 'self' 192.168.2.198 'unsafe-inline'; Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Referrer-Policy: no-referrer Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method Content-Length: 150 X-XSS-Protection: 1; mode=block Date: Sat, 02 Jan 2021 13:19:01 GMT Connection: Keep-Alive Expires: Thu, 19 Nov 1981 08:52:00 GMT X-Frame-Options: SAMEORIGIN Content-Type: application/json; charset=utf-8 X-Content-Type-Options: nosniff Server: Apache/2.4.29 (Ubuntu) X-Robots-Tag: none Strict-Transport-Security: max-age=15552000; includeSubDomains X-Download-Options: noopen Feature-Policy: autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none' Allow: GET,POST,OPTIONS,PUT,DELETE X-Permitted-Cross-Domain-Policies: none

sentinel29 commented 1 year ago

It seems this issue has been opened for a while; I am on NC 26 and Maps 1.02. The settings for OSRM, specifically the driving routing feature, doesn't comply with how OSRM is expecting the URL parameter. It appears the map code is injecting "car" into the URL when the correct format is "/route/v1/driving". Had I known this was a bug earlier on, I wouldn't have spent my time doing the map extractions and using NGINX to SSL wrap the http-only "development" server so that mixed content wouldn't be an issue. Further, as noted years before by another user, CORS policy is blocking the XMLHttpRequest despite the request originating in the same domain, just from a different server. Overall, great integration but completely bummed the routing function is broken.

ant0nwax commented 1 year ago

Hi @sentinel29 the routing function with mapbox works for me... I was reading a lot before I started to decide which routing I shall give a go...

pwepwe973 commented 11 months ago

Hi @sentinel29 the routing function with mapbox works for me... I was reading a lot before I started to decide which routing I shall give a go...

hello

I also use mapbox but I would have preferred to have my self-hosted server

and the thing is that it's the last of map contributors worries :)

RealSebFox commented 11 months ago

When I create a Vhost redirecting to port 5000 on localhost and I use http://sub.mydomain.com/route/v1 in Nextcloud Maps, it works, at least for car-navigation.

When I try to connect directly on port 5000 in Nextcloud maps, it doesn't work at all. I get the same error mggcodes gets.

Curl works perfectly fine for cars, bike and foot on http://127.0.0.1:5000.

Please fix this...

develroo commented 7 months ago

Just want to add to this as I too cannot seem to get the OSRM settings to work either, despite the server being on a remote machine and reachable from the internet.

The default profile name are, car bike and foot but the example also lists driving so it seems a bit confusing. However, I have tried all combinations with and without a trailing slash and I don't see anything trying to hit my OSRM server from the nextcloud IP.

It is most peculiar. Especially as I am seeing nothing in the logs about it and I am running the nextcloud as a docker-compose stack and so can see everything in real time.

It is quite irritating to be honest.

Edit:

For ref.

Maps version 1.1.1 Nextcloud Hub 6 27.1.3 and osrm-server v5.26.0

smolinde commented 3 months ago

Hi all, it appears that I have the exact same problem with a Raspberry Pi 5, Ubuntu 23.10 Server, Nextcloud 28.0.3, Maps v1.3.1, and OSRM-Backend v5.28.0. Is there any chance of a solution?