WTH – Github fubar.
one moment.
WTH – Github fubar.
one moment.
OK. I’ll check in the morning. I gotta get some shuteye first’ or will will mess it up. PLUS I gotta look for that Docker command because I’m not sure how that works. Blasting the image to me is restarting from scratch, the entire basis of why I run a Unraid server. So I gotta get it right.
If you know the command I need to use, PM me if you have time.
I’ll let you know asap. Thanks!
here. TARBALL
DBRepair-107.tar (60 KB)
I have an Unraid box (internal SSD only).
I can setup a docker container – where PMS data is stored ELSEWHERE – like a shared folder.
I point the docker configuration spec to look at that shared folder (directory) path.
This is what I put into the Release. ( only 4 assets )
GitHub is messing up.
There is a way to save what you currently have and then IMPORT it back in a new container (which you’ve configured to survive container rebuilds).
I’m trying to make sense of your posts here.
How can GitHub mess up? Are their servers corrupting the data in your source code file?
Also: i usually can simply stop the docker container, hit the Update button, and have the new packages dowloaded, extracted and installed, then restart the docker, all this before someone who was watching a movie runs out of cached data.
So I’m trying to understand: you want me to do a new install of the same docker container, with the same setup as before, but a fresh image download?
And this shouldn’t destroy any of my user data or my db? (I know my media files are intact, but it’s the db i wanna un-corrupt… deleting it would be besides the point)
Help me understand how this works.
Disregard GitHub. They seem to have made a change in how they package the ZIP and tar.gz files. It is annoying because I specify 4 files for the release. They ignore that and clump up the whole thing anyway.
Regarding supporting your Unraid.
– My container spec puts /config out on the array.
Here is version v1.0.7 in the container doing what it should. You should easily be able to get this . I’m using Plexinc/docker but Binhex detection has been fixed with v1.0.7.
# ls
bin data healthcheck.sh installBinary.sh lib64 media opt proc sbin tmp var
boot dev home lib libexec mnt plex-common.sh root srv transcode version.txt
config etc init lib32 libx32 nas plex_service.sh run sys usr
# cd /config
# ls
6997.deb DBRepair.sh Library tmp
# ./DBRepair.sh
Plex Media Server Database Repair Utility (Docker)
Version v1.0.7
Select
1 - 'stop' - Stop PMS
2 - 'automatic' - database check, repair/optimize, and reindex in one step.
3 - 'check' - Perform integrity check of database
4 - 'vacuum' - Remove empty space from database
5 - 'repair' - Repair/Optimize databases
6 - 'reindex' - Rebuild database database indexes
7 - 'start' - Start PMS
8 - 'import' - Import watch history from another database independent of Plex. (risky)
9 - 'replace' - Replace current databases with newest usable backup copy (interactive)
10 - 'show' - Show logfile
11 - 'status' - Report status of PMS (run-state and databases)
12 - 'undo' - Undo last successful command
99 - 'quit' - Quit immediately. Keep all temporary files.
'exit' - Exit with cleanup options.
Enter command # -or- command name (4 char min) : 1
Stopping PMS.
Stopped PMS.
Select
1 - 'stop' - Stop PMS
2 - 'automatic' - database check, repair/optimize, and reindex in one step.
3 - 'check' - Perform integrity check of database
4 - 'vacuum' - Remove empty space from database
5 - 'repair' - Repair/Optimize databases
6 - 'reindex' - Rebuild database database indexes
7 - 'start' - Start PMS
8 - 'import' - Import watch history from another database independent of Plex. (risky)
9 - 'replace' - Replace current databases with newest usable backup copy (interactive)
10 - 'show' - Show logfile
11 - 'status' - Report status of PMS (run-state and databases)
12 - 'undo' - Undo last successful command
99 - 'quit' - Quit immediately. Keep all temporary files.
'exit' - Exit with cleanup options.
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: 2023-06-01_11.00.51
Exporting Main DB
Exporting Blobs DB
Successfully exported the main and blobs databases. Proceeding to import 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-2023-06-01_11.00.51'
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-2023-06-01_11.02.32' timestamp.
Reindexing main database
Reindexing main database successful.
Reindexing blobs database
Reindexing blobs database successful.
Reindex complete.
Automatic Check, Repair/optimize, & Index successful.
Select
1 - 'stop' - Stop PMS
2 - 'automatic' - database check, repair/optimize, and reindex in one step.
3 - 'check' - Perform integrity check of database
4 - 'vacuum' - Remove empty space from database
5 - 'repair' - Repair/Optimize databases
6 - 'reindex' - Rebuild database database indexes
7 - 'start' - Start PMS
8 - 'import' - Import watch history from another database independent of Plex. (risky)
9 - 'replace' - Replace current databases with newest usable backup copy (interactive)
10 - 'show' - Show logfile
11 - 'status' - Report status of PMS (run-state and databases)
12 - 'undo' - Undo last successful command
99 - 'quit' - Quit immediately. Keep all temporary files.
'exit' - Exit with cleanup options.
Enter command # -or- command name (4 char min) :
Right. I do get it. What I didn’t do is relocate the DBRepair.sh files to be DIRECTLY in /config. I can easily remedy that. However, I see YOUR /config contains a “Library” folder. Mine is not in there. Here is the contents of my /config:
sh-5.1# cd /config
sh-5.1# ls
perms.txt PlexDBRepair-1.0.7 supervisord.log supervisord.log.3 tmp
PlexDBRepair-1.0.6 PlexDBRepair-1.0.7.tar.gz supervisord.log.1 supervisord.log.4 transcode
PlexDBRepair-1.0.6.tar.gz 'Plex Media Server' supervisord.log.2 supervisord.log.5
sh-5.1#
Will this all work in my case? I’m pretty sure my “Library” folder is not located within the container’s confines. I’d have to create a separate path for it.
My Plex container is Plexinc. Plexinc containers do have “Library”.
Binhex uses a different structure.
The tool knows this and configures itself appropriately.
Victory.
sh-5.1# ls
bin config etc lib mnt musicvideos proc sbin sys usr
boot dev home lib64 movies opt root srv tmp var
cartoons documentaries homevideos media music pkglist.x86_64.txt run supervisord.pid tvshows version
sh-5.1# cd /config
sh-5.1# ls
DBRepair-107.sh perms.txt supervisord.log supervisord.log.2 supervisord.log.4 tmp
DBRepair-107.tar 'Plex Media Server' supervisord.log.1 supervisord.log.3 supervisord.log.5 transcode
sh-5.1# ./DBRepair.sh
sh: ./DBRepair.sh: No such file or directory
sh-5.1# ./DBRepair-107.sh
Plex Media Server Database Repair Utility (BINHEX)
Version v1.0.7
Select
1 - 'stop' - (Not available. Stop manually)
2 - 'automatic' - database check, repair/optimize, and reindex in one step.
3 - 'check' - Perform integrity check of database
4 - 'vacuum' - Remove empty space from database
5 - 'repair' - Repair/Optimize databases
6 - 'reindex' - Rebuild database database indexes
7 - 'start' - (Not available. Start manually)
8 - 'import' - Import watch history from another database independent of Plex. (risky)
9 - 'replace' - Replace current databases with newest usable backup copy (interactive)
10 - 'show' - Show logfile
11 - 'status' - Report status of PMS (run-state and databases)
12 - 'undo' - Undo last successful command
99 - 'quit' - Quit immediately. Keep all temporary files.
'exit' - Exit with cleanup options.
Enter command # -or- command name (4 char min) :
Yet another thing I was not doing - the bash has to be run from the container’s console.
You are once again my saviour. I shall dedicate a plaque in your name and post it into my neighbor’s oustide wall. He’ll be very happy. As am I.
Thanks a bunch @ChuckPa !
Oops - spoke too soon. Can’t run the tool, the container is running.
And when I shut down the container, the console isn’t running.
What now?
Wasn’t there a command-line to stop the actual server from within the console without stopping the Docker container?
inside the container, you can probably kill -15 the Plex pid.
PMS will shutdown in an orderly manner.
When completed, you exit and then restart the container.
sh-5.1# ps aux | grep plex
nobody 74 0.3 0.2 4770652 84768 ? Sl 11:56 0:35 /usr/lib/plexmediaserver/Plex Media Server
nobody 114 0.0 0.1 64260 43944 ? SNl 11:57 0:09 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-248a2daf0/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.32.2.7100-248a2daf0 /usr/lib/plexmediaserver/Resources/Plug-ins-248a2daf0/System.bundle
nobody 160 0.0 0.0 41504 14832 ? Sl 11:57 0:05 /usr/lib/plexmediaserver/Plex DLNA Server
nobody 161 0.0 0.0 41920 13108 ? Sl 11:57 0:05 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.32.2.7100-248a2daf0 32600
root 4349 0.0 0.0 6580 2552 pts/1 S+ 14:35 0:00 grep plex
sh-5.1# kill -15 74
sh-5.1# cd /config
sh-5.1# ls
DBRepair-107.sh perms.txt supervisord.log supervisord.log.2 supervisord.log.4 tmp
DBRepair-107.tar 'Plex Media Server' supervisord.log.1 supervisord.log.3 supervisord.log.5 transcode
sh-5.1# ./DBRepair-107.sh
Plex Media Server Database Repair Utility (BINHEX)
Version v1.0.7
Select
1 - 'stop' - (Not available. Stop manually)
2 - 'automatic' - database check, repair/optimize, and reindex in one step.
3 - 'check' - Perform integrity check of database
4 - 'vacuum' - Remove empty space from database
5 - 'repair' - Repair/Optimize databases
6 - 'reindex' - Rebuild database database indexes
7 - 'start' - (Not available. Start manually)
8 - 'import' - Import watch history from another database independent of Plex. (risky)
9 - 'replace' - Replace current databases with newest usable backup copy (interactive)
10 - 'show' - Show logfile
11 - 'status' - Report status of PMS (run-state and databases)
12 - 'undo' - Undo last successful command
99 - 'quit' - Quit immediately. Keep all temporary files.
'exit' - Exit with cleanup options.
Enter command # -or- command name (4 char min) : 2
Unable to run automatic sequence. PMS is running. Please stop PlexMediaServer.
oh hold on. it worked. I ran kill -15 74, turns out I had to restart the container, redid the ps aux | grep Plex, and I got the pid 73. I ran kill -15 73, worked fine. Now I am running option 2.,so we’ll see how it goes!
Thanks a million man, you really helped! I have been in cust.service for 22 years - without getting paid for it you helped me really. People like you should get medals and IRS credits.
Any plans on integrating this tool into PMS? This would just be so helpful.
There have been MANY requests to integrate into PMS.
Lots of talk but the amount of work needed to make this tool run BEFORE PMS and only in GUI/Console mode is a pain.
I don’t think they worked that out because it would mean changing the entire PMS startup mechanism
If I could put this in compiled code, with a GUI, it would be a LOT easier.
The return on that level work really isn’t worth it.
Most folks use this in batch / maintenance mode in crontab.
./DBRepair.sh stop auto start exit
Morning, I was able to run this with version 1.0.7 two weeks ago. I updated my os, now both 1.0.7 and 1.0.8 giving me the same error.
mediaserver@mediaserver:~/PlexDBRepair$ ./DBRepair.sh
Error: Unknown host. Current supported hosts are: QNAP, Syno, Netgear, Mac, ASUSTOR, WD (OS5), Linux wkstn/svr
Current supported container images: Plexinc, LinuxServer, HotIO, & BINHEX
Are you trying to run the tool from outside the container environment ?
mediaserver@mediaserver:~/PlexDBRepair$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
Not running on docker.
Jun 17, 2023 13:16:48.545 [139796701707064] Error — [Req#a655c8/Transcode/403442b40c8f279d-com-plexapp-android/62f9bab4-d7b3-4278-8e0b-3b5ecea9b540] [AVHWDeviceContext @ 0x7f709316d640] No matching devices found.
Jun 17, 2023 13:19:12.391 [139798211947320] Warning — Held transaction for too long (/data/jenkins/server/3531215071/Statistics/StatisticsManager.cpp:301): 0.160000 seconds
Jun 17, 2023 13:19:12.444 [139798211947320] Warning — Held transaction for too long (/data/jenkins/server/3531215071/Statistics/StatisticsManager.cpp:304): 0.110000 seconds
Jun 17, 2023 13:19:27.088 [139798035270456] Warning — [Req#a6b9ca] SLOW QUERY: It took 250.000000 ms to retrieve 1 items.
Jun 17, 2023 13:19:37.323 [139797468846904] Warning — [Req#a6c500] SLOW QUERY: It took 220.000000 ms to retrieve 2 items.
Jun 17, 2023 13:19:42.589 [139796722731832] Warning — Held transaction for too long (/data/jenkins/server/3531215071/Statistics/StatisticsManager.cpp:301): 0.520000 seconds
Jun 17, 2023 13:20:08.036 [139797468846904] Warning — [Req#a6e8d4] SLOW QUERY: It took 230.000000 ms to retrieve 1 items.
Jun 17, 2023 13:20:28.502 [139796707838776] Warning — [Req#a6ffda] SLOW QUERY: It took 250.000000 ms to retrieve 1 items.
Jun 17, 2023 13:20:38.777 [139796707838776] Warning — [Req#a70b68] SLOW QUERY: It took 260.000000 ms to retrieve 1 items.
Jun 17, 2023 13:22:31.416 [139797506394936] Warning — [Req#a77a5a] SLOW QUERY: It took 240.000000 ms to retrieve 1 items.
Jun 17, 2023 13:23:02.145 [139797506394936] Warning — [Req#a796fe] SLOW QUERY: It took 350.000000 ms to retrieve 1 items.
Jun 17, 2023 13:23:17.498 [139797468846904] Warning — [Req#a7a5b1] SLOW QUERY: It took 340.000000 ms to retrieve 1 items.
Jun 17, 2023 13:24:44.560 [139796701707064] Warning — [Req#a7f880] SLOW QUERY: It took 330.000000 ms to retrieve 1 items.
Jun 17, 2023 13:25:43.019 [139796707838776] Warning — [Req#a837e7] Missing X-Plex-Container-Size header. This will fail with status code 400 in the future.
Jun 17, 2023 13:25:44.624 [139796701707064] Warning — [Req#a8382d] Missing X-Plex-Container-Size header. This will fail with status code 400 in the future.
Jun 17, 2023 13:25:45.432 [139797468846904] Warning — [Req#a83846] Missing X-Plex-Container-Size header. This will fail with status code 400 in the future.
Jun 17, 2023 13:25:46.217 [139796701707064] Warning — [Req#a83a74] Missing X-Plex-Container-Size header. This will fail with status code 400 in the future.
Jun 17, 2023 13:26:07.628 [139797492091704] Warning — [Req#a8538e/Transcode] Got a request to stop a transcode session without a valid session GUID.
Jun 17, 2023 13:27:19.441 [139796701707064] Error — [Req#a8bf67/MetadataAgent/tv.plex.agents.series] Missing parameters for match request.
Jun 17, 2023 13:27:45.086 [139797492091704] Error — [Req#a8c37d/MetadataAgent/tv.plex.agents.series] Missing parameters for match request.
Jun 17, 2023 13:27:45.095 [139798218476344] Error — [Req#a8c390/MetadataAgent/tv.plex.agents.series] Missing parameters for match request.
Jun 17, 2023 13:27:45.100 [139798226623288] Error — [Req#a8c3a3/MetadataAgent/tv.plex.agents.series] Missing parameters for match request.
Jun 17, 2023 13:27:45.726 [139797492091704] Error — [Req#a8c3b6/MetadataAgent/tv.plex.agents.series] Missing parameters for match request.
Jun 17, 2023 13:27:45.735 [139798218476344] Error — [Req#a8c3c9/MetadataAgent/tv.plex.agents.series] Missing parameters for match request.
i am trying to fix these errors.
@ChuckPa Should I create a different post, or is it ok here?
MUST run as ROOT user. You’re running as your UID.
mediaserver@mediaserver:~/PlexDBRepair$ ./DBRepair.sh
Those “errors” are slow query from a fragmented DB or overloaded host.
You can always do a first-level optimization with PMS running then Shutdown PMS followed by startup.
I tried this too @ChuckPa
root@mediaserver:/home/mediaserver/PlexDBRepair# ./DBRepair.sh
Error: Unknown host. Current supported hosts are: QNAP, Syno, Netgear, Mac, ASUSTOR, WD (OS5), Linux wkstn/svr
Current supported container images: Plexinc, LinuxServer, HotIO, & BINHEX
Are you trying to run the tool from outside the container environment ?
root@mediaserver:/home/mediaserver/PlexDBRepair# ./DBRepair.sh
Error: Unknown host. Current supported hosts are: QNAP, Syno, Netgear, Mac, ASUSTOR, WD (OS5), Linux wkstn/svr
Current supported container images: Plexinc, LinuxServer, HotIO, & BINHEX
Are you trying to run the tool from outside the container environment ?
root@mediaserver:/home/mediaserver/PlexDBRepair#```