Azure Cosmos DB for MongoDB: Error 261 (TooManyLogicalSessions) During Initial List Collections Call

Felix 0 Reputation points
2026-09-11T03:40:08.3433333+00:00

Problem description

I am encountering error 261, labeled as 'TooManyLogicalSessions', when attempting to connect to my Azure Cosmos DB for MongoDB (vCore) resource. This issue occurs during the first call to 'list collections' from a .NET Core application using SDK version 10.x.x. I expected to access the database for development purposes, but the error appears immediately on the initial list collections attempt. The problem started around 2026-09-11T03:04:26Z. I have not observed any open connections at that time and did not find specific guidance for error 261 in the available self-help materials.

Environment

Service: Azure Cosmos DB for MongoDB (vCore); Client: .NET Core application; SDK version: 10.x.x; Operation: listing collections; No specific region, tier/SKU, or resource names provided.

What I've already tried

I have not tried any troubleshooting steps yet.

Current status

I am seeking guidance on resolving the error 261 during the initial list collections call, understanding whether this is related to session limits or configuration issues, and how to mitigate or prevent this error in my development environment. However, I suspect it is a bug in the database.

Azure Cosmos DB
Azure Cosmos DB

An Azure NoSQL database service for app development.


1 answer

Sort by: Newest
  1. SIVASANKAR YEDDULA 250 Reputation points Microsoft External Staff Moderator
    2026-09-11T06:44:17.5133333+00:00

    Hi @Felix ,

    Thank you for contacting Microsoft Azure Support.

    We have reviewed the information provided regarding the Error 261 (TooManyLogicalSessions) encountered when accessing your Azure Cosmos DB for MongoDB (vCore) database.

    As part of our investigation, we have completed the following actions:

    Reviewed the reported error and environment details.

    Confirmed that the failure occurs during the initial List Collections operation and returns Error 261 (TooManyLogicalSessions).

    Recommended validating that the application reuses a single MongoClient instance instead of creating multiple client instances.

    Suggested restarting the application/service to clear any stale or inactive client sessions.

    Requested the complete exception details, stack trace, and Activity IDs (if available) to assist with further correlation.

    Recommended reviewing the application's connection and session management implementation.

    Initiated an investigation of the Azure Cosmos DB for MongoDB (vCore) cluster to validate logical session utilization and identify any abnormal session consumption patterns.

    If service-side session exhaustion is confirmed, additional backend analysis will be performed to identify the source of excessive logical session usage and determine appropriate remediation steps.

    Current Status

    The issue remains under investigation. Additional backend validation is required to determine whether the TooManyLogicalSessions (261) error is caused by logical session exhaustion, stale session allocation, application connection management behavior, or a service-side condition affecting session availability.

    We will share further findings as soon as they become available.

    Thank you for your patience and cooperation.

    Kind regards,

    Sivasankar Yeddula
    Microsoft Azure Support.

    Was this answer helpful?

    0 comments No comments

Your answer

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