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

Data with no "user" being sent to backend #2098

Closed
misaugstad opened this issue May 14, 2020 · 5 comments
Closed

Data with no "user" being sent to backend #2098

misaugstad opened this issue May 14, 2020 · 5 comments

Comments

@misaugstad
Copy link
Member

For both the audit and validation pages, there are errors being logged on multiple servers (I've seen it on both Seattle and CDMX). I don't know what all the implications are, idk how much data we are losing from this. But I need to investigate ASAP. It only happens sometimes, but frequently enough that it really needs to be figured out.

The errors below reference "TaskController.scala:185" and "ValidationTaskController.scala:172" which are both lines that include the code user.get.userId. So it looks like the "user" object is "None" for some reason.

For the audit page, here is an example:

2020-05-12 00:15:16,488 - [WARN] - from application in play-akka.actor.default-dispatcher-4567 
User without user_id audited a street, but every user should have a user_id.

2020-05-12 00:15:16,519 - [ERROR] - from play in play-internal-execution-context-1119 
Cannot invoke the action, eventually got an error: java.util.NoSuchElementException: None.get

2020-05-12 00:15:16,524 - [ERROR] - from application in play-internal-execution-context-1119 


! @7fmf39m5o - Internal server error, for (POST) [/taskBeacon] ->

play.api.Application$$anon$1: Execution exception[[NoSuchElementException: None.get]]
	at play.api.Application$class.handleError(Application.scala:296) ~[play_2.10-2.3.8.jar:2.3.8]
	at play.api.DefaultApplication.handleError(Application.scala:402) [play_2.10-2.3.8.jar:2.3.8]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.8.jar:2.3.8]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.8.jar:2.3.8]
	at scala.Option.map(Option.scala:145) [scala-library-2.10.5.jar:na]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3.applyOrElse(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.8.jar:2.3.8]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3.applyOrElse(PlayDefaultUpstreamHandler.scala:316) [play_2.10-2.3.8.jar:2.3.8]
	at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:344) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:343) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:46) [play-iteratees_2.10-2.3.8.jar:2.3.8]
	at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Promise$class.complete(Promise.scala:55) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1361) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library-2.10.5.jar:na]
Caused by: java.util.NoSuchElementException: None.get
	at scala.None$.get(Option.scala:313) ~[scala-library-2.10.5.jar:na]
	at scala.None$.get(Option.scala:311) ~[scala-library-2.10.5.jar:na]
	at controllers.TaskController.updateMissionTable(TaskController.scala:138) ~[classes/:na]
	at controllers.TaskController$$anonfun$4.apply(TaskController.scala:251) ~[classes/:na]
	at controllers.TaskController$$anonfun$4.apply(TaskController.scala:214) ~[classes/:na]
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[scala-library-2.10.5.jar:na]
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[scala-library-2.10.5.jar:na]
	at scala.collection.immutable.List.foreach(List.scala:318) ~[scala-library-2.10.5.jar:na]
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) ~[scala-library-2.10.5.jar:na]
	at scala.collection.AbstractTraversable.map(Traversable.scala:105) ~[scala-library-2.10.5.jar:na]
	at controllers.TaskController.processAuditTaskSubmissions(TaskController.scala:214) ~[classes/:na]
	at controllers.TaskController$$anonfun$postBeacon$1$$anonfun$apply$4.apply(TaskController.scala:190) ~[classes/:na]
	at controllers.TaskController$$anonfun$postBeacon$1$$anonfun$apply$4.apply(TaskController.scala:189) ~[classes/:na]
	at play.api.libs.json.JsResult$class.fold(JsResult.scala:76) ~[play-json_2.10-2.3.8.jar:2.3.8]
	at play.api.libs.json.JsSuccess.fold(JsResult.scala:9) ~[play-json_2.10-2.3.8.jar:2.3.8]
	at controllers.TaskController$$anonfun$postBeacon$1.apply(TaskController.scala:185) ~[classes/:na]
	at controllers.TaskController$$anonfun$postBeacon$1.apply(TaskController.scala:182) ~[classes/:na]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareAction$$anonfun$invokeBlock$4.apply(Silhouette.scala:529) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareAction$$anonfun$invokeBlock$4.apply(Silhouette.scala:528) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3.apply(Silhouette.scala:509) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3.apply(Silhouette.scala:497) ~[play-silhouette_2.10-2.0.jar:2.0]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:67) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:82) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59) ~[akka-actor_2.10-2.3.4.jar:na]
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72) ~[scala-library-2.10.5.jar:na]
	at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) ~[akka-actor_2.10-2.3.4.jar:na]
	... 4 common frames omitted

