Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

1.10 with Mongo Atlas - No active channel can be found to the primary node:

73 views
Skip to first unread message

Michał Matłoka

unread,
Oct 25, 2023, 5:04:01 AM10/25/23
to ReactiveMongo - http://reactivemongo.org
Hi,
I have an application which was working fine with reactive mongo 0.12.4 (including play2-reactivemongo and reactivemongo-akka) and Mongo 4 running on Mongo Atlas. 

I have update the app to the 1.1.0-play28-RC11 and to Mongo 6 on Mongo Atlas. Application is connected using mongodb+srv protocol. It works, but at random moments requests starts failing with 

"""
play.api.UnexpectedException: Unexpected exception[ChannelNotFoundException: MongoError['No active channel can be found to the primary node: 'cluster-name-shard-00-01.cluster-address.mongodb.net:27017' { authenticated:0, authenticating: 0, connected:0, channels:2 } (Supervisor-1/app_name)']] 2023-10-25 07:49:10.732 [app_name] web.1 at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:358) 2023-10-25 07:49:10.732 [app_name] web.1 at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:264) 2023-10-25 07:49:10.732 [app_name] web.1 at ErrorHandler.onServerError(ErrorHandler.scala:84) 2023-10-25 07:49:10.732 [app_name] web.1 at play.core.server.AkkaHttpServer$$anonfun$2.applyOrElse(AkkaHttpServer.scala:441) 2023-10-25 07:49:10.732 [app_name] web.1 at play.core.server.AkkaHttpServer$$anonfun$2.applyOrElse(AkkaHttpServer.scala:433) 2023-10-25 07:49:10.732 [app_name] web.1 at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:490) 2023-10-25 07:49:10.732 [app_name] web.1 at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:63) 2023-10-25 07:49:10.732 [app_name] web.1 at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:100) 2023-10-25 07:49:10.732 [app_name] web.1 at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) 2023-10-25 07:49:10.732 [app_name] web.1 at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94) 2023-10-25 07:49:10.732 [app_name] web.1 Caused by: reactivemongo.core.actors.Exceptions$ChannelNotFoundException: MongoError['No active channel can be found to the primary node: 'cluster-name-shard-00-01.cluster-address.mongodb.net:27017' { authenticated:0, authenticating: 0, connected:0, channels:2 } (Supervisor-1/app_name)'] 2023-10-25 07:49:10.732 [app_name] web.1 Caused by: reactivemongo.core.actors.Exceptions$InternalState: 2023-10-25 07:49:10.732 [app_name] web.1 at reactivemongo.ChannelDisconnected(f1f5f862, {{NodeSet Some(atlas-some-address-shard-0) Node[cluster-name-shard-00-02.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={dev@admin}] | Node[cluster-name-shard-00-00.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={dev@admin}] | Node[cluster-name-shard-00-01.cluster-address.mongodb.net:27017: Primary<36877s> (1/1/1 available connections), latency=0s, authenticated={dev@admin}] }})(<time:36878411089418>) 2023-10-25 07:49:10.732 [app_name] web.1 at reactivemongo.ScramNegociation(SCRAM-SHA-1, 052f6a13)(<time:36877479395806>) 2023-10-25 07:49:10.732 [app_name] web.1 at reactivemongo.AuthResponse$PrimaryAvailable({{NodeSet Some(atlas-some-address-shard-0) Node[cluster-name-shard-00-02.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={dev@admin}] | Node[cluster-name-shard-00-00.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] | Node[cluster-name-shard-00-01.cluster-address.mongodb.net:27017: Primary<36877s> (1/1/1 available connections), latency=0s, authenticated={dev@admin}] }})(<time:36877479209708>) 2023-10-25 07:49:10.732 [app_name] web.1 at reactivemongo.AuthResponse$SetAvailable({{NodeSet Some(atlas-some-address-shard-0) Node[cluster-name-shard-00-02.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={dev@admin}] | Node[cluster-name-shard-00-00.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] | Node[cluster-name-shard-00-01.cluster-address.mongodb.net:27017: Primary<36877s> (1/1/1 available connections), latency=0s, authenticated={dev@admin}] }})(<time:36877479167008>) 2023-10-25 07:49:10.732 [app_name] web.1 at reactivemongo.ScramNegociation(SCRAM-SHA-1, c8f7ea91)(<time:36877460207648>) 2023-10-25 07:49:10.732 [app_name] web.1 at reactivemongo.AuthResponse$PrimaryAvailable({{NodeSet Some(atlas-some-address-shard-0) Node[cluster-name-shard-00-02.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] | Node[cluster-name-shard-00-00.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] | Node[cluster-name-shard-00-01.cluster-address.mongodb.net:27017: Primary<36877s> (1/1/1 available connections), latency=0s, authenticated={dev@admin}] }})(<time:36877460069687>) 2023-10-25 07:49:10.732 [app_name] web.1 at reactivemongo.AuthResponse$SetAvailable({{NodeSet Some(atlas-some-address-shard-0) Node[cluster-name-shard-00-02.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] | Node[cluster-name-shard-00-00.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] | Node[cluster-name-shard-00-01.cluster-address.mongodb.net:27017: Primary<36877s> (1/1/1 available connections), latency=0s, authenticated={dev@admin}] }})(<time:36877460027036>) 2023-10-25 07:49:10.732 [app_name] web.1 at reactivemongo.ScramNegociation(SCRAM-SHA-1, f1f5f862)(<time:36877459635697>) 2023-10-25 07:49:10.732 [app_name] web.1 at reactivemongo.AuthResponse$PrimaryAvailable({{NodeSet Some(atlas-some-address-shard-0) Node[cluster-name-shard-00-02.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] | Node[cluster-name-shard-00-00.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] | Node[cluster-name-shard-00-01.cluster-address.mongodb.net:27017: Primary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] }})(<time:36877459099346>) 2023-10-25 07:49:10.732 [app_name] web.1 at reactivemongo.AuthResponse$SetAvailable({{NodeSet Some(atlas-some-address-shard-0) Node[cluster-name-shard-00-02.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] | Node[cluster-name-shard-00-00.cluster-address.mongodb.net:27017: Secondary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] | Node[cluster-name-shard-00-01.cluster-address.mongodb.net:27017: Primary<36877s> (1/1/1 available connections), latency=0s, authenticated={}] }})(<time:36877458859521>)
"""

