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

GTFSCache tries to download wrong S3 object #342

Open
abyrd opened this issue Sep 25, 2017 · 2 comments
Open

GTFSCache tries to download wrong S3 object #342

abyrd opened this issue Sep 25, 2017 · 2 comments
Assignees

Comments

@abyrd
Copy link
Member

abyrd commented Sep 25, 2017

When running on staging, we uploaded a feed and then tried to edit a scenario using that feed. The front end issues a GraphQL request, but for some reason it's searching for the feed named TriMet rather than using the full FeedId_UUID naming scheme:

23:05:47.082 [qtp120163583-17] INFO  graphql.GraphQL - Executing request. operation name: null. Request:
query routeQuery($bundleId: String, $routeIds: [String]) {
  bundle (bundle_id: [$bundleId]) {
    feeds {
      feed_id,
      routes(route_id: $routeIds) {
        route_id
        route_short_name
        route_long_name
        patterns {
          name,
          pattern_id,
          geometry,
          trips {
            trip_id,
            trip_short_name,
            trip_headsign,
            start_time,
            duration
          },
          stops {
            stop_id
          }
        }
      }
    }
  }
}
23:05:47.095 [qtp120163583-17] INFO  com.conveyal.gtfs.BaseGTFSCache - Attempting to download cached GTFS MapDB.
23:05:47.134 [qtp120163583-17] WARN  com.conveyal.gtfs.BaseGTFSCache - DB file for key TriMet does not exist on S3.
23:05:47.134 [qtp120163583-17] INFO  com.conveyal.gtfs.BaseGTFSCache - Feed not found locally, downloading from S3.
23:05:47.142 [qtp120163583-17] ERROR com.conveyal.gtfs.BaseGTFSCache - Could not download feed at s3://analysis-staging-bundles/TriMet.
23:05:47.144 [qtp120163583-17] ERROR com.conveyal.gtfs.api.ApiMain - Error retriveving from cache feed TriMet
com.google.common.util.concurrent.UncheckedExecutionException: java.lang.RuntimeException: com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: B8D9595A6627D620), S3 Extended Request ID: wSBYKPwL+H7Sb/ZxgROOTDvnefFBKFI60HI09X1KgpMaSEVz8okFRX84S9Hl7YKOo/w5ewCM08E=
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2203) ~[analyst-master-cf7178e.jar:1.1]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3937) ~[analyst-master-cf7178e.jar:1.1]
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941) ~[analyst-master-cf7178e.jar:1.1]
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824) ~[analyst-master-cf7178e.jar:1.1]
	at com.conveyal.gtfs.BaseGTFSCache.get(BaseGTFSCache.java:167) ~[analyst-master-cf7178e.jar:1.1]
	at com.conveyal.gtfs.api.ApiMain.getFeedSourceWithoutExceptions(ApiMain.java:78) ~[analyst-master-cf7178e.jar:1.1]
	at com.conveyal.gtfs.api.graphql.fetchers.PatternFetcher.fromRoute(PatternFetcher.java:82) [analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.resolveField(ExecutionStrategy.java:41) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.SimpleExecutionStrategy.execute(SimpleExecutionStrategy.java:18) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:89) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:128) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:97) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:62) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.resolveField(ExecutionStrategy.java:47) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.SimpleExecutionStrategy.execute(SimpleExecutionStrategy.java:18) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:89) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:128) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:97) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:62) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.resolveField(ExecutionStrategy.java:47) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.SimpleExecutionStrategy.execute(SimpleExecutionStrategy.java:18) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:89) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:128) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:97) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:62) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.ExecutionStrategy.resolveField(ExecutionStrategy.java:47) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.SimpleExecutionStrategy.execute(SimpleExecutionStrategy.java:18) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.Execution.executeOperation(Execution.java:60) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.execution.Execution.execute(Execution.java:33) ~[analyst-master-cf7178e.jar:1.1]
	at graphql.GraphQL.execute(GraphQL.java:78) ~[analyst-master-cf7178e.jar:1.1]
	at com.conveyal.taui.controllers.GraphQLController.handleQuery(GraphQLController.java:61) ~[analyst-master-cf7178e.jar:1.1]
	at spark.ResponseTransformerRouteImpl$1.handle(ResponseTransformerRouteImpl.java:47) ~[analyst-master-cf7178e.jar:1.1]
	at spark.webserver.MatcherFilter.doFilter(MatcherFilter.java:162) ~[analyst-master-cf7178e.jar:1.1]
	at spark.webserver.JettyHandler.doHandle(JettyHandler.java:61) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.server.Server.handle(Server.java:517) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:302) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654) ~[analyst-master-cf7178e.jar:1.1]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572) ~[analyst-master-cf7178e.jar:1.1]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_141]
