maryamaljanabi / bestbags-nodejs-ecommerce

A responsive ecommerce website using Node js, Express js, and MongoDB
318 stars 206 forks source link

The index path corresponding to the specified order-by item is excluded #27

Closed pytdata closed 2 years ago

pytdata commented 2 years ago

Hi, so I connected the app to azure cosmos DB NodeJS API. AdminBro works alright but I whenever I try to access the front page I get the following error.

GET / 302 685.380 ms - 46 MongoError: Error=2, Details='Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 77760ca9-a44a-49d1-93fc-c61413d5c5df; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 77760ca9-a44a-49d1-93fc-c61413d5c5df; Reason: (Response status code does not indicate success: BadRequest (400); Substatus: 0; ActivityId: 77760ca9-a44a-49d1-93fc-c61413d5c5df; Reason: (Message: {"Errors":["The index path corresponding to the specified order-by item is excluded."]} ActivityId: 77760ca9-a44a-49d1-93fc-c61413d5c5df, Request URI: /apps/a4038f59-dbab-454f-982e-c3c4ff0515f8/services/302463b7-7d21-4aa9-8c6a-1e7f8bc1c398/partitions/53e82a5d-f5cc-472f-83ae-6e4712cf3538/replicas/132878310044987400s/, RequestStats: Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum, SDK: Windows/10.0.19041 cosmos-netstandard-sdk/3.18.0);););
at MessageStream.messageHandler (C:\node-js-projects\farmtopot\node_modules\mongodb\lib\cmap\connection.js:299:20) at MessageStream.emit (node:events:390:28) at processIncomingData (C:\node-js-projects\farmtopot\node_modules\mongodb\lib\cmap\message_stream.js:144:12) at MessageStream._write (C:\node-js-projects\farmtopot\node_modules\mongodb\lib\cmap\message_stream.js:42:5) at writeOrBuffer (node:internal/streams/writable:389:12) at _write (node:internal/streams/writable:330:10) at MessageStream.Writable.write (node:internal/streams/writable:334:10) at TLSSocket.ondata (node:internal/streams/readable:754:22) at TLSSocket.emit (node:events:390:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at TLSSocket.Readable.push (node:internal/streams/readable:228:10) at TLSWrap.onStreamRead (node:internal/stream_base_commons:199:23) { ok: 0, code: 2, codeName: 'BadValue' } GET / 302 630.101 ms - 46

maryamaljanabi commented 2 years ago

Hi @pytdata, this is not an issue with the project as long as it works fine on your local machine. Connecting it to an external DB or an API is beyond the scope of the project. Thank you.