Server Version#: 1.18.2.2058-e67a4e892
Player Version#: N/A
I have Plex server running on a Terra Master F5-221, and last night discovered the database(s) are corrupt and new media won’t scan and add to my library. I found this thread that describes how to find the database and how to restore a backup by renaming the current databases, but when I ssh in as admin I don’t have permission to modify those files, presumably because the user that owns them is ‘plex’. I can’t find anything about how to go about restoring a backup otherwise, and am now stuck on even restarting the Plex server. TNAS OS shows it’s running, and indeed there’s a process running from /usr/local/lib/plexmediaserver/Plex Media Server, but my client and the web interface won’t connect to it. How do I
I’ve been having the same issue with my F4-220…corrupt database & new media won’t scan.
I’ve tried a few things, increasing in ‘impact’ at each attempt…
I logged a support call with terramaster & they tried to repair the database (they require a remote login or Teamviewer session), but were unsuccessful - but I would suggest giving them a go as its the least hassle option if the repair works, or they could try renaming the files for you (I’ve not used Linux for a whlle, but you could try changing the files owner to admin, do the changes, then change owner back to plex?)
I then went on to try the ‘delete database files’ so PMS would create a new database - after uploading a few new libraries, the corrupt messages were starting to appear again.
I then tried a ‘factory reset’ with existing configuration (save the status before the reset, and reload after re-installing the TOS) - and gremlins were still at play.
I’ve now gone for the full ‘factory reset and start from scratch’ - the library initially scanned in ok, but then I couldnt get ‘new additions’ to register - I’ve now given Read/Write ‘permission’ to ‘User Plex’ for the media folders (although I wasn’t required to do this on my previous set-ups, so possibly an update has removed an auto-configuration???) and it seems to be working ok - although I’m still re-uploading the media libraries so its early days…
Update -
I created Libraries one at a time (eg Movies, 3D Movies, etc) over the last few days - allowing each to populate, then optimize after each upload. All seemed well until this morning when I finally got around to creating the Music Library. Left it do what it does for a few hours, and when coming back to it, Console was reporting a shed load of corrupt database notices. I allowed it to complete the cycle, but there was a lot of missing folders (set by artist -> album) and was unable to view ANY library on Client (Blank screen, message directing me to the forums!). I’ve tried rolling back the database to the backup created yesterday…and all seems ok (successfully re-scanned to get today’s media populated too), but will test later when trying playback on TV’s, etc.
Set up -
F4-220 (all media) via network switch
Windows 10 PC with Chrome bowser to access TNAS & Plex
Stopping Plex
On TNAS, I used “Applications” -> “Installed” -> “Manage”
then just select ‘Plex’ line and appropriate action
To modify files -
On TNAS, I used “File manager” and navigated to the Plex database folder.
Followed the instructions detailed here -
Restart PMS on TNAS (similar process to Stopping)
This took quite a while to process (over an hour, I think)…but I’ve been able to access the media via Client (chrome browser) and recan for the additional files I uploaded after the databse backup was created yesterday (and without the Music files I tried to upload today - I won’t bother trying again either).
I have not had to play with file permissions or ownership - although I have already granted “user ‘Plex’” read/write permission to the media folders (some users have commented to make sure ‘Plex’ has file ownership in Linux)
The problem I’m having is that the database is stored outside of the public folder, which I can only view by SSHing to the NAS, and then do not have permission to modify those files. File manager won’t go further out than the public folder. So while I know that the process of restoring a backup of the database will work for me, the NAS prevents me from doing so. I think I’m going to replace it with a different manufacturer. From your description, this is going to continue to happen even if I figure out a means of restoring the backup.
How I access the files in “File Manager” -
Left hand pane has “Admin”, “Public” and other root folders (Music, Video, etc). - single click on “Admin” which changes the navigation (top) bar to “Volume>User>Admin>Home”
In the Nav bar Click on “User” which brings up “Admin” and “Plex” in the main pane…Then just double-click on folders to navigate to the Plex files…
(Files shown are my backups from the other days Faffing)
I know how frustrating these things are when your set up may not be the same as someone elses and you’re trying to crack an issue, you have my full sympathy - but don’t bin the TNAS just yet (a quick look on the other forums shows that all is not rosey with other NAS’s!)
(also ping TM support an email requesting assistance…they’re pretty good at responding and will give ‘live’ support (just be mindful of the China timezone) -
That worked. I’ve got it restored, less the poster and cover images, but those were re-scanned and downloaded. I’ll have to see about setting up an automated backup of the database so I can restore the last good instance if it happens again. Thanks!
Great solution @Amphy!
Also, If you can’t find the DB in the admin user, many other TerraMaster NAS devices store the file in the directory as shown in the attached picture