entur / lamassu

Mobility hub
European Union Public License 1.2
5 stars 7 forks source link

(Possibly only temporarilly) invalid `gbfs.json` are cached and will only be updated on Lamassu restart #495

Open hbruch opened 1 week ago

hbruch commented 1 week ago

Expected behavior

Lamassu should not subscribe successfully to a system, which does not publish a valid gbfs.json. (Ideally, gbfs.json should be reloaded periodically to detect new/changed upstream feed declarations)

Observed behavior

The gbfs.json file of a system is requested once on startup, and, if parseable, cached, even if it does not declare all required feeds (e.g. has system_information missing). It can only be refreshed via a Lamassu restart.

(One of our providers temporarily published incomplete gbfs.json files wich did not contain a system_information feed).

See also https://github.com/entur/gbfs-validator-java/issues/90 for improved gbfs.json validation rules.

Version of lamassu used (exact commit hash or JAR name)

https://github.com/entur/lamassu/commit/21954666f4766c9384a846296b8fe10e4b40afdb

Data sets in use (links to GBFS feeds)

N.A. (meanwhile the corrupt gbfs.json is fixed by provider)

How to reproduce

Try to import a feed with a gbfs.json like:

{"last_updated":1719298781,"ttl":60,"version":"2.3","data":{"en":{"feeds":[{"name":"gbfs","url":"http://localhost:8000/gbfs/v2/myfeed/gbfs"},{"name":"geofencing_zones","url":"http://localhost:8000/gbfs/v2/myfeed/geofencing_zones"}]}}}

and change the gbfs.json after lamassu is started. Lamassu will continue to publish the initially loaded, incorrect gbfs.json.