MobilityData / gtfs-realtime-validator

Java-based tool that validates General Transit Feed Specification (GTFS)-realtime feeds
Other
38 stars 9 forks source link

Duplicate trip_id in schedule blocks RT validator from running #178

Open lauriemerrell opened 1 year ago

lauriemerrell commented 1 year ago

Summary:

I have a vehicle positions feed whose associated schedule feed has duplicate trip_ids in trips.txt and that is causing the RT validator to fail, error below.

Steps to reproduce:

How can we reproduce the issue?

Attempt to validate the Merced The Bus vehicle positions feed: https://thebuslive.com/gtfs-rt/vehiclepositions against its associated schedule: https://thebuslive.com/gtfs

Expected behavior:

What did you expect the application to do?

Ideally the validator would still be able to run. It's actually a bit ironic because the reason I was trying to check the validator was that I believe that this vehicle positions feed doesn't actually list trip_id values in its trip descriptors, but I was unable to check the behavior related to that because the validator won't run.

Observed behavior:

What happened instead? Describe your issue in detail here.

Error:

INFO org.mobilitydata.gtfsrtvalidator.lib.batch.BatchProcessor - Starting batch processor...
INFO org.mobilitydata.gtfsrtvalidator.lib.batch.BatchProcessor - Reading GTFS data from /tmp/tmpld9ohzj3/gtfs.zip...
INFO - Exception in thread "main" org.onebusaway.csv_entities.exceptions.CsvEntityIOException: io error: entityType=org.onebusaway.gtfs.model.Trip path=trips.txt lineNumber=313
INFO -  at org.onebusaway.csv_entities.CsvEntityReader.readEntities(CsvEntityReader.java:161)
INFO -  at org.onebusaway.csv_entities.CsvEntityReader.readEntities(CsvEntityReader.java:120)
INFO -  at org.onebusaway.csv_entities.CsvEntityReader.readEntities(CsvEntityReader.java:115)
INFO -  at org.onebusaway.gtfs.serialization.GtfsReader.run(GtfsReader.java:171)
INFO -  at org.onebusaway.gtfs.serialization.GtfsReader.run(GtfsReader.java:159)
INFO -  at org.mobilitydata.gtfsrtvalidator.lib.batch.BatchProcessor.readGtfsData(BatchProcessor.java:315)
INFO -  at org.mobilitydata.gtfsrtvalidator.lib.batch.BatchProcessor.processFeeds(BatchProcessor.java:139)
INFO -  at org.mobilitydata.gtfsrtvalidator.lib.Main.main(Main.java:62)
INFO - Caused by: org.onebusaway.gtfs.serialization.DuplicateEntityException: duplicate entity id: type=org.onebusaway.gtfs.model.Trip id=42_388
INFO -  at org.onebusaway.gtfs.serialization.GtfsReader$EntityHandlerImpl.registerAgencyId(GtfsReader.java:280)
INFO -  at org.onebusaway.gtfs.serialization.GtfsReader$EntityHandlerImpl.handleEntity(GtfsReader.java:249)
INFO -  at org.onebusaway.csv_entities.CsvEntityReader$EntityHandlerImpl.handleEntity(CsvEntityReader.java:225)
INFO -  at org.onebusaway.csv_entities.IndividualCsvEntityReader.readEntity(IndividualCsvEntityReader.java:148)
INFO -  at org.onebusaway.csv_entities.IndividualCsvEntityReader.handleLine(IndividualCsvEntityReader.java:98)
INFO -  at org.onebusaway.csv_entities.CsvEntityReader.readEntities(CsvEntityReader.java:157)
INFO -  ... 7 more

Platform:

What is the operating system and Java version of your machine? What browser (Chrome, Internet Explorer, Firefox)did you use?

Using gtfs-realtime-validator-lib-1.0.0-20220223.003525-2.jar from https://github.com/MobilityData/gtfs-realtime-validator/packages/1268973