MAIF / izanami

Izanami is a centralized versatile feature flag solution, well suited for micro service architectures.
https://maif.github.io/izanami/
Apache License 2.0
189 stars 43 forks source link

Login - An error occured #904

Open remi-picard opened 3 days ago

remi-picard commented 3 days ago

Hello,

I'm using Docker image maif/izanami:2.5.0 and after some hours, it is impossible to login.

image

The docker logs :

2024-11-20 08:59:43 INFO  play.core.server.AkkaHttpServer  Listening for HTTP on /[0:0:0:0:0:0:0:0]:8080
2024-11-20 08:59:43 ERROR izanami-error-handler  Client Error [3150760c-976c-3465-911c-0d37034e1dd1]: Resource not found by Assets controller on /favicon.ico (404)
2024-11-20 08:59:43 WARN  akka.actor.ActorSystemImpl akka.actor.ActorSystemImpl(application) Explicitly set HTTP header 'Content-Type: application/json' is ignored, explicit `Content-Type` header is not allowed. Set `HttpResponse.entity.contentType` instead.
2024-11-20 22:20:32 ERROR izanami  Failed to execute queries in transaction
java.io.IOException: Connection timed out
    at java.base/sun.nio.ch.SocketDispatcher.read0(Native Method)
    at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:47)
    at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:340)
    at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:294)
    at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:269)
    at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:425)
    at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:255)
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:357)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:1583)
2024-11-20 22:20:32 ERROR izanami  Failed to apply query: "DELETE FROM izanami.sessions WHERE EXTRACT(EPOCH FROM (NOW() - creation)) > $1 returning id" with params: "3700"
java.lang.NullPointerException: Cannot invoke "scala.collection.Iterable.toList()" because the return value of "scala.collection.convert.AsScalaExtensions$IterableHasAsScala.asScala()" is null
    at fr.maif.izanami.env.Postgresql.$anonfun$queryRaw$13(postgresql.scala:275)
    at scala.util.Try$.apply(Try.scala:210)
    at fr.maif.izanami.env.Postgresql.$anonfun$queryRaw$12(postgresql.scala:274)
    at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:470)
    at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:63)
    at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:100)
    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:100)
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:49)
    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

The server was started at 2024-11-20 08:59:43.

The error at 2024-11-20 22:20:32 should be a izanami batch.

The full log izanami-logs.txt

Note that after login failed, it is possible to retry and actually login.

Regards, Rémi PICARD

ptitFicus commented 3 days ago

Hi @remi-picard, thanks for your report.

Looking at your logs it looks like Izanami couldn't reach database for a while, which could explain your error.

Anyway I'll try to reproduce, and fix that, thanks !