question

CharlieLaMothe-0452 avatar image
0 Votes"
CharlieLaMothe-0452 asked Ryukasz-3581 published

Cosmos 500: Object reference not set to an instance of an object

A cosmos query results in the following error.

com.mongodb.MongoQueryException: Query failed with error code 1 and error message '[ActivityId=b00ed574-9fa8-4c64-bda4-51bcce5a1a53] Error=1, Details='Response status code does not indicate success: InternalServerError (500); Substatus: 0; ActivityId: 00000000-0000-0000-0000-000000000000; Reason: (Object reference not set to an instance of an object.);' on server badgr-pro-stg-azure-cosmosdb-southcentralus.mongo.cosmos.azure.com:10255

This appears to be a null pointer exception within Cosmos internals. Are there any known causes, that we could be triggering by our query, or troubleshooting suggestions? This query is known to work against Mongo.

azure-cosmos-db
· 8
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @CharlieLaMothe-0452, welcome to Microsoft Q&A forum and sorry for the trouble you are facing.

Could you please provide the code snippet to fire the query and also couple of sample documents to repro the issue?

0 Votes 0 ·

Hi, I'm a coworker of @CharlieLaMothe-0452 who has been investigating this issue.

The problem occurs when sorting a cursor that contains just over 100 records, and the sort is done on an embedded value that is null.

I tried to include code here, but this comment form hangs when I try to submit the example. You can find a gist showing reproduction on a fresh database here: https://gist.github.com/Yona-Appletree/521fa7603ac6e4493eafbbb673613d7a

1 Vote 1 ·

Sorry for delay in responding.

If possible, can you please attach the code file in text file format and same with the documents? Without the code it is really challenging to repro the issue.

0 Votes 0 ·
Show more comments

0 Answers