java.nio.channels.ClosedChannelException: null
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe.newClosedChannelException(AbstractChannel.java:957)
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe.write(AbstractChannel.java:865)
at reactivemongo.io.netty.channel.DefaultChannelPipeline$HeadContext.write(DefaultChannelPipeline.java:1367)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:715)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:762)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext$WriteTask.run(AbstractChannelHandlerContext.java:1089)
at reactivemongo.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at reactivemongo.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at reactivemongo.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
at reactivemongo.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at reactivemongo.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at reactivemongo.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
2020-09-15 14:17:02 ERROR r.core.actors.MongoDBSystem [Supervisor-1/Connection-2] Fails to send a isMaster request to heroku-zjrm7hj4-shard-00-01.abo25.mongodb.net:27017 (channel #c58bf28d)
java.nio.channels.ClosedChannelException: null
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe.newClosedChannelException(AbstractChannel.java:957)
at reactivemongo.io.netty.channel.AbstractChannel$AbstractUnsafe.write(AbstractChannel.java:865)
at reactivemongo.io.netty.channel.DefaultChannelPipeline$HeadContext.write(DefaultChannelPipeline.java:1367)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:715)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:762)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:788)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:756)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:765)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:788)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:756)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:765)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:788)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:756)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:765)
at reactivemongo.io.netty.channel.AbstractChannelHandlerContext$WriteTask.run(AbstractChannelHandlerContext.java:1089)
at reactivemongo.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at reactivemongo.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at reactivemongo.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:497)
at reactivemongo.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at reactivemongo.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at reactivemongo.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
I wonder if anyone has been able to build a docker image with play and reactivemongo. I have a play app which was working fine until i tried to containerise it. I have built my app image and i am able to deploy and run it except when i try to make a request from my containerised app to retrieve some data from my mongo database, i run into errors like these below. I am very new to using docker but so far, i have been able to do what i need to do. My question is this, do i need a mongo image to be able to use reactivemongo from my container?
if so, can anyone please point me to some tutorial or some instructions on what i need to do. I usually use reactivemongo the usual way by setting my mongodb.uri in my `conf` file but i am guessing i need to do something extra since i am running in a container now.
On 16 Sep 2020, at 20:41, amal...@gmail.com <amal...@gmail.com> wrote:
Okay after much reading, i realise you misunderstood my question because i did not explain my issue correctly. The actual error i am having is this : "MongoError['No primary node is available! (Supervisor-1/Connection-2)']" when i try to connect to my db via the docker container. I am not running an image of mongo in another container hence i do not need docker-compose to load multiple containers or swarm to communicate between two containers. The heroku you are seeing is actually the id of my mongo atlas db cluster (it was previously an mlab hosted on heroku db which got migrated to atlas hence the name). My db connection string works perfectly fine outside the container but from within the container, i get mongo error no primary node. I have whitelisted my local container IP but i am still getting the same error message. Again, i can connect with the same connection string outside the container from my app and via mongo shell. After containerization tho it throws the mentioned error.
--
You received this message because you are subscribed to the Google Groups "ReactiveMongo - http://reactivemongo.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reactivemong...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reactivemongo/ddc01dcb-1430-4e29-a64f-999c9d66142cn%40googlegroups.com.