2020-05-12 00:15:25,625 - [ERROR] - from application in play-akka.actor.default-dispatcher-4561 


! @7fmf3a9i0 - Internal server error, for (GET) [/neighborhoodMissions] ->

play.api.Application$$anon$1: Execution exception[[NoSuchElementException: None.get]]
	at play.api.Application$class.handleError(Application.scala:296) ~[play_2.10-2.3.8.jar:2.3.8]
	at play.api.DefaultApplication.handleError(Application.scala:402) [play_2.10-2.3.8.jar:2.3.8]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:205) [play_2.10-2.3.8.jar:2.3.8]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$14$$anonfun$apply$1.applyOrElse(PlayDefaultUpstreamHandler.scala:202) [play_2.10-2.3.8.jar:2.3.8]
	at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33) [scala-library-2.10.5.jar:na]
	at scala.util.Failure$$anonfun$recover$1.apply(Try.scala:185) [scala-library-2.10.5.jar:na]
	at scala.util.Try$.apply(Try.scala:161) [scala-library-2.10.5.jar:na]
	at scala.util.Failure.recover(Try.scala:185) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:324) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$recover$1.apply(Future.scala:324) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:46) [play-iteratees_2.10-2.3.8.jar:2.3.8]
	at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Promise$class.complete(Promise.scala:55) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$recoverWith$1$$anonfun$apply$6.apply(Future.scala:344) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$recoverWith$1$$anonfun$apply$6.apply(Future.scala:344) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.processBatch$1(Future.scala:643) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply$mcV$sp(Future.scala:658) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply(Future.scala:635) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$InternalCallbackExecutor$Batch$$anonfun$run$1.apply(Future.scala:635) [scala-library-2.10.5.jar:na]
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$InternalCallbackExecutor$Batch.run(Future.scala:634) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$InternalCallbackExecutor$.scala$concurrent$Future$InternalCallbackExecutor$$unbatchedExecute(Future.scala:694) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:685) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.Promise$DefaultPromise.scala$concurrent$impl$Promise$DefaultPromise$$dispatchOrAddCallback(Promise.scala:280) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.Promise$DefaultPromise.onComplete(Promise.scala:270) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:344) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:343) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:67) [akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:82) [akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59) [akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59) [akka-actor_2.10-2.3.4.jar:na]
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72) [scala-library-2.10.5.jar:na]
	at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58) [akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41) [akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) [akka-actor_2.10-2.3.4.jar:na]
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library-2.10.5.jar:na]
Caused by: java.util.NoSuchElementException: None.get
	at scala.None$.get(Option.scala:313) ~[scala-library-2.10.5.jar:na]
	at scala.None$.get(Option.scala:311) ~[scala-library-2.10.5.jar:na]
	at controllers.MissionController$$anonfun$getMissionsInCurrentRegion$1.apply(MissionController.scala:37) ~[classes/:na]
	at controllers.MissionController$$anonfun$getMissionsInCurrentRegion$1.apply(MissionController.scala:28) ~[classes/:na]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareAction$$anonfun$invokeBlock$4.apply(Silhouette.scala:529) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareAction$$anonfun$invokeBlock$4.apply(Silhouette.scala:528) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3$$anonfun$apply$18.apply(Silhouette.scala:500) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3$$anonfun$apply$18.apply(Silhouette.scala:500) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$RequestHandlerBuilder$class.handleInitializedAuthenticator(Silhouette.scala:268) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$RequestHandlerBuilder$class.handleBlock(Silhouette.scala:219) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$.handleBlock(Silhouette.scala:485) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3.apply(Silhouette.scala:500) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3.apply(Silhouette.scala:497) ~[play-silhouette_2.10-2.0.jar:2.0]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251) ~[scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249) ~[scala-library-2.10.5.jar:na]
	... 13 common frames omitted

