DSM 7
I went looking for answers to your question and I discovered that Chuck’s instructions actually want the DBRepair.sh file in the Plex (DSM6) or PlexMediaServer (DSM7) folder.
That’s my bad I’m afraid, I am always weary of placing foreign files in the Plex (DSM6) or PlexMediaServer (DSM7) folders, those folders are usually reserved for Plex use only.
Also, given the error message you received, running DBRepair from it’s current location forces it to look for a Docker container of some description, which is why it spat out the errors, it could not find a Docker container.
I’m sure Chuck will whack my knuckles if I’m wrong … lol
Sorry to be a bit slow on this, but I was really after the code I need to type in to run DBRepair programme. I realise I may have recently been told this, but am a little confused.
I followed the procedure to reset/reclaim PMS on DSM7 on Synology FAQ - Questions, Answers, and How-To's - #39 by ChuckPa and after deleting some old unused Authorised Devices, access to my media is definitely better. Do/should I still run DBRepair, or will Plex now ‘take care of itself’?
To run the DBRepair.sh file, make sure you cd to the Plex/PlexMediaServer folder, where the file is stored, then type in:
./DBRepair.sh
Running the DBRepair cannot hurt anything and it may actually improve things, fingers crossed.
You can read all the instructions and info about DBRepair here: DBRepair - ChuckPa
I thought I’d posted the following-
In Terminal, running ./DBRepair.sh , I got the following output:
grep: /proc/1/cgroup: No such file or directory
grep: /proc/1/cgroup: No such file or directory
grep: /proc/1/cgroup: No such file or directory
grep: /proc/1/cgroup: No such file or directory
Error: Unknown host. Current supported hosts are: QNAP, Syno, Netgear, Mac, ASUSTOR, WD (OS5), Linux wkstn/svr, SNAP, FreeBSD 14+
Current supported container images: Plexinc, LinuxServer, HotIO, & BINHEX
Manual host configuration is available in most use cases.
Are you trying to run the tool from outside the container environment? Manual mode is available. Please see documentation.
I understand I may need Docker or similar, but this is outside my understanding, despite your helpful web page..
No, you do NOT need Docker. Docker is an alternative way of setting up your PMS server on the NAS.
You need to place the DBRepair.sh file inside the Plex or PlexMediaServer folder before you run it.
This is why I stated: make sure you cd to the Plex/PlexMediaServer folder.
If you are unsure of any of the instructions you have been given, then scroll up the page in the forum and read them again.
Are you SSHed in to the Synology when you’re running the DBRepair script? The script has to be run from the device running PMS, not your local Mac.
Er, I don’t think so. Terminal tells me that “The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.” Do I need to run that, or am I barking up the wrong tree, regarding SSH?
On a search, it seems I have three copies of Plex Media Server, none of them are located on my NAS. The oldest one, with the creation date of 1 January 1970 (which I know is a bogus date) lives in my Applications folder. The second one lives on an external hard drive and has the date modified of 16 November 2024. The third one is not able to be opened, as its is damaged. But it has the most recent date of 12 May 2025.
I think there’s a bit of a mess going on here…
So I am confused. Do you not have the Synology Plex Media Server package installed on your NAS? If it isn’t running on your NAS then this should be tagged as a Mac server issue, not a Synology server issue, and the whole thing has been a wild goose chase.
I am definitely in the NAS>PlexMediaServer folder, where DBRepair.sh lives. So I am not sure what to do next. I will go over the documentation again
From Terminal:
baward$ ./DBRepair.sh
grep: /proc/1/cgroup: No such file or directory
grep: /proc/1/cgroup: No such file or directory
grep: /proc/1/cgroup: No such file or directory
grep: /proc/1/cgroup: No such file or directory
Error: Unknown host. Current supported hosts are: QNAP, Syno, Netgear, Mac, ASUSTOR, WD (OS5), Linux wkstn/svr, SNAP, FreeBSD 14+
Current supported container images: Plexinc, LinuxServer, HotIO, & BINHEX
Manual host configuration is available in most use cases.
Are you trying to run the tool from outside the container environment? Manual mode is available. Please see documentation.
Mac-mini:PlexMediaServer baward$ ls
ここにメディアファイルを置かないでください。
请不要在此处放置任何媒体文件。
AppData
BR0II5~S
DBRepair.sh
PFITJG~J
PZ4KAG~W
VEQ75K~Q
Yes, I definitely have PMS installed on my NAS, and that’s where TV/Films etc. are meant to be served from.
I’ll still like to be able to run DBRepair. I don’t seem to be able to run it from within the PlexMediaServer folder even though Terminal tells me that’s where I currently am), it’s all a bit beyond me so I might give up. But I’ll keep trying…
You must SSH into your NAS before you can run DBRepair.sh.
In Mac terminal, type in the following:
ssh YourAdminUser@NAS-IP-Address -p 24
Then enter YourAdminUser’s password
sudo -su root
cd /volume1/PlexMediaServer
chmod +x DBRepair.sh
./DBRepair.sh
Press Enter at the end of each of the above lines.
Note: YourAdminUser is the user on your NAS that has admin privileges. Don’t use the default Admin user account on the NAS.
Note: use -p xx if you changed the default port number in DSM Control Panel > Terminal & SNMP. Don’t use -p xx if you have not changed the port number.
Note: After you enter sudo -su root, the screen prompt will change, that is normal.
Note: After you run DBRepair.sh, follow the onscreen prompts.
I tried this but unfortunately had my connection refused. I am still persisting, though. I have asked Synology support to confirm what is the “user on your NAS that has admin privileges” named.
I am still using the IP address of 192.168.178.35 .
Thank you.
Did you specify the port? In this post you were able to connect: Terrible performance - #50 by bward149
Thank you. This time I didn’t, no. I was slightly confused by trumpy81’s comment “use -p xx if you changed the default port number in DSM Control Panel > Terminal & SNMP.“ which I idly read as “use -p xx if you didn’t change” etc.
I am now ‘in’ as it were (green cursor), and later on I will complete the rest of trumpy81’s instructions.
Progress! I am into DBRepair.sh, I believe. The last line of the Terminal window is:
Enter command # -or- command name (4 char min) :
One question; do I use quote marks when entering a command? (I didn’t want to break anything as I realise this is a bit off a potentially dangerous area for someone not greatly experience with Terminal.) I tried AUTO and ‘automatic’ but just seemed the have got back where I started.
No.
Use stop, auto, start, exit.
With auto, you’ll see info about checking, exporting, importing, etc. if it completes without errors, then you can start and exit.
Exit provides an option to delete backup files. If no errors in earlier steps, then OK to delete them.
At last, I have run the routine. Here’s the output (mildly edited for this post, to remove spaces in the text) so it seems to have run perfectly:
“ Enter command # -or- command name (4 char min) : auto
Automatic Check,Repair,Index started.
Checking the PMS databases
Check complete. PMS main database is OK.
Check complete. PMS blobs database is OK.
Exporting current databases using timestamp: 2025-09-19_17.23.55
Exporting Main DB
Exporting Blobs DB
Successfully exported the main and blobs databases.
Start importing into new databases.
Importing Main DB.
Importing Blobs DB.
Successfully imported databases.
Verifying databases integrity after importing.
Verification complete. PMS main database is OK.
Verification complete. PMS blobs database is OK.
Saving current databases with ‘-BACKUP-2025-09-19_17.23.55’
Making repaired databases active
Repair complete. Please check your library settings and contents for completeness.
Recommend: Scan Files and Refresh all metadata for each library section.
Backing up of databases
Backup current databases with ‘-BACKUP-2025-09-19_17.27.10’ timestamp.
Reindexing main database
Reindexing main database successful.
Reindexing blobs database
Reindexing blobs database successful.
Reindex complete.
Automatic Check, Repair/optimize, & Index successful. “
When you say “Recommend: Scan Files and Refresh all metadata” - I take it you mean in Plex web?
Now that it’s complete, your Github webpage will make a whole lot more sense, when I review it shortly.
Again, thanks very much for all your assistance and for providing DBRepair. I’m going away to check on the behaviour of Plex on my Smart TV(s)/Amazon Fire(s)
Correct.
For future reference, you can place all those options on the command line instead of using the menus: ./DBRepair stop auto start exit
.
Note that exit
on the command line assumes a “yes” answer to “do you want to delete…” and deletes the temp/working files automatically.
Duly noted.
But I’ve now run into a new problem which means all my media is inaccessible. It’s because the server won’t stay running. It keeps on stopping itself, a few seconds after pressing ‘run’ in PMS in DSM. I had entered ‘start’ and ‘exit’ after my earlier adventures (above)