Caused by: java.lang.RuntimeException: com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: B8D9595A6627D620), S3 Extended Request ID: wSBYKPwL+H7Sb/ZxgROOTDvnefFBKFI60HI09X1KgpMaSEVz8okFRX84S9Hl7YKOo/w5ewCM08E=
	at com.conveyal.gtfs.BaseGTFSCache.retrieveAndProcessFeed(BaseGTFSCache.java:255) ~[analyst-master-cf7178e.jar:1.1]
	at com.conveyal.gtfs.BaseGTFSCache.access$000(BaseGTFSCache.java:39) ~[analyst-master-cf7178e.jar:1.1]
	at com.conveyal.gtfs.BaseGTFSCache$1.load(BaseGTFSCache.java:89) ~[analyst-master-cf7178e.jar:1.1]
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527) ~[analyst-master-cf7178e.jar:1.1]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319) ~[analyst-master-cf7178e.jar:1.1]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282) ~[analyst-master-cf7178e.jar:1.1]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197) ~[analyst-master-cf7178e.jar:1.1]
	... 47 common frames omitted
Caused by: com.amazonaws.services.s3.model.AmazonS3Exception: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: B8D9595A6627D620)
	at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1378) ~[analyst-master-cf7178e.jar:1.1]
	at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:924) ~[analyst-master-cf7178e.jar:1.1]
	at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:702) ~[analyst-master-cf7178e.jar:1.1]
	at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:454) ~[analyst-master-cf7178e.jar:1.1]
	at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:416) ~[analyst-master-cf7178e.jar:1.1]
	at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:365) ~[analyst-master-cf7178e.jar:1.1]
	at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3995) ~[analyst-master-cf7178e.jar:1.1]
	at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1291) ~[analyst-master-cf7178e.jar:1.1]
	at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1166) ~[analyst-master-cf7178e.jar:1.1]
	at com.conveyal.gtfs.BaseGTFSCache.retrieveAndProcessFeed(BaseGTFSCache.java:247) ~[analyst-master-cf7178e.jar:1.1]
	... 53 common frames omitted
@abyrd abyrd self-assigned this Sep 25, 2017
@abyrd
Copy link
Member Author

abyrd commented Sep 25, 2017

I am able to create a similar problem locally. Most of the GraphQL query appears to work fine. If I submit the same query with a bundleId that exists locally and some real route IDs from the feed, it does return those routes, but I get a NoSuchElementException from somewhere within PatternFetcher. The difference may be due running in offline mode (it doesn't go looking at S3). But it really appears to be in the pattern fetcher code. If I remove the patterns {...} clause from the GraphQL query the request completes with no errors. So for some reason the RouteFetcher works and properly fetches the feed it needs, but the PatternFetcher does not.

@abyrd
Copy link
Member Author

abyrd commented Sep 25, 2017

In RouteFetcher.fromFeed() the WrappedGTFSEntity<FeedInfo> has the correct complete feedUniqueId. However one level deeper into the tree, PetternFetcher.fromRoute() does not have the correct feedUniqueId, it has only the short FeedId TriMet.

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

1 participant