3

I have no idea why this happening while querying the cosmos database it won't show any document not even for the

SELECT * FROM c

but the RU's is shown. but it works fine with the Documents tab in documents tab if I'm using any filter then also it working but it won't work for SQL query.

I have added the screenshot for both the case and also the scale & setting.

Do I need to reinstall the azure cosmosdb emulator? if yes then, is there any way to retain my old data of emulator

enter image description here

enter image description here

enter image description here

Satyaray Singh
  • 267
  • 3
  • 11

1 Answers1

1

This looks like a bug with the emulator.

I was able to recreate your issue. This only happens with partitioned collections when the partition key isn't provided and you're trying to do a cross partition query.

If you open your Network tab in the browser you can actually see this message:

"The provided cross partition query can not be directly served 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"

However you can also see your results returned in another request, they are just not visualised. I looks like the front end is just not handling this first error properly but I can't know for sure.

enter image description here

Nick Chapsas
  • 6,872
  • 1
  • 20
  • 29
  • I have try to reinstall the emulator.after installation error as "Failed to get authorization headers for offers: {"readyState":4,"responseText":"{\"code\":\"InternalServerError\",\"message\":\"Unknown server error occurred when processing this request.\\r\\nActivityId: 92d7de95-3286-454f-b1d8-50b0a96b6432, Microsoft.Azure.Documents.Common/2.0.0.0\"}","responseJSON":{"code":"InternalServerError","message":"Unknown server error occurred when processing this request.\r\nActivityId: 92d7de95-3286-454f-b1d8-50b0a96b6432, Microsoft.Azure.Documents.Common/2.0.0.0"},"status":500,"statusText":"error"} – Satyaray Singh Oct 16 '18 at 10:23
  • This is a separate error. If you update you need to `Reset data` for the emulator. Please see https://stackoverflow.com/questions/52708774/cosmos-db-emulator-failed-to-get-authorization-headers-for-offers/52708897#52708897 – Nick Chapsas Oct 16 '18 at 10:56
  • I have reset data. After that, I have again tried to fire the SELECT * FROM c it still doesn't show me the output just the RU's can be seen as the first image in the question. – Satyaray Singh Oct 16 '18 at 12:15
  • Do I Need to again Reset the Data? @NickChapsas – Satyaray Singh Oct 16 '18 at 12:31
  • You do but this will just fix the offer header issue. Not the query issue. the query one looks like a bug with the emulator. I raised it with the CosmosDB team. – Nick Chapsas Oct 16 '18 at 15:06
  • how will I get the update that this issue is solved by CosmosDB team? @NickChapsas – Satyaray Singh Oct 22 '18 at 05:34
  • I will leave a comment here :) – Nick Chapsas Oct 22 '18 at 08:18
  • Great. Thank you @NickChapsas – Satyaray Singh Oct 22 '18 at 09:01