another audit example:

2020-05-11 14:20:11,559 - [DEBUG] - from application in play-akka.actor.default-dispatcher-4238 
Updated user login info: DBUserLoginInfo(f14e276f-b78c-4bdc-91fb-ba11fca13faf,215108)

2020-05-11 14:21:23,348 - [WARN] - from application in play-akka.actor.default-dispatcher-4236 
User without user_id audited a street, but every user should have a user_id.

2020-05-11 14:21:23,424 - [ERROR] - from play in play-internal-execution-context-1021 
Cannot invoke the action, eventually got an error: java.util.NoSuchElementException: None.get

2020-05-11 14:21:23,429 - [ERROR] - from application in play-internal-execution-context-1021 


! @7fmc3ace7 - Internal server error, for (POST) [/task] ->

play.api.Application$$anon$1: Execution exception[[NoSuchElementException: None.get]]
	at play.api.Application$class.handleError(Application.scala:296) ~[play_2.10-2.3.8.jar:2.3.8]
	at play.api.DefaultApplication.handleError(Application.scala:402) [play_2.10-2.3.8.jar:2.3.8]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.8.jar:2.3.8]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.8.jar:2.3.8]
	at scala.Option.map(Option.scala:145) [scala-library-2.10.5.jar:na]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3.applyOrElse(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.8.jar:2.3.8]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3.applyOrElse(PlayDefaultUpstreamHandler.scala:316) [play_2.10-2.3.8.jar:2.3.8]
	at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:344) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:343) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:46) [play-iteratees_2.10-2.3.8.jar:2.3.8]
	at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Promise$class.complete(Promise.scala:55) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1361) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library-2.10.5.jar:na]
Caused by: java.util.NoSuchElementException: None.get
	at scala.None$.get(Option.scala:313) ~[scala-library-2.10.5.jar:na]
	at scala.None$.get(Option.scala:311) ~[scala-library-2.10.5.jar:na]
	at controllers.TaskController.updateMissionTable(TaskController.scala:138) ~[classes/:na]
	at controllers.TaskController$$anonfun$4.apply(TaskController.scala:251) ~[classes/:na]
	at controllers.TaskController$$anonfun$4.apply(TaskController.scala:214) ~[classes/:na]
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[scala-library-2.10.5.jar:na]
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[scala-library-2.10.5.jar:na]
	at scala.collection.immutable.List.foreach(List.scala:318) ~[scala-library-2.10.5.jar:na]
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) ~[scala-library-2.10.5.jar:na]
	at scala.collection.AbstractTraversable.map(Traversable.scala:105) ~[scala-library-2.10.5.jar:na]
	at controllers.TaskController.processAuditTaskSubmissions(TaskController.scala:214) ~[classes/:na]
	at controllers.TaskController$$anonfun$post$1$$anonfun$apply$6.apply(TaskController.scala:208) ~[classes/:na]
	at controllers.TaskController$$anonfun$post$1$$anonfun$apply$6.apply(TaskController.scala:207) ~[classes/:na]
	at play.api.libs.json.JsResult$class.fold(JsResult.scala:76) ~[play-json_2.10-2.3.8.jar:2.3.8]
	at play.api.libs.json.JsSuccess.fold(JsResult.scala:9) ~[play-json_2.10-2.3.8.jar:2.3.8]
	at controllers.TaskController$$anonfun$post$1.apply(TaskController.scala:203) ~[classes/:na]
	at controllers.TaskController$$anonfun$post$1.apply(TaskController.scala:200) ~[classes/:na]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareAction$$anonfun$invokeBlock$4.apply(Silhouette.scala:529) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareAction$$anonfun$invokeBlock$4.apply(Silhouette.scala:528) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3$$anonfun$apply$18.apply(Silhouette.scala:500) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3$$anonfun$apply$18.apply(Silhouette.scala:500) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$RequestHandlerBuilder$class.handleInitializedAuthenticator(Silhouette.scala:268) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$RequestHandlerBuilder$class.handleBlock(Silhouette.scala:219) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$.handleBlock(Silhouette.scala:485) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3.apply(Silhouette.scala:500) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3.apply(Silhouette.scala:497) ~[play-silhouette_2.10-2.0.jar:2.0]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:67) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:82) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59) ~[akka-actor_2.10-2.3.4.jar:na]
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72) ~[scala-library-2.10.5.jar:na]
	at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) ~[akka-actor_2.10-2.3.4.jar:na]
	... 4 common frames omitted

