New install in TrueNAS jail. plexmediaserver service unable to start

Server Version#: 1.41.3.9314
Player Version#: N/A
Free BSD 13.4
Struggling to install plexmediaserver on my TrueNAS server.

First tried using the built-in plugin. but it’s not working at all.

Then created manually a jail. installed plexmediaserver and setup the necessary for the service to start automatically.

Service closing shortly after starting. Here are the warning/errors in the log file:

Feb 08, 2025 07:48:55.875 [0x806c12000] WARN - Failed to create temp dir “/tmp/pms-22708cdd-aa23-48c2-8c0e-b805ae3b57e2”: 13, Permission denied
Feb 08, 2025 07:48:55.876 [0x806c12000] ERROR - Unable to open named mutex 9334581e-7251-4ef7-a8ec-5bfe8e89ff68 with option 1: Permission denied

Feb 08, 2025 07:48:55.936 [0x806c12000] INFO - Analyzing database.
Feb 08, 2025 07:48:55.937 [0x806c12000] INFO - Vacuuming database.
Feb 08, 2025 07:48:55.937 [0x806c12000] ERROR - SQLITE3:0x10, 6410, statement aborts at 5: [CREATE TABLE “media_parts” (“id” INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, “media_item_id” integer, “directory_id” integer, “hash” varchar(255), “open_subtitle_hash” varchar(255), “file” varchar(255), “index” integer, “size” integer(8), “duration” integer, “created_at” dt_integer(8), “updated_at” dt_integer(8), “deleted_at” dt_integer(8), “extra_data” varchar(255))] disk I/O error
Feb 08, 2025 07:48:55.937 [0x806c12000] ERROR - SQLITE3:0x10, 10, statement aborts at 1: [VACUUM] disk I/O error
Feb 08, 2025 07:48:55.939 [0x806c12000] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::loadOne: disk I/O error
Feb 08, 2025 07:48:55.939 [0x806c12000] ERROR - Database corruption: sqlite3_statement_backend::loadOne: disk I/O error
–end–

did a database integrity check in SQLite on this db
“/usr/local/share/plexmediaserver/Plex SQLite” “/usr/local/plexdata/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db”

and it returned OK.

Im out of idea on what to check to resolve this issue. Any help or idea would be appreciated.

Means you have a corrupt database, regardless of what your pragma check says.

I would start with GitHub - ChuckPa/PlexDBRepair: Database repair utility for Plex Media Server databases then we can see what other issues you have.

Strange that the DB would already be corrupted right after plexmediaserver installation. But, like you said, the error pretty much say that. This is a totally new clean jail running in TrueNAS. First and only thing I did in it was to install plexmediaserver and configure it to start at bootup. No movies/music/etc… in library yet.

I have download Plex DB Repair but it does not support my host. FreeBSD 13.4 running in a TrueNAS jail
When I run the DBRepair.sh script I Get this message:
root@manualPlex:~/PlexDBRepair # ./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
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.

However, I can run it using manual host configuration with the following command:
./DBRepair.sh --sqlite [SQLitePath] --databases [PlexDBPath]

But when I search for plex db file (com.plexapp.plugins.library.db) it finds 2 occurences:

root@manualPlex:~/PlexDBRepair # find / -name “com.plexapp.plugins.library.db”
/usr/local/plexdata/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
/usr/local/share/plexmediaserver/Resources/com.plexapp.plugins.library.db

Do you know which on I should use DBRepair.sh on?

Thanks!

is the normal path

Here what I get when I attempt a repair using the script:

Enter command # -or- command name (4 char min) : 5

