A few songs in my library will play until a song stops 1-3 seconds before it is supposed to end and I receive the blue bar at the top of the screen saying "can't play the current song". I have turned off hardware acceleration, restarted my computer, uninstalled and reinstalled the application and nothing has worked. It has been happening for a week or 2.
In case the playback stops unexpectedly on the Spotify desktop app and you get the error message you describe you might be experiencing an issue that we're currently investigating. We suggest you go to this Ongoing Issue and add your vote to it by clicking on the +VOTE button. Make sure you follow the steps provided under Status Update as well.
It'll also be useful to subscribe via the three-dots menu in the top right corner next to the title. That'll make sure you stay up to date with any relevant updates about this.
Hope this helps. Let us know if you have any more questions.