Was helping a friend troubleshoot a plex issue yesterday and came across this scenario. I know its somewhat unique, but could still save people time if a qa check was implemented -
Essentially, he had plex beta and running in docker. His plex container restarted, Plex wouldn’t go healthy, logs showed a db schema update processing then failing. After troubleshooting, I noticed his Plex container was installing prod plex on launch, not beta. It appears his credit card lapsed, and plex pass was removed, but for whatever reason this didn’t reflect in the plex gui right away, further compounding the confusion in troubleshooting.
Because of this, the container was forcing his plex version to prod, which wasn’t compatible with the beta schema updates.
Would be good for plex to write a db version to the db or prefs file that gets checked on launch. If the current installed plex version isn’t compatible with the db, throw a specifically worded message stating such into the plex log/docker logs and halt startup.
Perhaps this should be a feature request but its not really a feature, more so a compatibility QA check on startup. It could also potentially prevent db corruption, as the prod version did attempt to do db updates, but failed midway. Upon fixing his plex pass and rolling forward to beta, the db appears to be working fine though.
If a downgraded server version is started for the first time, it will automatically try to remove the database modifications of newer server versions.
If that fails, it is usually rooted in a defective database file.
You better ensure your database file is healthy, by performing the in-depth database rebuild. – even though the server appears to be working fine after downgrading.
There is a special case: very rarely, there are breaking changes in the database. Peruse the release notes of the old and new software releases (and those in-between) if there are any such breaking changes mentioned. They will usually tell how far back you can go with downgrading.
Just for reference had another friend rebuild his plex server and forget the beta tag, same thing happened. When adding beta tag, roll forward also failed with db errors. Restored backup db and it worked. Plex doesn’t seem to like switching between 1.40.1.xx to 1.40.2.xx, which is the current delta between prod and beta.
This seems to be manifest when 1. intro scans are on and 2. blobs db is significantly large, as its the blobs.db that seems to fail the migrations. Guessing some sort of audio analysis data of intros is held in this blobs db.
Keep in mind that these DB migrations can take a very long time to process, particularly if there is very little RAM available, or some trickery has been attempted, like /tmp folder in RAMdrive etc.