unable to connect to cosmos mongo dB

Damilola Adejobi 0 Reputation points
2023-07-27T09:36:11.6966667+00:00
When we try to connect to the cosmos mongo DB “monitoring-cosmos-ensight” form inside the function utilizing the system managed identity we get:
[Error]   Error when reading device shellypro3em-c8f09e87a5a4 : A timeout occurred after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 }, OperationsCountServerSelector }. Client view of cluster state is { ClusterId : '1', ConnectionMode : 'ReplicaSet', Type : 'ReplicaSet', State : 'Disconnected', Servers : [{ ServerId: '{ ClusterId : 1, EndPoint : 'Unspecified/monitoring-cosmos-ensight.mongo.cosmos.azure.com:10255' }', EndPoint: 'Unspecified/monitoring-cosmos-ensight.mongo.cosmos.azure.com:10255', ReasonChanged: 'Heartbeat', State: 'Disconnected', ServerVersion: , TopologyVersion: , 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.ReadBytes(Stream stream, Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer(CancellationToken cancellationToken)

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,972 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.