Has anyone encountered such problem?

Brad Rust

unread,
Oct 25, 2023, 12:52:54 PM10/25/23
to reacti...@googlegroups.com
FWIW, I too have not been able to have a stable environment against a Mongo 6 Atlas instance.   If it matters, RC11 against Mongo 5 is our production environment and is stable.

From: 'Michał Matłoka' via ReactiveMongo - http://reactivemongo.org <reacti...@googlegroups.com>
Sent: Wednesday, October 25, 2023 3:04 AM
To: ReactiveMongo - http://reactivemongo.org <reacti...@googlegroups.com>
Subject: 1.10 with Mongo Atlas - No active channel can be found to the primary node:
 
--
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/2a41aba5-f123-4f21-83c6-6de372e72547n%40googlegroups.com.

Cédric Chantepie

unread,
Oct 29, 2023, 5:12:51 PM10/29/23
to ReactiveMongo - http://reactivemongo.org
With only 2 channels, resilience can hardly happen.

Brad Rust

unread,
Oct 31, 2023, 8:57:39 PM10/31/23
to ReactiveMongo - http://reactivemongo.org
I don't understand what you mean Cédric , are you saying there is something configurable or are you saying that it could never be resilient?   If there is a suggested URI for Atlas Mongo 6, I would be more than happy to test against that and report back.




From: reacti...@googlegroups.com <reacti...@googlegroups.com> on behalf of Cédric Chantepie <chantep...@gmail.com>
Sent: Sunday, October 29, 2023 3:12 PM
Subject: Re: 1.10 with Mongo Atlas - No active channel can be found to the primary node:
 

Cédric Chantepie

unread,
Nov 1, 2023, 10:42:16 AM11/1/23
to ReactiveMongo - http://reactivemongo.org
http://reactivemongo.org/releases/1.0/documentation/tutorial/connect-database.html default `rm.nbChannelsPerNode` if you have only two, this is overriden somewhere.

Michał Matłoka

unread,
Nov 2, 2023, 8:21:50 AM11/2/23
to ReactiveMongo - http://reactivemongo.org
hm, theoretically I have the default settings

Brad Rust

unread,
Nov 3, 2023, 2:08:35 PM11/3/23
to reacti...@googlegroups.com
I see what you mean now from the original comment.   My particular comment about Atlas and Mongo 6.0 is not​ related the nmChannelsPerNode.    Thanks for being responsive btw,... I realize this is a large opensource project and is complex and relied upon but lots of folks.



Sent: Wednesday, November 1, 2023 8:42 AM
Subject: Re: 1.10 with Mongo Atlas - No active channel can be found to the primary node:
 

Cédric Chantepie

unread,
Nov 3, 2023, 6:05:16 PM11/3/23
to ReactiveMongo - http://reactivemongo.org
The default value being 10, except if you have fatal network issue at app startup, you should have 10 channels, even with disconnected status.
Have only 2, tends to indicate there is an issue on the integration side.
Reply all
Reply to author
Forward
0 new messages