Jatos 3.7.4: Listing of all studies gives Internal Jatos error
Hi,
When i try to list all studies, i get an Internal JATOS error:
2022-05-04 15:04:15,853 [INFO] - gui_access - GET /jatos/sidebarStudyList
2022-05-04 15:04:15,874 [INFO] - gui_access - GET /jatos/allStudiesData?_=1651669456473
2022-05-04 15:05:18,798 [ERROR] - g.ErrorHandler - Internal JATOS error
java.lang.NullPointerException: null
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.Iterator.forEachRemaining(Unknown Source)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
at daos.common.ComponentResultDao.sizeByStudy(ComponentResultDao.java:111)
at services.gui.AdminService.getStudiesData(AdminService.java:70)
at controllers.gui.Admin.allStudiesData(Admin.java:173)
What could be the problem?
Thanks.
Comments
Hi,
I tried on my local JATOS and an server installation and in both cases this error did not happen with me.
Can you please give me more details about your JATOS installation so I know better what to look for:
Best,
Kristian
Hi Kristian,
java version "1.8.0_312"
recent new installation (Ubuntu 22.04 LTS), but it happened also with previous installation.
MySQL 8.0.28
It never worked, at least that i know off.
Thanks.
Your system seems fine.
I checked the exception you send me earlier. This particular stacktrace happens when one component of the study is 'null. That is actually something that should not happen. I will add a null check in the responsible class (ComponentResultDao). But I'm still confused: are there no other problems in your JATOS? I mean, there should be other exceptions when this particular study with the null-component is used. But maybe nobody is using it. Unfortunately I can't see from the log which study (or studies) it is. Another thing is how the null got there in the first place. I did some test and whatever I tried I never got a null for an component. Strange!
Anyway, I added this null-check and it will be part of the next release.
In between, to get the Administration/Studies page working, you can turn off the result data size calculation for this page in the production.conf with:
Best,
Kristian
Hi Kristian,
Thanks for your answer. Info about the java version was wrong, it uses the "builtin" version.
Your solution works! I will try to figure out what is wrong in the database.
Thanks again.
Best,
René.
Hi, I think we're having this same problem. In our case we get an error message in the GUI after logging in:
"Internal JATOS error during /jatos/sidebarStudyList. Check logs to get more information."
and no studies appear in the side bar. This only affects users who have access to the problematic study. The full error from the JATOS application log is below.
@reneni and @kri do know what's going on here, and/or do you have any tips for how to fix this? Maybe there are database queries that would help us find/fix the problematic 'null' component?
Kristian - sorry, I'm aware that you probably fixed this in more recent JATOS versions. We are using an old version and are upgrading soon, but still need to fix this problem in the meantime.
Thanks!
Becky
2022-06-08 20:40:14,916 [INFO] - gui_access - GET /jatos/sidebarStudyList (<username>)
2022-06-08 20:40:15,331 [ERROR] - g.ErrorHandler - Internal JATOS error
java.lang.NullPointerException: null
at utils.common.JsonUtils.sidebarStudyList(JsonUtils.java:412)
at controllers.gui.Home.sidebarStudyList(Home.java:85)
at gui.Routes$$anonfun$routes$1$$anonfun$applyOrElse$10$$anonfun$apply$10.apply(Routes.scala:1805)
at gui.Routes$$anonfun$routes$1$$anonfun$applyOrElse$10$$anonfun$apply$10.apply(Routes.scala:1805)
at play.core.routing.HandlerInvokerFactory$$anon$4.resultCall(HandlerInvoker.scala:157)
at play.core.routing.HandlerInvokerFactory$$anon$4.resultCall(HandlerInvoker.scala:156)
at play.core.routing.HandlerInvokerFactory$JavaActionInvokerFactory$$anon$14$$anon$3$$anon$1.invocation(HandlerInvoker.scala:136)
at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:73)
at play.http.HttpRequestHandler$1.call(HttpRequestHandler.java:54)
at controllers.gui.actionannotations.GuiAccessLoggingAction.call(GuiAccessLoggingAction.java:41)
at controllers.gui.actionannotations.AuthenticationAction.call(AuthenticationAction.java:131)
at play.db.jpa.TransactionalAction.lambda$call$4(TransactionalAction.java:28)
at play.db.jpa.DefaultJPAApi.lambda$withTransaction$3(DefaultJPAApi.java:211)
at play.db.jpa.DefaultJPAApi.withTransaction(DefaultJPAApi.java:152)
at play.db.jpa.DefaultJPAApi.withTransaction(DefaultJPAApi.java:210)
at play.db.jpa.TransactionalAction.call(TransactionalAction.java:25)
at play.core.j.JavaAction$$anonfun$7.apply(JavaAction.scala:108)
at play.core.j.JavaAction$$anonfun$7.apply(JavaAction.scala:108)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
at play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:56)
at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:70)
at play.core.j.HttpExecutionContext.execute(HttpExecutionContext.scala:48)
at scala.concurrent.impl.Future$.apply(Future.scala:31)
at scala.concurrent.Future$.apply(Future.scala:494)
at play.core.j.JavaAction.apply(JavaAction.scala:108)
at play.api.mvc.Action$$anonfun$apply$2$$anonfun$apply$5$$anonfun$apply$6.apply(Action.scala:112)
at play.api.mvc.Action$$anonfun$apply$2$$anonfun$apply$5$$anonfun$apply$6.apply(Action.scala:112)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at play.api.mvc.Action$$anonfun$apply$2$$anonfun$apply$5.apply(Action.scala:111)
at play.api.mvc.Action$$anonfun$apply$2$$anonfun$apply$5.apply(Action.scala:110)
at scala.Option.map(Option.scala:146)
at play.api.mvc.Action$$anonfun$apply$2.apply(Action.scala:110)
at play.api.mvc.Action$$anonfun$apply$2.apply(Action.scala:103)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:253)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:36)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:91)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:90)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:39)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:415)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Hi Becky,
You got the same exception (the dreaded NullPointerException) but for a different reason: yours happened in the JsonUtils class, the previous one in the ComponentResultDao. The JsonUtils class does all the JSON serialization stuff including the one for the sidebar. Something caused a NPE there. But to have a closer look I first need the JATOS version you are currently on?
Best,
Kristian
Thanks @kri, and sorry for hijacking this thread with a different problem...
This is on JATOS v3.3.3 (I know, I know 😬 We're working on upgrading!). We figured out that on particular study is causing the problem, so I can send you the zip if that would help.
Yes the study zip would help too.
Kristian
Hi Becky,
I checked the source code a NPE at this point in the code means that a component had no 'id' value. That's strange and should not happen. Can you please send me the study zip?
And you said you have access to JATOS' database: Can you please check if there is a component that has no 'id' or 'uuid' field (set to null or empty)? The command to list all component's ids and uuids is:
select id, uuid from Component;
Best,
Kristian