Plex DB repair tool not able to run on DSM 7

Server Version#: 4.87.2
Player Version#: Not applicable

So I started getting a lot of random videos added to Plex when adding new films. The videos have no details and cannot be deleted (I would attach a screen shot but I don’t have permissions to add). So I thought I might be getting some corruption in PMS DB, which has happened before due to an SSD cache I bought from Synology that kept corrupting the database (which were new and Synology didn’t stand behind by the way so I had to throw out 800GB SSD drives).

I have a task scheduled to run once a week to use ChuckPA’s Plex DB consistency check tool. Turns out is has been failing and never actually ran properly. I don’t know why. Below is the command I’m using in the DSM scheduled task

‘bash-4.4# /var/packages/PlexMediaServer/shares/PlexMediaServer/DBRepair.sh stop auto start exit’

So I tried to SSH in and my password (correct password) is rejected. I assume it is because I have 2FA set up and there is no way to use 2FA when logging on via a Mac using Terminal.

So I have 2 questions:

  1. Is there any way of using SSH with 2FA or do I need to turn it off and set up again every time I want to SSH into the NAS?

  2. Is there something wrong in the script for the scheduled task?

Thanks in advance.

Brian

You’re not including the bash-4.4# part of the command in your scheduled task, are you? If that’s present in your scheduled task’s user-defined script, remove it.

I am. I’ll remove it and schedule it to run now and see if it works.

4.87.2 is the Plex Web version.

Plex Media Server version is displayed in Settings → Server_Name → General.

Look at the Plex Media Info for one of the random videos. It will show the file location.

Then verify the folders added to the library. Make sure only the desired locations are being scanned.

Cool. Also, if those single quotes are part of the command, they should likely be removed as well. Or at least moved, such that the final command is:

/var/packages/PlexMediaServer/shares/PlexMediaServer/DBRepair.sh stop auto start exit
Or:
'/var/packages/PlexMediaServer/shares/PlexMediaServer/DBRepair.sh' stop auto start exit

That’s what I mean when I say “the videos have no details”. When you try to look at the file properties, they don’t exist and cannot be deleted.

No, the apostrophes is not included in the script.

Plex server version on DSM is 1.29.2.6364-7000

It completed correctly. Thanks for sorting that out.

You’re welcome, glad you got it working!

For future reference,

  1. As stated on the GitHub README.md, you can place the tool anywhere.
  2. The recommended location (at the top of the Plex or PlexMediaServer) shared folder is to make it easy to access without use of quotes. (e.g. /volume1/PlexMediaServer/DBRepair.sh)
  3. The tool detects the host it’s on and figures out all the paths so it doesn’t matter where you launch it from.

That’s where I have it hosted. Looks like the DB is healthy, so I have no idea why I’m getting all these temporary files. At times there is in excess of 1,00 of these files which have thumbnails of videos in other Plex library folders, as well as in Films. However, the temporary files only show in recently added Films.

Can you show a screenshot of the “Add folders” tab of the library or libraries where these unwanted thumbnails are appearing? Something similar to this:

It should not include any paths other than where your media is stored (no metadata paths).

Make sure you have not added /volume1/PlexMediaServer to a library.

In addition, there should not be any media in /volume1/PlexMediaServer.

As I mentioned in the original post, I don’t have permissions to upload attachments. Was the same issue last time I posted an topic 3 months ago. I assume I need to be some super-subscriber or have more posts on the forum in order to upload files.

Sorry, missed that part of your post. The main thing I wanted to confirm was that you only had media paths in your “Add folders” configuration, and that there was not metadata being stored in the included paths (much as @FordGuy61 suggested). What you’re describing is a common symptom of one or both of those being done.

If you’d like you could post an image to a service like imgur and link it here, or just check the above.

That might be it. It seems like all of Volume1 was in the library. I don’t recall doing that, but I’ve added JUST the films folder and removed the previous one. I will now go ahead and add some films and see if I can still reproduce the issue.

  • Scan the library.
  • Empty Trash.
  • Clean Bundles.

That should remove the all the strange files from the library.

Wouldn’t hurt to run the DBRepair again once everything is configured OK.

I’ll work on it this afternoon and report back. Appreciate the screen shots.

How come you can add screen shots and I can’t?

Which temp files? Where are they showing up?

Do you have Intro or Credit detection enabled? (they are by default)