Platform independent build configuration
ckoopmann opened this issue · 4 comments
@ckoopmann I am getting an error I believe you got in the past: MongoError['No primary node is available! (Supervisor-1/Connection-1)']
.
I tried the solution you mention there and here in this very issue, adapting it for a more recent version of lila by instead modifying this line, but for me, this isn't sufficient.
To be more precise, I can launch lila, visit localhost:9663 with 2 browser windows, start a game with one window and join it with the other. Only when white moves, black is never notified, and in the lila-ws logs, I now see this error:
ERROR a.a.OneForOneStrategy [reactivemongo-akka.actor.default-dispatcher-6] failed to load the required native library
akka.actor.ActorInitializationException: akka://reactivemongo/user/Connection-1: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:196)
at akka.actor.ActorCell.create(ActorCell.scala:661)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:513)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:535)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:295)
at akka.dispatch.Mailbox.run(Mailbox.scala:230)
at akka.dispatch.Mailbox.exec(Mailbox.scala:243)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at reactivemongo.core.netty.Pack$.$anonfun$epoll$2(Pack.scala:93)
at reactivemongo.core.netty.ChannelFactory.(ChannelFactory.scala:48)
at reactivemongo.core.actors.StandardDBSystem.newChannelFactory(MongoDBSystem.scala:1811)
at reactivemongo.core.actors.MongoDBSystem.preStart(MongoDBSystem.scala:338)
at reactivemongo.core.actors.MongoDBSystem.preStart$(MongoDBSystem.scala:335)
at reactivemongo.core.actors.StandardDBSystem.preStart(MongoDBSystem.scala:1803)
at akka.actor.Actor.aroundPreStart(Actor.scala:548)
at akka.actor.Actor.aroundPreStart$(Actor.scala:548)
at reactivemongo.core.actors.StandardDBSystem.aroundPreStart(MongoDBSystem.scala:1803)
at akka.actor.ActorCell.create(ActorCell.scala:641)
... 10 common frames omitted
Caused by: java.lang.UnsatisfiedLinkError: failed to load the required native library
at reactivemongo.io.netty.channel.epoll.Epoll.ensureAvailability(Epoll.java:80)
at reactivemongo.io.netty.channel.epoll.EpollEventLoop.(EpollEventLoop.java:51)
at reactivemongo.io.netty.channel.epoll.EpollEventLoopGroup.newChild(EpollEventLoopGroup.java:150)
at reactivemongo.io.netty.channel.epoll.EpollEventLoopGroup.newChild(EpollEventLoopGroup.java:35)
at reactivemongo.io.netty.util.concurrent.MultithreadEventExecutorGroup.(MultithreadEventExecutorGroup.java:84)
at reactivemongo.io.netty.util.concurrent.MultithreadEventExecutorGroup.(MultithreadEventExecutorGroup.java:58)
at reactivemongo.io.netty.util.concurrent.MultithreadEventExecutorGroup.(MultithreadEventExecutorGroup.java:47)
at reactivemongo.io.netty.channel.MultithreadEventLoopGroup.(MultithreadEventLoopGroup.java:59)
at reactivemongo.io.netty.channel.epoll.EpollEventLoopGroup.(EpollEventLoopGroup.java:112)
at reactivemongo.io.netty.channel.epoll.EpollEventLoopGroup.(EpollEventLoopGroup.java:99)
at reactivemongo.io.netty.channel.epoll.EpollEventLoopGroup.(EpollEventLoopGroup.java:76)
at reactivemongo.io.netty.channel.epoll.EpollEventLoopGroup.(EpollEventLoopGroup.java:52)
at reactivemongo.io.netty.channel.epoll.EpollEventLoopGroup.(EpollEventLoopGroup.java:45)
... 24 common frames omitted
Caused by: java.lang.ExceptionInInitializerError: null
at reactivemongo.io.netty.channel.epoll.Epoll.(Epoll.java:39)
... 36 common frames omitted
Caused by: java.lang.IllegalStateException: Only supported on Linux
at reactivemongo.io.netty.channel.epoll.Native.loadNativeLibrary(Native.java:225)
at reactivemongo.io.netty.channel.epoll.Native.(Native.java:58)
... 37 common frames omitted
INFO a.a.RepointableActorRef [reactivemongo-akka.actor.default-dispatcher-8] Message [reactivemongo.core.actors.RegisterMonitor$] from Actor[akka://reactivemongo/user/Monitor-Connection-1#-531408886] to Actor[akka://reactivemongo/user/Connection-1#1500349829] was not delivered. [1] dead letters encountered. If this is not an expected behavior then Actor[akka://reactivemongo/user/Connection-1#1500349829] may have terminated unexpectedly. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'
I'm just curious whether you knew anything more about this that could help me as I'm not sure where to go from here...
I am also suffering from exactly this issue.
I was able to fix it by changing the reactivemongo
line to:
libraryDependencies += "org.reactivemongo" % "reactivemongo-shaded-native" % s"$reactivemongoVersion-osx-x86-64"
Running on an ARM-based M1 Mac, I had to comment out that line.
// libraryDependencies += "org.reactivemongo" % "reactivemongo-shaded-native" % s"$reactivemongoVersion-osx-x86-64"
Without it, ReactiveMongo seems to fall back to an architecture-independent mechanism.