CUTR-at-USF / bullrunner-gtfs-realtime-generator

Desktop application that retrieves AVL data from the USF Bull Runner's AVL system and produces Trip Updates and Vehicle Positions files in GTFS-realtime format.
Other
2 stars 3 forks source link

Syncromatics Feed changes, broken generator #19

Closed jmfield2 closed 8 years ago

jmfield2 commented 8 years ago

I think there have been some changes to the Syncromatics feed (https://usfbullrunner.com/region/0/routes) which has broken our local generator so that we are not receiving any vehicle updates.

2016-09-23 09:25:13,560 WARN  [GtfsRealtimeProviderImpl.java:568] : Error in vehicle refresh task
org.json.JSONException: Stepping back two steps is not supported
    at org.json.JSONTokener.back(JSONTokener.java:77)
    at org.json.JSONTokener.nextValue(JSONTokener.java:365)
    at edu.usf.cutr.gtfs_realtime.bullrunner.BullRunnerConfigExtract.downloadCofiguration(BullRunnerConfigExtract.java:55)
    at edu.usf.cutr.gtfs_realtime.bullrunner.GtfsRealtimeProviderImpl.extractHeading(GtfsRealtimeProviderImpl.java:650)
    at edu.usf.cutr.gtfs_realtime.bullrunner.GtfsRealtimeProviderImpl.refreshTripVehicle(GtfsRealtimeProviderImpl.java:450)

The logs indicate some JSONTokenizer exceptions, but if I copy the same code and save a local copy of the feed JSON I don't get the same error - strange.

A copy of the JSON feed that is causing problems:

[{"ID":423,"ArrivalsEnabled":true,"DisplayName":"A Route A","CustomerID":3,"DirectionStops":null,"Points":null,"Color":"#00573C","TextColor":"#FFFFFF","ArrivalsShowVehicleNames":true,"IsHeadway":false,"ShowLine":true,"Name":"Route A","ShortName":"A","RegionIDs":[],"ForwardDirectionName":"Forwards","BackwardDirectionName":"Backwards","NumberOfVehicles":0,"Patterns":null},{"ID":425,"ArrivalsEnabled":true,"DisplayName":"B Route B","CustomerID":3,"DirectionStops":null,"Points":null,"Color":"#0077D1","TextColor":"#ffffff","ArrivalsShowVehicleNames":false,"IsHeadway":false,"ShowLine":true,"Name":"Route B","ShortName":"B","RegionIDs":[],"ForwardDirectionName":"Forwards","BackwardDirectionName":"Backwards","NumberOfVehicles":0,"Patterns":null},{"ID":426,"ArrivalsEnabled":true,"DisplayName":"C Route C","CustomerID":3,"DirectionStops":null,"Points":null,"Color":"#AC49D0","TextColor":"#ffffff","ArrivalsShowVehicleNames":false,"IsHeadway":false,"ShowLine":true,"Name":"Route C","ShortName":"C","RegionIDs":[],"ForwardDirectionName":"Forwards","BackwardDirectionName":"Backwards","NumberOfVehicles":0,"Patterns":null},{"ID":428,"ArrivalsEnabled":true,"DisplayName":"D Route D","CustomerID":3,"DirectionStops":null,"Points":null,"Color":"#F70505","TextColor":"#ffffff","ArrivalsShowVehicleNames":false,"IsHeadway":false,"ShowLine":true,"Name":"Route D","ShortName":"D","RegionIDs":[],"ForwardDirectionName":"Forwards","BackwardDirectionName":"Backwards","NumberOfVehicles":0,"Patterns":null},{"ID":427,"ArrivalsEnabled":true,"DisplayName":"E Route E","CustomerID":3,"DirectionStops":null,"Points":null,"Color":"#D4BA13","TextColor":"#ffffff","ArrivalsShowVehicleNames":false,"IsHeadway":false,"ShowLine":true,"Name":"Route E","ShortName":"E","RegionIDs":[],"ForwardDirectionName":"Forwards","BackwardDirectionName":"Backwards","NumberOfVehicles":0,"Patterns":null},{"ID":883,"ArrivalsEnabled":true,"DisplayName":"F Route F","CustomerID":3,"DirectionStops":null,"Points":null,"Color":"#8F6A51","TextColor":"#ffffff","ArrivalsShowVehicleNames":false,"IsHeadway":false,"ShowLine":true,"Name":"Route F","ShortName":"F","RegionIDs":[],"ForwardDirectionName":"Forwards","BackwardDirectionName":"Backwards","NumberOfVehicles":0,"Patterns":null}]

Further testing showed that perhaps the feed had switched to HTTPS (it was hard-coded as an http link). Changing the URL to HTTPS in two places of GtfsRealtimeProviderImpl.java seems to fix the issue locally. I'll PR a patch soon.