Skip to content

Hard limit on the GTFS-realtime feeds size #2738

Description

@ccyrille

Expected behavior

Have no hard-coded limit on the size of the GTFS-realtime feeds.

Observed behavior

When we provide a feed that is more than 64MB, we get the following error when the updater runs :

com.google.protobuf.InvalidProtocolBufferException: Protocol message was too large.  May be malicious.  Use CodedInputStream.setSizeLimit() to increase the size limit.
	at com.google.protobuf.InvalidProtocolBufferException.sizeLimitExceeded(InvalidProtocolBufferException.java:110) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.CodedInputStream.tryRefillBuffer(CodedInputStream.java:1131) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.CodedInputStream.refillBuffer(CodedInputStream.java:1081) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.CodedInputStream.readRawByte(CodedInputStream.java:1149) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.CodedInputStream.readRawVarint64SlowPath(CodedInputStream.java:778) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.CodedInputStream.readRawVarint64(CodedInputStream.java:770) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.CodedInputStream.readInt64(CodedInputStream.java:343) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate$StopTimeEvent.<init>(GtfsRealtime.java:4041) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate$StopTimeEvent.<init>(GtfsRealtime.java:3986) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate$StopTimeEvent$1.parsePartialFrom(GtfsRealtime.java:4079) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate$StopTimeEvent$1.parsePartialFrom(GtfsRealtime.java:4074) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.CodedInputStream.readMessage(CodedInputStream.java:495) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate$StopTimeUpdate.<init>(GtfsRealtime.java:4808) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate$StopTimeUpdate.<init>(GtfsRealtime.java:4750) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate$StopTimeUpdate$1.parsePartialFrom(GtfsRealtime.java:4875) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate$StopTimeUpdate$1.parsePartialFrom(GtfsRealtime.java:4870) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.CodedInputStream.readMessage(CodedInputStream.java:495) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate.<init>(GtfsRealtime.java:3825) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate.<init>(GtfsRealtime.java:3759) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate$1.parsePartialFrom(GtfsRealtime.java:3884) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$TripUpdate$1.parsePartialFrom(GtfsRealtime.java:3879) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.CodedInputStream.readMessage(CodedInputStream.java:495) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$FeedEntity.<init>(GtfsRealtime.java:2212) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$FeedEntity.<init>(GtfsRealtime.java:2149) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$FeedEntity$1.parsePartialFrom(GtfsRealtime.java:2276) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$FeedEntity$1.parsePartialFrom(GtfsRealtime.java:2271) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.CodedInputStream.readMessage(CodedInputStream.java:495) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$FeedMessage.<init>(GtfsRealtime.java:188) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$FeedMessage.<init>(GtfsRealtime.java:122) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$FeedMessage$1.parsePartialFrom(GtfsRealtime.java:224) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.transit.realtime.GtfsRealtime$FeedMessage$1.parsePartialFrom(GtfsRealtime.java:219) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:192) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:209) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:215) ~[otp-1.3.0-shaded.jar:1.1]
	at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:49) ~[otp-1.3.0-shaded.jar:1.1]
	at org.opentripplanner.updater.stoptime.GtfsRealtimeHttpTripUpdateSource.getUpdates(GtfsRealtimeHttpTripUpdateSource.java:70) ~[otp-1.3.0-shaded.jar:1.1]
	at org.opentripplanner.updater.stoptime.PollingStoptimeUpdater.runPolling(PollingStoptimeUpdater.java:152) [otp-1.3.0-shaded.jar:1.1]
	at org.opentripplanner.updater.PollingGraphUpdater.run(PollingGraphUpdater.java:60) [otp-1.3.0-shaded.jar:1.1]
	at org.opentripplanner.updater.GraphUpdaterManager.lambda$startUpdaters$1(GraphUpdaterManager.java:175) [otp-1.3.0-shaded.jar:1.1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_202]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_202]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_202]

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

otp-1.3.0-shaded.jar

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions