Error message The index path corresponding to the specified order-by item is excluded

Monique de Jonge 10 Reputation points
2023-02-10T09:43:59.49+00:00

I'm using Azure with CosmosDB-API for MongoDB account to host my Nightscout page. This is a website where I keep track of my diabetes data. It was working fine until last sunday 5 february.

Then, on monday, I suddenly couldn't reach my site anymore and uploading of data failed. I hadn't changed anything, but I got an error message, which I don't understand at all. How to fix this? I don't want to lose my data.
This is what I get when I open the web page:

Unable to setup authorization

{"stack":"MongoError: Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 91dfbf1b-ea1e-47a9-8245-42e87015af8f; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 91dfbf1b-ea1e-47a9-8245-42e87015af8f; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 91dfbf1b-ea1e-47a9-8245-42e87015af8f; Reason: (Message: {"Errors":["The index path corresponding to the specified order-by item is excluded."]}\r

ActivityId: 91dfbf1b-ea1e-47a9-8245-42e87015af8f, Request URI: /apps/5d8bd29c-ebb8-4381-955c-03095791857b/services/6f07956c-8a82-4a30-bc4c-67e6937e5ea1/partitions/6b422eab-0fae-4e4e-8594-7fa41b869eae/replicas/133102314543862168s/, RequestStats: Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum, SDK: Windows/10.0.17763 cosmos-netstandard-sdk/3.18.0);););
at MessageStream.messageHandler (/opt/app/node_modules/mongodb/lib/cmap/connection.js:266:20)
at MessageStream.emit (events.js:315:20)
at processIncomingData (/opt/app/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
at MessageStream._write (/opt/app/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
at writeOrBuffer (internal/streams/writable.js:358:12)
at MessageStream.Writable.write (internal/streams/writable.js:303:10)
at TLSSocket.ondata (internal/streams/readable.js:719:22)
at TLSSocket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)","message":"Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 91dfbf1b-ea1e-47a9-8245-42e87015af8f; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 91dfbf1b-ea1e-47a9-8245-42e87015af8f; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 91dfbf1b-ea1e-47a9-8245-42e87015af8f; Reason: (Message: {"Errors":["The index path corresponding to the specified order-by item is excluded."]}\r
ActivityId: 91dfbf1b-ea1e-47a9-8245-42e87015af8f, Request URI: /apps/5d8bd29c-ebb8-4381-955c-03095791857b/services/6f07956c-8a82-4a30-bc4c-67e6937e5ea1/partitions/6b422eab-0fae-4e4e-8594-7fa41b869eae/replicas/133102314543862168s/, RequestStats: Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum, SDK: Windows/10.0.17763 cosmos-netstandard-sdk/3.18.0);););","ok":0,"code":2,"codeName":"BadValue","name":"MongoError"}

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

1 answer

Sort by: Most helpful
  1. Stijn Bienkens 0 Reputation points
    2023-03-14T21:33:46.47+00:00

    Hi

    This seems to be related to the following issue that was registered on GitHub: https://github.com/nightscout/cgm-remote-monitor/issues/7617

    Basically when a new collaction is created in the mongo database, some fields aren't automatically being indexed. A fix for this was merged in the nightscout repository which ensures indexes are created when the Docker container is started.

    I updated to the following docker container tag: dev_ec83b570bb64a09dc95203a4557c59324fe81dcd, this contains the fix.

    Do this at your own risk, since this is a development/beta build which may contain bugs.

    This will break AndroidAPS <-> NightScout integration: https://github.com/nightscout/cgm-remote-monitor/issues/7874

    Best regards
    Stijn B.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.