for the validation page, here is an example:

2020-05-12 15:22:35,761 - [ERROR] - from play in play-internal-execution-context-1275 
Cannot invoke the action, eventually got an error: java.util.NoSuchElementException: None.get

2020-05-12 15:22:35,764 - [ERROR] - from application in play-internal-execution-context-1275 


! @7fmjid5go - Internal server error, for (POST) [/validationTask] ->

play.api.Application$$anon$1: Execution exception[[NoSuchElementException: None.get]]
	at play.api.Application$class.handleError(Application.scala:296) ~[play_2.10-2.3.8.jar:2.3.8]
	at play.api.DefaultApplication.handleError(Application.scala:402) [play_2.10-2.3.8.jar:2.3.8]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.8.jar:2.3.8]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.8.jar:2.3.8]
	at scala.Option.map(Option.scala:145) [scala-library-2.10.5.jar:na]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3.applyOrElse(PlayDefaultUpstreamHandler.scala:320) [play_2.10-2.3.8.jar:2.3.8]
	at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3.applyOrElse(PlayDefaultUpstreamHandler.scala:316) [play_2.10-2.3.8.jar:2.3.8]
	at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:344) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:343) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:46) [play-iteratees_2.10-2.3.8.jar:2.3.8]
	at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Promise$class.complete(Promise.scala:55) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:153) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1361) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.10.5.jar:na]
	at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library-2.10.5.jar:na]
Caused by: java.util.NoSuchElementException: None.get
	at scala.None$.get(Option.scala:313) ~[scala-library-2.10.5.jar:na]
	at scala.None$.get(Option.scala:311) ~[scala-library-2.10.5.jar:na]
	at controllers.ValidationTaskController.getLabelTypeId(ValidationTaskController.scala:172) ~[classes/:na]
	at controllers.ValidationTaskController$$anonfun$2.apply(ValidationTaskController.scala:65) ~[classes/:na]
	at controllers.ValidationTaskController$$anonfun$2.apply(ValidationTaskController.scala:32) ~[classes/:na]
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[scala-library-2.10.5.jar:na]
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[scala-library-2.10.5.jar:na]
	at scala.collection.immutable.List.foreach(List.scala:318) ~[scala-library-2.10.5.jar:na]
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) ~[scala-library-2.10.5.jar:na]
	at scala.collection.AbstractTraversable.map(Traversable.scala:105) ~[scala-library-2.10.5.jar:na]
	at controllers.ValidationTaskController.processValidationTaskSubmissions(ValidationTaskController.scala:32) ~[classes/:na]
	at controllers.ValidationTaskController$$anonfun$post$1$$anonfun$apply$8.apply(ValidationTaskController.scala:132) ~[classes/:na]
	at controllers.ValidationTaskController$$anonfun$post$1$$anonfun$apply$8.apply(ValidationTaskController.scala:131) ~[classes/:na]
	at play.api.libs.json.JsResult$class.fold(JsResult.scala:76) ~[play-json_2.10-2.3.8.jar:2.3.8]
	at play.api.libs.json.JsSuccess.fold(JsResult.scala:9) ~[play-json_2.10-2.3.8.jar:2.3.8]
	at controllers.ValidationTaskController$$anonfun$post$1.apply(ValidationTaskController.scala:127) ~[classes/:na]
	at controllers.ValidationTaskController$$anonfun$post$1.apply(ValidationTaskController.scala:125) ~[classes/:na]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareAction$$anonfun$invokeBlock$4.apply(Silhouette.scala:529) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareAction$$anonfun$invokeBlock$4.apply(Silhouette.scala:528) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3.apply(Silhouette.scala:509) ~[play-silhouette_2.10-2.0.jar:2.0]
	at com.mohiva.play.silhouette.api.Silhouette$UserAwareRequestHandler$$anonfun$invokeBlock$3.apply(Silhouette.scala:497) ~[play-silhouette_2.10-2.0.jar:2.0]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251) [scala-library-2.10.5.jar:na]
	at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249) [scala-library-2.10.5.jar:na]
	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) [scala-library-2.10.5.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:67) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:82) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59) ~[akka-actor_2.10-2.3.4.jar:na]
	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72) ~[scala-library-2.10.5.jar:na]
	at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41) ~[akka-actor_2.10-2.3.4.jar:na]
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) ~[akka-actor_2.10-2.3.4.jar:na]
	... 4 common frames omitted
