1

I get the following exception while making a query to Azure Cosmos DB. I am unable to understand the exact problem with this exception. It used to work earlier and I am sure that no recent changes were made to azure cosmos DB. Can anyone suggest how to proceed forward in fixing this exception.

DocumentClientException: The provided by the gateway. This is a first chance (internal) exception that all newer clients will know how to handle gracefully. This exception is traced, but unless you see it bubble up as an exception (which only happens on older SDK clients), then you can safely ignore this message.

Madhur Maurya
  • 1,016
  • 4
  • 19
  • 42
  • Which CosmosDB SDK are you using? v2? Also can you show us the code that does the operations and where exactly you get his exception? – Nick Chapsas Feb 06 '19 at 10:48
  • I am performing a join query something like **SELECT distinct value f.field1 FROM Design f Join c in f.field2.results WHERE f.Id in ('6666') and c.id IN ('3545, '1231')** I am using azure cosmos db. I am not sure of the version. Can you tell me how to check it ? – Madhur Maurya Feb 06 '19 at 11:04
  • 1
    How are you querying it though? What's the medium? C#? Java? The azure portal? – Nick Chapsas Feb 06 '19 at 11:10
  • I am using Microsoft.Azure.DocumentDB SDK version 1.41 with target framework net451 – Madhur Maurya Feb 06 '19 at 11:11
  • 1
    That's a really old version. Did you try upgrading to latest and see if the system exists? It shouldn't be the problem as the SDKs target a specific API version but worth investigating. – Nick Chapsas Feb 06 '19 at 11:16
  • I updated it to version 2.2.1 and it seems working. But I am still not sure what caused it to throw exception earlier. Thanks for you help @NickChapsas – Madhur Maurya Feb 06 '19 at 11:29
  • It must be something that might have changed on the server side. I will write up the answer. Approve it when you can. – Nick Chapsas Feb 06 '19 at 11:34

1 Answers1

2

The 1.4.1 version is a really old SDK. The SDKs populate the version header so that the server would know which version should handle this request but it seems like in this case something has changed on the server side.

Upgrading to latest SDK version will fix the issue (as discussed in the comments).

Nick Chapsas
  • 6,872
  • 1
  • 20
  • 29