BrandonE/lichocker

lichess Learn/Puzzle Execution exception Error

Opened this issue · 1 comments

After ran docker container, while access Learn --> Puzzle getting below error, please help to fix

[error] l.app.http.ErrorHandler -

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

play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[IllegalArgumentException: bound must be positive]]
at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:359)
at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:261)
at play.core.server.AkkaHttpServer$$anonfun$2.applyOrElse(AkkaHttpServer.scala:429)
at play.core.server.AkkaHttpServer$$anonfun$2.applyOrElse(AkkaHttpServer.scala:421)
at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:453)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:56)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:93)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:93)
Caused by: java.lang.IllegalArgumentException: bound must be positive
at java.base/java.util.Random.nextInt(Random.java:388)
at scala.util.Random.nextInt(Random.scala:96)
at lila.puzzle.Selector.$anonfun$apply$2(Selector.scala:35)
at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:433)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:56)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:93)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:93)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:48)

** on web browser **

[IllegalArgumentException: bound must be positive]
In /home/lichess/projects/lila/modules/puzzle/src/main/Selector.scala:35

31 // anon

32 case None =>

33 anonIdsCache flatMap { ids =>

34 puzzleColl {

35 _.byId[Puzzle, Int](ids(Random nextInt ids.size))

36 }

37 }

38 // user

39 case Some(user) =>

It is so because there are no puzzles in the database