Integrated Cache: An error occurs when executing Point Read
See original GitHub issueDescribe the bug
When performing a read operation on a Cosmos DB account provisioned with Dedicated gateway, an error occurs and the operation does not work properly.
To Reproduce
Code used for testing.
class Program
{
static async Task Main(string[] args)
{
var connectionString = "AccountEndpoint=https://shibayantest.sqlx.cosmos.azure.com/;AccountKey=***;";
var cosmosClient = new CosmosClient(connectionString, new CosmosClientOptions
{
ConnectionMode = ConnectionMode.Gateway,
SerializerOptions = new CosmosSerializationOptions
{
PropertyNamingPolicy = CosmosPropertyNamingPolicy.CamelCase
}
});
var container = cosmosClient.GetContainer("HackAzure", "TodoItem");
var item = await container.ReadItemAsync<TodoItem>("f32199f7-0b30-4da3-b006-5b8a34a99d8f", new PartitionKey("shibayan"));
}
}
Expected behavior
Items can be read correctly.
Actual behavior
Unable to load items due to CosmosException
.
Environment summary SDK Version: 3.19.0-preview1 OS Version (e.g. Windows, Linux, MacOSX): Windows
Additional context Add any other context about the problem here (for example, complete stack traces or logs).
Microsoft.Azure.Cosmos.CosmosException: 'Response status code does not indicate success: InternalServerError (500); Substatus: 0; ActivityId: 6c96b689-e1ac-4217-ab4a-3853a3398927; Reason: ({"code":"InternalServerError","message":"System.ArgumentException: Cannot pass CancellationToken.None when requiresRealCancellationToken is true\r\n at Microsoft.Azure.Cosmos.Compute.Core.InteropClient.InteropClient..ctor(CosmosClient cosmosClient, Boolean isServerlessEnabled, Boolean requiresRealCancellationToken, CancellationToken defaultCancellationToken)\r\n at Microsoft.Azure.Cosmos.Compute.Runtime.ServiceInteropClient..ctor(CosmosClient cosmosClient, IComputeRequestTracker computeRequestTracker, IChargeModel chargeModel, Boolean isServerlessEnabled, String globalDatabaseAccountName, Boolean requiresRealCancellationToken, OperationLatencyVerifier operationLatencyVerifier, Boolean isTransportLevelRUMonitoringEnabled, ComputeDiagnosticsLogger computeDiagnosticsLogger, CancellationToken defaultCancellationToken)\r\n at Microsoft.Azure.Cosmos.Compute.Host.ServiceInteropClientFactory.CreateInteropClient(CosmosClient cosmosClient, IComputeRequestTracker computeRequestTracker, IChargeModel chargeModel, Boolean isServerlessEnabled, String globalDatabaseAccountName, Boolean requiresRealCancellationToken, OperationLatencyVerifier operationLatencyVerifier, Boolean isTransportLevelRUMonitoringEnabled, CancellationToken cancellationToken)\r\n at Microsoft.Azure.Cosmos.Compute.Runtime.CosmosDBRequestPipeline.GetClientsForRequest(Boolean useApiOperationHandler, CosmosDBRequest request, ICosmosDBTransportRequestContext transportRequestContext, AuthorizationResult authResult, IServiceInteropClientFactory interopClientFactory, ITenantContainerServiceProvider tenantContainerServiceProvider, ICosmosDBConfigProvider tenantConfigurationProvider, Boolean disableRateLimitingResponses, IInteropClient& interopClient, IDocumentClient& documentClient, Exception& exception)"}
RequestUri: https://shibayantest.sqlx.cosmos.azure.com/;
RequestMethod: GET;
Header: Authorization Length: 86;
Header: x-ms-date Length: 29;
Header: Cache-Control Length: 8;
Header: User-Agent Length: 84;
Header: x-ms-version Length: 10;
Header: Accept Length: 16;
ActivityId: ccc03c32-b19b-4ecc-8e59-0fd6c6835818, Request URI: /, RequestStats: , SDK: Windows/10.0.19043 cosmos-netstandard-sdk/3.19.1);'
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Azure Cosmos DB integrated cache - Overview
An item cache for point reads; A query cache for queries. The integrated cache is a read-through, write-through cache with a Least Recently ......
Read more >SharePoint 2016 Distributed Cache Failed to connect to ...
Unexpected error while executing ExportCacheClusterConfig with parameters provider: 'SPDistributedCacheClusterProvider' , connectionString: ' ( ...
Read more >Reading and writing data to the cache
The readQuery method enables you to execute a GraphQL query directly on your cache, like so: ... If the cache is missing data...
Read more >3 Troubleshooting Oracle In-Memory Database Cache
If the cache agent is not running, start it as described in "Starting the cache agent" in the Oracle In-Memory Database Cache User's...
Read more >Read-Through, Write-Through, Refresh-Ahead and Write- ...
This is called Read-Through caching. Refresh-Ahead Cache functionality may further improve read performance (by reducing perceived latency).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ealsur Thanks for the reply. The same thing happened with the Node.js SDK, so it wasn’t a problem with the SDK. I just opened SR 2106010060004117.
@kavyako Simply deleting the relevant properties resulted in an error, but the error was resolved when I recreated the Dedicated gateway afterwards.
Thank you very much for your help.