Skip to content

ArrayIndexOutOfBound in ScheduledTransitLegReference #6999

@vpaturet

Description

@vpaturet

We experience the following exception when attempting to deserialize legs:


Exception while fetching data (/leg) : Index 15 out of bounds for length 14
java.lang.ArrayIndexOutOfBoundsException: Index 15 out of bounds for length 14
	at java.base/java.util.ImmutableCollections$ListN.get(ImmutableCollections.java:687)
	at 
org.opentripplanner.model.plan.legreference.ScheduledTransitLegReference.findStopPositionInPattern(ScheduledTransitLegReference.java:319)
	at org.opentripplanner.model.plan.legreference.ScheduledTransitLegReference.findStopPositionInPattern(ScheduledTransitLegReference.java:247)
	at org.opentripplanner.model.plan.legreference.ScheduledTransitLegReference.getLeg(ScheduledTransitLegReference.java:129)
	at org.opentripplanner.model.plan.legreference.ScheduledTransitLegReference.getLeg(ScheduledTransitLegReference.java:29)
	at org.opentripplanner.apis.transmodel.TransmodelGraphQLSchemaFactory.lambda$createDefault$37(TransmodelGraphQLSchemaFactory.java:1521)
	at graphql.execution.ExecutionStrategy.invokeDataFetcher(ExecutionStrategy.java:510)
	at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:464)
	at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:404)
	at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:363)
	at graphql.execution.ExecutionStrategy.getAsyncFieldValueInfo(ExecutionStrategy.java:328)
	at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:57)
	at graphql.execution.Execution.executeOperation(Execution.java:205)
	at graphql.execution.Execution.execute(Execution.java:124)
	at graphql.GraphQL.execute(GraphQL.java:549)
	at graphql.GraphQL.lambda$parseValidateAndExecute$13(GraphQL.java:479)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2341)
	at graphql.EngineRunningState.compose(EngineRunningState.java:87)
	at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:474)
	at graphql.GraphQL.lambda$executeAsync$9(GraphQL.java:434)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
	at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2341)
	at graphql.EngineRunningState.compose(EngineRunningState.java:87)
	at graphql.GraphQL.lambda$executeAsync$10(GraphQL.java:423)
	at graphql.EngineRunningState.call(EngineRunningState.java:198)
	at graphql.GraphQL.executeAsync(GraphQL.java:416)
	at graphql.GraphQL.execute(GraphQL.java:359)
	at org.opentripplanner.apis.transmodel.TransmodelGraph.executeGraphQL(TransmodelGraph.java:69)
	at org.opentripplanner.apis.transmodel.TransmodelAPI.getGraphQL(TransmodelAPI.java:104)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:274)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:266)
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:253)
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:696)
	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:367)
	at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:190)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515)
	at java.base/java.lang.Thread.run(Thread.java:1583)

This could be related to recent changes in #6902

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

dev-2.x

Data sets in use (links to GTFS and OSM PBF files)

Norwegian data

Metadata

Metadata

Assignees

No one assigned

    Labels

    !BugApply to issues describing a bug and PRs witch fixes it.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions