Yooooomi / your_spotify

Self hosted Spotify tracking dashboard
GNU General Public License v3.0
3.02k stars 122 forks source link

500 on "Top song" and "Top artist" #319

Closed shaman007 closed 10 months ago

shaman007 commented 10 months ago

Describe the bug

I don't have "Top song/artist" in the interface, 500 errors in the log file

Log file looks like this:

  codeName: 'InvalidPipelineOperator',
  [Symbol(errorLabels)]: Set(0) {}
}
GET /spotify/top/artists?start=2023-11-23T08:17:15.389Z&end=2023-11-24T08:17:15.389Z&nb=1&offset=0 500 51.057 ms - -
GET /spotify/songs_per?start=2023-11-22T08:17:15.389Z&end=2023-11-23T08:17:15.389Z&timeSplit=all 200 144.662 ms - 41
[error]  MongoServerError: Unrecognized expression '$first'
    at Connection.onMessage (/app/node_modules/mongoose/node_modules/mongodb/lib/cmap/connection.js:202:26)
    at MessageStream.<anonymous> (/app/node_modules/mongoose/node_modules/mongodb/lib/cmap/connection.js:61:60)
    at MessageStream.emit (node:events:513:28)
    at processIncomingData (/app/node_modules/mongoose/node_modules/mongodb/lib/cmap/message_stream.js:124:16)
    at MessageStream._write (/app/node_modules/mongoose/node_modules/mongodb/lib/cmap/message_stream.js:33:9)
    at writeOrBuffer (node:internal/streams/writable:391:12)
    at _write (node:internal/streams/writable:332:10)
    at MessageStream.Writable.write (node:internal/streams/writable:336:10)
    at Socket.ondata (node:internal/streams/readable:754:22)
    at Socket.emit (node:events:513:28) {
  ok: 0,
  code: 168,
  codeName: 'InvalidPipelineOperator',
  [Symbol(errorLabels)]: Set(0) {}
GET /spotify/top/songs?start=2023-11-23T08:17:15.389Z&end=2023-11-24T08:17:15.389Z&nb=1&offset=0 500 45.595 ms - -
}
GET /spotify/time_per?start=2023-11-23T08:17:15.389Z&end=2023-11-24T08:17:15.389Z&timeSplit=all 200 180.222 ms - 29
GET /spotify/time_per?start=2023-11-22T08:17:15.389Z&end=2023-11-23T08:17:15.389Z&timeSplit=all 200 156.798 ms - 30
GET /spotify/different_artists_per?start=2023-11-23T08:17:15.389Z&end=2023-11-24T08:17:15.389Z&timeSplit=all 200 412.050 ms - 2250
GET /spotify/time_per?start=2023-11-23T08:17:15.389Z&end=2023-11-24T08:17:15.389Z&timeSplit=hour 200 402.638 ms - 202
GET /spotify/time_per_hour_of_day?start=2023-11-23T08:17:15.389Z&end=2023-11-24T08:17:15.389Z 200 395.339 ms - 64
GET /spotify/different_artists_per?start=2023-11-22T08:17:15.389Z&end=2023-11-23T08:17:15.389Z&timeSplit=all 200 410.863 ms - 8722
GET /spotify/gethistory?number=20&offset=0&start=2023-11-23T08:17:15.389Z&end=2023-11-24T08:17:15.389Z 200 897.412 ms - 18268
shaman007 commented 10 months ago

Might it be the old mongo?

root@mongodb-0:/# mongod --version
db version v4.0.8
git version: 9b00696ed75f65e1ebc8d635593bed79b290cfbb
OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1604
    distarch: aarch64
    target_arch: aarch64
Yooooomi commented 10 months ago

Hello, minimum supported version for mongo is 4.4.0

shaman007 commented 10 months ago

Thank you!