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

Feeds by bbox fails on v1 #1314

Closed
timwis opened this issue Feb 16, 2022 · 3 comments · Fixed by #1315
Closed

Feeds by bbox fails on v1 #1314

timwis opened this issue Feb 16, 2022 · 3 comments · Fixed by #1315
Labels

Comments

@timwis
Copy link

timwis commented Feb 16, 2022

Hello, I'm using valhalla to download transitland data, which tried to access this URL:

https://transit.land/api/v1/feeds.geojson?per_page=false&api_key=MY_API_KEY&bbox=-0.489,51.28,0.236,51.686&active_feed_version_import_level=4

Unfortunately, it gets a 500 http status, with transit land returning the following error in the response body:

{"message": "[NoMethodError] undefined method `onestop_id' for nil:NilClass"}

When I append a onestop_id to the URL (&onestop_id=f-gcpv-transportforlondon), it loads, but not without it. I'm assuming this is an issue with the transitland api and not with valhalla, because the transitland api docs have a similar request in their examples:

/api/v1/feeds?bbox=-122.4183,37.7758,-122.4120,37.7858

This request also fails (I added my API key to it) with the same error.

I'm pretty sure this is an issue in the v1 API, but please let me know if it looks like I've done something wrong. Thanks for your time, and for a great application!

@drewda
Copy link
Member

drewda commented Feb 17, 2022

Hi, thanks for reporting this issue. It's unfortunately a known issue, but has not yet been addressed, as most development time is current going to Transitland v2 APIs.

Please follow transitland/transitland#340 for any updates.

@drewda drewda added the bug label Feb 17, 2022
@timwis
Copy link
Author

timwis commented Feb 17, 2022

Ah, okay, fair enough. I've managed to get the project running locally in hopes I could have a go at it (I've worked with rails before), but I'm not able to reproduce it locally :/ Any chance your server logging mentions which file/line the error's originating from? My guess is there's a feed that's missing a onestop_id somehow, so we just need to add a null check in the serializer.

I also noticed that the /feeds endpoint throws this error even without the ?bbox parameter.

https://transit.land/api/v1/feeds?api_key=XYZ

@drewda
Copy link
Member

drewda commented Feb 18, 2022

Thanks for trying to investigate. Yes, you are right that it appears to be a serializer that cannot handle a null value.

FYI, as part of the ongoing Transitland v2 transition this codebase is used to power the v1 endpoints in a read-only manner. The database behind the scenes is now populated by the v2 transitland-lib, which does make it more of a challenge to debug the behavior of this codebase.

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