A timeout occured after 30000ms selecting a server using CompositeServerSelector

Monday, November 25, 2024 3:29:29 PM
  • Posted: Thursday, December 13, 2018 8:33 AM
  • 10
hi, thanks for your great support, my problem is: I am trying to connect my application on Azure to my MongoDB atlas database hosting for MongoDB, I put everything is wright, and give this error down, but when publishing and install from my localhost its run good and create a database but not continue running, and fall down could you help me .
Note: my  MongoDB atlas Clusters is Azure
REGION
Azure / Virginia (eastus2)

A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "1", ConnectionMode : "Automatic", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/shahbander-shard-00-00-yv0jr.azure.mongodb.net:27017" }", EndPoint: "Unspecified/shahbander-shard-00-00-yv0jr.azure.mongodb.net:27017", State: "Disconnected", Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> MongoDB.Driver.MongoConnectionException: An exception occurred while receiving a message from the server. ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at MongoDB.Driver.Core.Misc.StreamExtensionMethods.ReadBytesAsync(Stream stream, IByteBuffer buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync()
--- End of inner exception stack trace ---
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync()
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync(Int32 responseTo, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveMessageAsync(Int32 responseTo, IMessageEncoderSelector encoderSelector, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)
at MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1.ExecuteAsync(IConnection connection, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Connections.IsMasterHelper.GetResultAsync(IConnection connection, CommandWireProtocol`1 isMasterProtocol, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Connections.ConnectionInitializer.InitializeConnectionAsync(IConnection connection, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.ServerMonitor.HeartbeatAsync(CancellationToken cancellationToken)" }] }.
0
  • Posted: Thursday, December 13, 2018 11:16 AM
  • 953
Hello,

It's related with MongoDB connection error. Probably you don't have permissions or you didn't specify the allowed IPs in MongoDB. Please check for example in MongoDB Compose if you are able to connect with your MongoDB Atlas. If you won't be able to connect, that means that you have wrong MongoDB connection string.

Best,
Patryk
Best regards,
Patryk

GrandNode Team
0
  • Posted: Thursday, December 13, 2018 11:53 AM
  • 10
yes its connected with MongoDB Compass Community
0
  • Posted: Thursday, December 13, 2018 12:38 PM
  • 10
with this error some time
500 - The request timed out.
The web server failed to respond within the specified time.
0
  • Posted: Thursday, December 13, 2018 3:08 PM
  • 953
It happens after installation? Or when?
Best regards,
Patryk

GrandNode Team
0
  • Posted: Tuesday, December 18, 2018 10:33 PM
  • 10
after installation, its create a database but not continue to website
0
  • Posted: Tuesday, December 18, 2018 11:24 PM
  • 55
Are you using a connection string to connect? May want to try.

RE: https://stackoverflow.com/questions/31314245/a-timeout-occured-after-30000ms-selecting-a-server-using-compositeserverselector

If there's a firewall in the middle and you are connecting from a remote host, have you permitted remote connections?
Is your MongoDB set up for user and pass based authentication? Are you referencing the right auth db after creating a privelleged account for said db?
0
  • Posted: Tuesday, December 18, 2018 11:34 PM
  • 55
I have little knowledge of clustering MongoDB on Azure, but potentially something to do with the nodes "stepping down" :

https://stackoverflow.com/questions/46447883/mongodb-write-concern-majority-attempted-to-read-past-the-end-of-the-stream

I'll spare you the rest of my blind search.  
0
  • Posted: Tuesday, December 18, 2018 11:52 PM
  • 55
Last one, but I would -> assume <- there is a way to extend the keep-alive / heartbeat time, I wonder if you have tried this?

But perhaps the better question is, what is it you have tried so far?
0
  • Posted: Wednesday, February 26, 2020 2:14 AM
  • 1
I had the same problem but when i pasted the connection string instead of manually filling connection details the installation completed sucessfuly
0
back to top
Filters