Cosmos DB read operation timeout after second try with Error Code 500

Jerry Cui 0 Reputation points

I am having issues with Cosmos DB where the first read operation succeeds and returns result from DB as expected, but all subsequent reads fail with Error Code 500. The error message mentions a session token not being available. How can I resolve this issue? Here is the error message:

Error retrieving item: {"innerErrorMessage":"Entity with the specified id does not exist in the system. More info: The read session is not available for the input session token.","cosmosDiagnostics":{"userAgent":"azsdk-java-cosmos/4.61.1 MacOSX/14.5 JRE/17.0.11","activityId":"129377c7-931a-4d0f-bac1-0e70a36b11ad","requestLatencyInMs":15326,"requestStartTimeUTC":"2024-06-19T20:23:59.622612Z","requestEndTimeUTC":"2024-06-19T20:24:14.949391Z","responseStatisticsList":[{"storeResult":{"storePhysicalAddress":"rntbd://","lsn":-1,"globalCommittedLsn":-1,"partitionKeyRangeId":null,"isValid":false,"statusCode":500,"subStatusCode":20910,"isGone":false,"isNotFound":false,"isInvalidPartition":false,"isThroughputControlRequestRateTooLarge":false,"requestCharge":0.0,"itemLSN":-1,"sessionToken":null,"backendLatencyInMs":null,"retryAfterInMs":null,"exceptionMessage":"Unexpected exception RntbdTransportClient({"id":2,"isClosed":true,"configuration":]

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,533 questions
{count} votes

1 answer

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 29,012 Reputation points Microsoft Employee

    @Jerry Cui Welcome to Microsoft Q&A thanks for posting your question.

    Please share more information on what version of SDK and what API you are using. also review the Cosmos DB SDK documentation for best practices on handling retries and managing session tokens.

    Sometimes, transient issues can cause temporary unavailability of the session token. Retrying the operation after a short delay may resolve the issue, if you're using an older version of the Cosmos DB SDK, consider updating to the latest version as it may contain fixes for issues related to session management.

    you can also explore more on the post here



    0 comments No comments