./DBRepair.sh: pidof: not found
stat: illegal option – c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file|handle …]
stat: illegal option – c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file|handle …]
stat: illegal option – c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file|handle …]
[: -lt: unexpected operator
Exporting current databases using timestamp: 2025-02-10_17.52.25
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.
stat: illegal option – c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file|handle …]
expr: syntax error
[: -eq: unexpected operator
stat: illegal option – c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file|handle …]
expr: syntax error
[: -eq: unexpected operator
Verification complete. PMS main database is OK.
stat: illegal option – c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file|handle …]
expr: syntax error
[: -eq: unexpected operator
stat: illegal option – c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file|handle …]
expr: syntax error
[: -eq: unexpected operator
Verification complete. PMS blobs database is OK.
Saving current databases with ‘-BACKUP-2025-02-10_17.52.25’
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.
chmod: invalid file mode: com.plexapp.plugins.library.db
ERROR: Cannot set permissions on new databases. Error 1
Please exit tool, keeping temp files, seek assistance.
Use files: ./dbtmp/*-BACKUP-2025-02-10_17.52.25

Content of DBRepair.log:
root@manualPlex:/usr/local/plexdata/Plex Media Server/Plug-in Support/Databases # cat DBRepair.log
2025-02-10 17.48.56 - Plex SQLite = ‘/usr/local/share/plexmediaserver/Plex SQLite’
2025-02-10 17.48.56 - Databases = ‘/usr/local/plexdata/Plex Media Server/Plug-in Support/Databases/’
2025-02-10 17.48.56 - ============================================================
2025-02-10 17.48.56 - Session start: Host is User Defined
2025-02-10 17.48.56 - SQLite path: ‘/usr/local/share/plexmediaserver/Plex SQLite’
2025-02-10 17.48.56 - Database path: ‘/usr/local/plexdata/Plex Media Server/Plug-in Support/Databases/’
2025-02-10 17.49.02 - Check - Check com.plexapp.plugins.library.db - PASS
2025-02-10 17.49.02 - Check - Check com.plexapp.plugins.library.blobs.db - PASS
2025-02-10 17.49.02 - Check - PASS
2025-02-10 17.49.23 - Repair - Export databases - PASS
2025-02-10 17.49.23 - Repair - Import - PASS
2025-02-10 17.49.23 - Repair - Verify main database - PASS (Size: MB/MB).
2025-02-10 17.49.23 - Repair - Verify blobs database - PASS (Size: MB/MB).
2025-02-10 17.49.23 - Making repaired databases active
2025-02-10 17.49.23 - Repair - Move files - FAIL
2025-02-10 17.52.25 - Repair - Export databases - PASS
2025-02-10 17.52.25 - Repair - Import - PASS
2025-02-10 17.52.25 - Repair - Verify main database - PASS (Size: MB/MB).
2025-02-10 17.52.25 - Repair - Verify blobs database - PASS (Size: MB/MB).
2025-02-10 17.52.25 - Making repaired databases active
2025-02-10 17.52.25 - Repair - Move files - FAIL

Unfortunately, I also have errors coming from the shell script. I dont know at this point how much it affect the result. I gave full control to everyone to the Databases directory.

If there is nothing in the libraries, then just delete all the database files.

Plex will create new, empty ones the next time it runs.

It recreates the DB files, but end up with the same errors. Lots of entries related to migration in log file:


Feb 10, 2025 18:08:32.412 [0x806c12000] INFO - Running forward migration 20200515172900.
Feb 10, 2025 18:08:32.412 [0x806c12000] DEBUG - Captured session 0.
Feb 10, 2025 18:08:32.412 [0x806c12000] DEBUG - Captured session 1.
Feb 10, 2025 18:08:32.412 [0x806c12000] INFO - Completed forward migration 20200515172900.
Feb 10, 2025 18:08:32.412 [0x806c12000] INFO - Running forward migration 20200610150000.
Feb 10, 2025 18:08:32.412 [0x806c12000] DEBUG - Captured session 0.
Feb 10, 2025 18:08:32.412 [0x806c12000] DEBUG - Captured session 1.
Feb 10, 2025 18:08:32.413 [0x806c12000] INFO - Completed forward migration 20200610150000.
Feb 10, 2025 18:08:32.413 [0x806c12000] INFO - Running forward migration 20200615032400.

but still end up with the same errors at the end.

Those messages do not help. That’s just Plex creating a new database.

Upload the full Plex Media Server.log file.

Plex Media Server.log (329.1 KB)

Thanks for the log file.

This looks like permission issues (or worst case that a drive is failing).

I’ve never used TrueNAS. Hopefully others can assist with detailed troubleshooting.

From PlexDBRepair Log: 2025-02-10 17.49.23 - Repair - Move files - FAIL

From Plex Media Server.log:

Feb 10, 2025 18:08:31.160 [0x806c12000] WARN - Failed to create temp dir "/tmp/pms-ed72802f-e494-4be7-93cc-18d589a6a10b": 13, Permission denied
Feb 10, 2025 18:08:31.160 [0x806c12000] ERROR - Unable to open named mutex 9334581e-7251-4ef7-a8ec-5bfe8e89ff68 with option 1: Permission denied
Feb 10, 2025 18:08:32.460 [0x806c12000] ERROR - SQLITE3:0x10, 6410, statement aborts at 5: [CREATE TABLE "media_parts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "media_item_id" integer, "directory_id" integer, "hash" varchar(255), "open_subtitle_hash" varchar(255), "file" varchar(255), "index" integer, "size" integer(8), "duration" integer, "created_at" dt_integer(8), "updated_at" dt_integer(8), "deleted_at" dt_integer(8), "extra_data" varchar(255))] disk I/O error
Feb 10, 2025 18:08:32.460 [0x806c12000] ERROR - SQLITE3:0x10, 10, statement aborts at 1: [VACUUM] disk I/O error
Feb 10, 2025 18:08:32.462 [0x806c12000] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::loadOne: disk I/O error
Feb 10, 2025 18:08:32.462 [0x806c12000] ERROR - Database corruption: sqlite3_statement_backend::loadOne: disk I/O error

I had already full control to everyone to the database folder and it did not work. Just gave full control to everyone to the /tmp folder and it started! thanks.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.