@misaugstad
Copy link
Member Author

I've added a hotfix for this in #2116 but we have a lot of improvements we need to make to signing in/up. I've spent a lot of time on this and need to move on to other things like the deployment to mturk, so I'm going to have @ThatOneGoat take a look at this next. Going to add various notes/thoughts below.

  1. I still think that we have to be able to do the signup procedure without two redirects. The sign in functionality does that already. Today I tried to modify the sign up process to make it as close as possible to the sign in one, and I still didn't get any different results. But I feel like there's got to be something there we can work with.

    While doing this, I noticed that when you sign in through the navbar, you end up hitting both the "/authenticate/credentials" endpoint through the form's specified action (@helper.form(action = routes.CredentialsAuthController.authenticate(url.getOrElse("/")), args = 'id -> "sign-in-form"), AND the "/authapi/authenticate" endpoint through the listener on the submit button ($('#sign-in-form').submit(...). We really only need one of these, and whichever one you pick, the sign in procedure works.

    On the flip side (if you go back to the commits before my hotfix), the sign up form on the navbar has a parallel structure, but the action associated with the form is not actually being called for some reason, and I'm not sure why.

  2. My hotfix broke some of the error checking at the /signUp endpoint. I don't think people use that very much anyway, so I think it's fine for now. But that should be fixed at some point.

  3. Both the sign up and sign in procedure have duplicated code. For sign in it is authenticate and postAuthenticate functions. Signing up has signUp and postSignUp (at least pre-hotfix). They do exactly the same thing, they just return errors in different ways and one returns a redirect while the other just returns the User object in JSON. These should probably be collapsed into one function each.

I'll post later if I remember more notes.

@michaelduan8
Copy link
Collaborator

So, after spending a while trying to find a way to re-instantiate the new authenticator in one redirect, it seems there may be some version limitations based on the version of Silhouette we are using. Basically, with this version, the documented method of removing an authenticator is by calling the discard() method of the oldAuthenticator, which ends up marking the Result to notify the receiving Action to delete the old authenticator. However, the only way to embed in authenticator in a result is to use the embed method, which embeds the new authenticator prior to the Result being sent over.

Later versions of Silhouette seem more promising with what we are trying to do, but that will have to come later after we update our dependencies.

In the end, I think it would be best to just leave this as an issue we tackle after we can use newer versions of Silhouette/Play.

@michaelduan8
Copy link
Collaborator

I actually do have one more thing we could potentially try. Most of the approaches I've tried have revolved around trying to modify the result in both discarding the old authenticator and adding the new one. However, Silhouette also supports an embed() method which takes a Session and a RequestHeader as params and returns a new RequestHeader that has the new embedded Session within. Since our signup endpoint is essentially an action transforming the incoming request (which we have just modified with the new authenticator) into a result, this could allow us to simply need to renew the authenticator from the request (which is the new one), allowing us to do a signup in one Redirect. However, the actual act of modifying an incoming request is a bit tricky, as it involves using Play Filters from what I have read. While this seems promising, it's very possible it could just end up being an adventure down a giant rabbit hole.

It would be nice to get some other's thoughts on this.

@misaugstad
Copy link
Member Author

Yeah that is an interesting thought and does sound a bit hacky. I agree that it's time to drop this issue, since it doesn't really have an effect on end users and is taking too much time.

@misaugstad
Copy link
Member Author

Closing via #2116 since we are committed to that fix over a more elegant solution.

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

No branches or pull requests

2 participants