Cambridge-Community-Kitchen / cck-volunteer-web-app

https://volunteer.cckitchen.uk
3 stars 2 forks source link

"500 Internal Server Error" when trying to download GPX file #18

Open faceless-stoat opened 1 year ago

faceless-stoat commented 1 year ago

Since at least 8 December, the link to download a GPX file (via /api/cck/route.gpx) has been giving "500 Internal Server Error" on at least some routes some of the time. (Possibly, all routes all of the time.)

I observed this myself on the 8 Dec delivery round for Chesterton. One other person reported the same for the Trumpington route that day.

The same problem (probably) has been reported at least once since ("I hit the gpx button last week and got a server error"). I don't have positive evidence that this is currently working for anyone.

I'm pretty sure it worked fine (no server error, and plausible GPX contents) on 24 November (for the Mill Road route, at least).

faceless-stoat commented 1 year ago

Happening again with tonight's Mill Road route. (I haven't yet heard of a counterexample to "it always happens now".)

For completeness, the route URL containing the broken button (with passcode redacted): https://volunteer.cckitchen.uk/route?date=22-12-2022&ref=mill-road&passcode=XXXX and the (redacted) URL of the broken link itself: https://volunteer.cckitchen.uk/api/cck/route.gpx?date=22-12-2022&ref=mill-road&passcode=XXXX&mode=bicycling

(I had a look in the source for the "500 | Internal Server Error." page just in case, no obvious clue there.)

pdl commented 10 months ago

This is because the gpx route makes a request to:

GET /maps/api/geocode/json?address=The%20Lockon%2C%20Fair%20Street%2C%20Cambridge&key=

Which fails with error

You must enable Billing on the Google Cloud Project at https://console.cloud.google.com/project/_/billing/enable Learn more at https://developers.google.com/maps/gmp-get-started

So I assume we were using a free trial and this ran out.

faceless-stoat commented 8 months ago

(The GPX functionality is no longer exposed, as of about fcff3cf2.)

ml-evs commented 6 months ago

Hi, I'd love to use this functionality for my deliveries. Would you be happy if I made a PR trying to fix this? (and get around Google Cloud, if possible) Just posted in the group too but figured this is a more appropriate place.

faceless-stoat commented 6 months ago

From discussion elsewhere, I think a PR would be welcome.

What content would you want in your GPX file? For me, just waypoints for drops is entirely sufficient, which can be done entirely mechanically without needing anything navigation-capable on the app side. I don't need any suggested navigation information (I'll let my device or brain do that). (Unlike the original version of this GPX feature, which provided a navigation route but not waypoints, so wasn't useful for me even when it was working -- this might have been a failure of requirements capture.)

(I am currently using a shonky script on the API endpoint to achieve this end -- not yet published, but output is similar to that from my previous version of the same script -- example here. Would that sort of output work for you too?)

Another comment I've heard is that GPX files aren't very usable with Google Maps. If there were demand (and I've no evidence there is) it might be nice to also be able to produce another format that works better with it (KMZ maybe?), if such exists at all. But it's probably an unnecessary complication.

ml-evs commented 6 months ago

Great! Quick thoughts: