Open diginc opened 8 years ago
If you aren't trying to keep track of which artists are being played most, you can disable this index in models/Artist.js
: https://github.com/martindale/soundtrack.io/blob/soundtrack.io/models/Artist.js#L11 (just remove unique: true
, run db.artists.dropIndexes()
, then restart your app). However, I don't recommend this.
I'm adding an action item to overhaul the stat tracking for 1.0, as what we have in place is a very rough cut. If you're able to track down any particular way of reproducing this, please let me know – it'll be helpful for producing a patch before we get to 1.0.
I had a crash sunday (when no one was on AFAIK) and then again today (with active people) on my instance. My impression of root cause is the artist already exists but didn't get matched / re-used and then the index prevent a duplicate artist from being created, not sure though. Here are some more details on what I see in logs/mongo:
This is shown in the node log after someone queued this song according to them the song actually played succesfully too. then the instance seems to crash.
When starting the node process got this error:
I threw in a console.log(track) right above line 292 and found the track ID just to confirm it was was the same one as the duplicate key error:
Now knowing about the duplicate key error I looked back threw my log and found how it has actually been happening a lot however I've only had the 2 crashes followed by inability to start node back up:
Seems my database has gotten a little dirty...these tracks get plays/tracks created but no corresponding artist object (due to an index constraint it seems?).
I've been cleaning up like this for now, but two crashes in two days is not a good sign.