conveyal/analysis-backend

Error parsing timestamp when updating upload status

ansoncfit opened this issue · 7 comments

13:47:49.287 [qtp558836738-170] ERROR com.conveyal.taui.AnalysisServer - java.time.format.DateTimeParseException: Text 'Mon Dec 11 13:46:25 UTC 2017' could not be parsed at index 0
        at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
        at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
        at java.time.LocalDateTime.parse(LocalDateTime.java:492)
        at java.time.LocalDateTime.parse(LocalDateTime.java:477)
        at com.conveyal.taui.controllers.OpportunityDatasetsController.lambda$addStatusAndRemoveOldStatuses$0(OpportunityDatasetsController.java:68)
        at java.util.ArrayList.removeIf(ArrayList.java:1405)
        at com.conveyal.taui.controllers.OpportunityDatasetsController.addStatusAndRemoveOldStatuses(OpportunityDatasetsController.java:68)
        at com.conveyal.taui.controllers.OpportunityDatasetsController.createOpportunityDataset(OpportunityDatasetsController.java:115)
        at spark.ResponseTransformerRouteImpl$1.handle(ResponseTransformerRouteImpl.java:47)
        at spark.webserver.MatcherFilter.doFilter(MatcherFilter.java:162)
        at spark.webserver.JettyHandler.doHandle(JettyHandler.java:61)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
        at org.eclipse.jetty.server.Server.handle(Server.java:517)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:302)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
        at java.lang.Thread.run(Thread.java:748)

This log update corresponds with the following user-reported actions:

  • Start shapefile upload
  • See an update showing "...(PROCESSING) started 0 minutes ago, ... /11000 completed."
  • "This completed quite fast, but then it went to "ERROR"."
  • Try upload again.
  • "It started uploading and is now stuck on ...(PROCESSING) started ... minutes ago 0/0 completed"

Did recent updates to provide updates on upload status introduce issues with uploading the same shapefile multiple times?

We observed time zone issues when testing this change (see https://github.com/conveyal/analysis-ui/issues/556), but those may be unrelated.

abyrd commented

On the surface, it just looks like something is sending a time in the wrong format right?

The second catch block around https://github.com/conveyal/analysis-backend/blob/dev/src/main/java/com/conveyal/taui/controllers/OpportunityDatasetsController.java#L151 throws an error with message "The data you attempted to update is not in your access group."

Tracing execution, req.attribute("email") and req.attribute("accessGroup") at the line above are both null. Does the front-end not send email and accessGroup in the request, or am I missing something @trevorgerhardt?

@ansoncfit logged in requests always contain those attributes. Since it is a delayed job theres a chance that that information is no longer available on the request object. Let's try to "hoist" those variables out of the Thread and to the top of the createOpportunityDataset function and set them

final String accessGroup = req.attribute("accessGroup");
final String email = req.attribute("email");

Ah, well I'm not "logged in" when debugging locally.