Great to see this as an addition, but, because I have modified the pragma_cache due to recommendations in other threads to do slow/underperforming database (old post, I am now unable to update/upgrade one of my instance.
At first I thought it was due to a DB corruption, so I performed the steps outlined here and here:
root@dionysus:~/Library/Application Support/Plex Media Server/Plug-in Support/Databases# /usr/lib/plexmediaserver/Plex\ SQLite
SQLite version 3.35.5 2021-04-19 18:32:05
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .quit
root@dionysus:~/Library/Application Support/Plex Media Server/Plug-in Support/Databases# /usr/lib/plexmediaserver/Plex\ SQLite com.plexapp.
com.plexapp.dlna.db com.plexapp.plugins.library.db-2022-12-30
com.plexapp.dlna.db-shm com.plexapp.plugins.library.db-2023-01-02
com.plexapp.dlna.db-wal com.plexapp.plugins.library.db-2023-01-05
com.plexapp.plugins.library.blobs.db com.plexapp.plugins.library.db-shm
com.plexapp.plugins.library.blobs.db-2022-12-27 com.plexapp.plugins.library.db-wal
com.plexapp.plugins.library.blobs.db-2022-12-30 com.plexapp.plugins.library.db.backup
com.plexapp.plugins.library.blobs.db-2023-01-02 com.plexapp.plugins.library.db.db-recovery
com.plexapp.plugins.library.blobs.db-2023-01-05 com.plexapp.plugins.library.db.original
com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original-shm
com.plexapp.plugins.library.db-2022-12-27 com.plexapp.plugins.library.db.original-wal
root@dionysus:~/Library/Application Support/Plex Media Server/Plug-in Support/Databases# /usr/lib/plexmediaserver/Plex\ SQLite com.plexapp.plugins.library.db
SQLite version 3.35.5 2021-04-19 18:32:05
Enter ".help" for usage hints.
sqlite> PRAGMA integrity_check;
ok
sqlite> VACUUM;
sqlite> REINDEX;
sqlite> .output db-recover.sqlite
sqlite> .recover
sqlite> .quit
root@dionysus:~/Library/Application Support/Plex Media Server/Plug-in Support/Databases# mv com.plexapp.plugins.library.db com.plexapp.plugins.library.db.db-recovery-2
root@dionysus:~/Library/Application Support/Plex Media Server/Plug-in Support/Databases# /usr/lib/plexmediaserver/Plex\ SQLite com.plexapp.plugins.library.db
SQLite version 3.35.5 2021-04-19 18:32:05
Enter ".help" for usage hints.
sqlite> .read db-recover.sqlite
sqlite> .quit
root@dionysus:~/Library/Application Support/Plex Media Server/Plug-in Support/Databases# cd /var/run/s6/services/
root@dionysus:/var/run/s6/services# s6-svc -u plex
root@dionysus:/var/run/s6/services# exit
exit
$ docker logs -f dionysus
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 40-plex-first-run: executing...
Plex Media Server first run setup complete
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: executing...
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: exited 0.
[cont-init.d] 50-plex-update: executing...
Attempting to upgrade to: 1.30.1.6497-5fc2e0894
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 190 0 190 0 0 414 0 --:--:-- --:--:-- --:--:-- 413
100 81.6M 100 81.6M 0 0 43.8M 0 0:00:01 0:00:01 --:--:-- 65.6M
Selecting previously unselected package plexmediaserver.
(Reading database ... 7274 files and directories currently installed.)
Preparing to unpack /tmp/plexmediaserver.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Custom environment detected. Skipping preinstallation validation.
Unpacking plexmediaserver (1.30.1.6497-5fc2e0894) ...
Setting up plexmediaserver (1.30.1.6497-5fc2e0894) ...
PlexMediaServer install: Custom environment detected. Skipping postinstallation tasks. Continuing.
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting Plex Media Server.
[services.d] done.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
However, then I realized the two things that were probably causing this:
Attempting to upgrade to: 1.30.1.6497-5fc2e0894
Database Cache Size (MB)
So now even after trying to roll back the database to older versions, I am stuck unable to perform the upgrade for a pragma change that has been working for 2 years.
Is there a fix for this rather than rebuilding libraries?
EDIT: If I run your script @ChuckPa I get the following output:
root@dionysus:~# sh DBRepair.sh
Plex Media Server Database Repair Utility (Docker)
Select
1. Check database
2. Vacuum database
3. Reindex database
4. Attempt database repair
5. Replace current database with newest usable backup copy
6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
7. Import Viewstate / Watch history from another PMS database
8. Show logfile
9. Exit
Enter choice: 1
Checking the PMS databases
Check complete. PMS main database is OK.
Error: file is not a database
Check complete. PMS blobs database is damaged.
Plex Media Server Database Repair Utility (Docker)
Select
1. Check database
2. Vacuum database
3. Reindex database
4. Attempt database repair
5. Replace current database with newest usable backup copy
6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
7. Import Viewstate / Watch history from another PMS database
8. Show logfile
9. Exit
Enter choice: 4
Exporting current databases using timestamp: 2023-01-08_10.03.51
Export: (main)..(blobs)..done.
Successfully exported the main and blobs databases. Proceeding to import into new databases.
Import: (main)..(blobs)..done.
Successfully imported data from exported SQL files.
Verifying databases integrity after importing.
Verification complete. PMS main database is OK.
Verification complete. PMS blobs database is OK.
Saving current databases with '-ORIG-2023-01-08_10.03.51'
Making imported databases active
Import complete. Please check your library settings and contents for completeness.
Recommend: Scan Files and Refresh all metadata for each library section.
Plex Media Server Database Repair Utility (Docker)
Select
1. Check database
2. Vacuum database
3. Reindex database
4. Attempt database repair
5. Replace current database with newest usable backup copy
6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
7. Import Viewstate / Watch history from another PMS database
8. Show logfile
9. Exit
Enter choice: 3
Backing up of databases
Backup current databases with '-ORIG-2023-01-08_10.04.30' timestamp.
Reindexing main database
Reindexing main database successful.
Reindexing blobs database
Reindexing blobs database successful.
Reindex complete.
Plex Media Server Database Repair Utility (Docker)
Select
1. Check database
2. Vacuum database
3. Reindex database
4. Attempt database repair
5. Replace current database with newest usable backup copy
6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
7. Import Viewstate / Watch history from another PMS database
8. Show logfile
9. Exit
Enter choice: 9
Ok to remove temporary databases/workfiles for this session? (Y/N) ? y
Are you sure (Y/N) ? n
Retaining all temporary work files.
root@dionysus:~# cd /var/run/s6/services/
root@dionysus:/var/run/s6/services# s6-svc -u plex
root@dionysus:/var/run/s6/services# exit
exit
andrew@nas:/mnt/cache/docker/dionysus/Library/Application Support/Plex Media Server/Plug-in Support/Databases$ docker logs -f dionysus
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 40-plex-first-run: executing...
Plex Media Server first run setup complete
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: executing...
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: exited 0.
[cont-init.d] 50-plex-update: executing...
Attempting to upgrade to: 1.30.1.6497-5fc2e0894
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 190 0 190 0 0 414 0 --:--:-- --:--:-- --:--:-- 413
100 81.6M 100 81.6M 0 0 43.8M 0 0:00:01 0:00:01 --:--:-- 65.6M
Selecting previously unselected package plexmediaserver.
(Reading database ... 7274 files and directories currently installed.)
Preparing to unpack /tmp/plexmediaserver.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Custom environment detected. Skipping preinstallation validation.
Unpacking plexmediaserver (1.30.1.6497-5fc2e0894) ...
Setting up plexmediaserver (1.30.1.6497-5fc2e0894) ...
PlexMediaServer install: Custom environment detected. Skipping postinstallation tasks. Continuing.
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting Plex Media Server.
[services.d] done.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
^C
andrew@nas:/mnt/cache/docker/dionysus/Library/Application Support/Plex Media Server/Plug-in Support/Databases$ docker restart dionysus
dionysus
andrew@nas:/mnt/cache/docker/dionysus/Library/Application Support/Plex Media Server/Plug-in Support/Databases$ docker logs -f dionysus
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 40-plex-first-run: executing...
Plex Media Server first run setup complete
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: executing...
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: exited 0.
[cont-init.d] 50-plex-update: executing...
Attempting to upgrade to: 1.30.1.6497-5fc2e0894
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 190 0 190 0 0 414 0 --:--:-- --:--:-- --:--:-- 413
100 81.6M 100 81.6M 0 0 43.8M 0 0:00:01 0:00:01 --:--:-- 65.6M
Selecting previously unselected package plexmediaserver.
(Reading database ... 7274 files and directories currently installed.)
Preparing to unpack /tmp/plexmediaserver.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Custom environment detected. Skipping preinstallation validation.
Unpacking plexmediaserver (1.30.1.6497-5fc2e0894) ...
Setting up plexmediaserver (1.30.1.6497-5fc2e0894) ...
PlexMediaServer install: Custom environment detected. Skipping postinstallation tasks. Continuing.
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting Plex Media Server.
[services.d] done.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::prepare: file is not a database for SQL: PRAGMA cache_size=1 (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 40-plex-first-run: executing...
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: executing...
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: exited 0.
[cont-init.d] 50-plex-update: executing...
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] done.
[services.d] starting services
Starting Plex Media Server.
[services.d] done.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Starting Plex Media Server.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
^C
andrew@nas:/mnt/cache/docker/dionysus/Library/Application Support/Plex Media Server/Plug-in Support/Databases$ docker exec -it dionysus bash
root@dionysus:/# cd /var/
backups/ cache/ lib/ local/ lock/ log/ mail/ opt/ run/ spool/ tmp/
root@dionysus:/# cd /var/
backups/ cache/ lib/ local/ lock/ log/ mail/ opt/ run/ spool/ tmp/
root@dionysus:/# cd /var/run/s6/services/
root@dionysus:/var/run/s6/services# s6-svc -d plex
root@dionysus:/var/run/s6/services# sh DBRepair.sh
sh: 0: Can't open DBRepair.sh
root@dionysus:/var/run/s6/services# s6-svc -d plex^C
root@dionysus:/var/run/s6/services# cd /config/
root@dionysus:~# sh DBRepair.sh
Plex Media Server Database Repair Utility (Docker)
Select
1. Check database
2. Vacuum database
3. Reindex database
4. Attempt database repair
5. Replace current database with newest usable backup copy
6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
7. Import Viewstate / Watch history from another PMS database
8. Show logfile
9. Exit
Enter choice: 1
Checking the PMS databases
Check complete. PMS main database is OK.
Check complete. PMS blobs database is OK.
Plex Media Server Database Repair Utility (Docker)
Select
1. Check database
2. Vacuum database
3. Reindex database
4. Attempt database repair
5. Replace current database with newest usable backup copy
6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
7. Import Viewstate / Watch history from another PMS database
8. Show logfile
9. Exit
Enter choice: 2
Backing up databases
Backup current databases with '-ORIG-2023-01-08_10.06.06' timestamp.
Vacuuming main database
Vacuuming main database successful (Size: 279MB/279MB).
Vacuuming blobs database
Vacuuming blobs database successful (Size: 1MB/1MB).
Vacuum complete.
Plex Media Server Database Repair Utility (Docker)
Select
1. Check database
2. Vacuum database
3. Reindex database
4. Attempt database repair
5. Replace current database with newest usable backup copy
6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
7. Import Viewstate / Watch history from another PMS database
8. Show logfile
9. Exit
Enter choice: 3
Backing up of databases
Backup current databases with '-ORIG-2023-01-08_10.06.11' timestamp.
Reindexing main database
Reindexing main database successful.
Reindexing blobs database
Reindexing blobs database successful.
Reindex complete.
Plex Media Server Database Repair Utility (Docker)
Select
1. Check database
2. Vacuum database
3. Reindex database
4. Attempt database repair
5. Replace current database with newest usable backup copy
6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
7. Import Viewstate / Watch history from another PMS database
8. Show logfile
9. Exit
Enter choice: 4
Exporting current databases using timestamp: 2023-01-08_10.06.17
Export: (main)..(blobs)..done.
Successfully exported the main and blobs databases. Proceeding to import into new databases.
Import: (main)..(blobs)..done.
Successfully imported data from exported SQL files.
Verifying databases integrity after importing.
Verification complete. PMS main database is OK.
Verification complete. PMS blobs database is OK.
Saving current databases with '-ORIG-2023-01-08_10.06.17'
Making imported databases active
Import complete. Please check your library settings and contents for completeness.
Recommend: Scan Files and Refresh all metadata for each library section.
Plex Media Server Database Repair Utility (Docker)
Select
1. Check database
2. Vacuum database
3. Reindex database
4. Attempt database repair
5. Replace current database with newest usable backup copy
6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
7. Import Viewstate / Watch history from another PMS database
8. Show logfile
9. Exit
Enter choice: 1
Checking the PMS databases
Check complete. PMS main database is OK.
Check complete. PMS blobs database is OK.
Seems like even with the DB repair, the DB is stuck in readonly mode.
[services.d] done.
Error: Unable to set up server: sqlite3_statement_backend::loadOne: attempt to write a readonly database (N4soci10soci_errorE)
Stopping Plex Media Server.