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

GtfsRealtimeTripLibrary exception #237

Open
nakkore opened this issue Jan 8, 2020 · 5 comments
Open

GtfsRealtimeTripLibrary exception #237

nakkore opened this issue Jan 8, 2020 · 5 comments
Assignees

Comments

@nakkore
Copy link

nakkore commented Jan 8, 2020

I came across the following issue because of an apparently invalid trip updates feed.
If I've understood correctly the real-time feed contained trips where the start_time was different from the departure_time/arrival_time defined in the static gtfs: in my case was 24:35:00 which represents the same time in different format.

trip_update {
trip {
trip_id: "VJ0d2212ef07777d1d4cf8a0bf518358dd02f84fdf"
start_time: "00:35:00"
start_date: "20200105"
route_id: "104"
}

This small inconsistency triggers the attached exception which can easily fixed by wrapping

blockStartTime = getBlockStartTimeForTripStartTime(instance,
tripEntry.getId(), tripStartTime);

in a try-catch block. I'd log the error though.

[GtfsRealtimeSource.java:850] : Error updating from GTFS-realtime data sources
java.lang.NullPointerException
        at org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeTripLibrary.getBlockStartTimeForTripStartTime(GtfsRealtimeTripLibrary.java:468)
        at org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeTripLibrary.getTripDescriptorAsBlockDescriptor(GtfsRealtimeTripLibrary.java:552)
        at org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeTripLibrary.groupTripUpdatesAndVehiclePositions(GtfsRealtimeTripLibrary.java:309)
        at org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeSource.handeUpdates(GtfsRealtimeSource.java:417)
        at org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeSource.refresh(GtfsRealtimeSource.java:396)
        at org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeSource$RefreshTask.run(GtfsRealtimeSource.java:847)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Thank you

@sheldonabrown
Copy link
Member

Thanks @nakkore; what version/branch of onebusaway-application-modules are you seeing this in?

@nakkore
Copy link
Author

nakkore commented Jan 9, 2020 via email

@nakkore
Copy link
Author

nakkore commented Jan 10, 2020

@sheldonabrown sheldonabrown self-assigned this Jan 12, 2020
@sheldonabrown
Copy link
Member

It looks like the trip isn't being found, perhaps because of how the service date is either determined or provided. Likely needs more investigation, but I've at least prevented the exception in this commit.

camsys/onebusaway-application-modules@70b66ba

@nakkore
Copy link
Author

nakkore commented Jan 13, 2020

cool, thank you.

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

No branches or pull requests

2 participants