Plex Media Server not working on TrueNAS

Hi there,

I upgrade my FreeNAS 11.3 to TrueNAS 12.0. This required me to update my Plex jail to 12.2 from 11.2. After the upgrades, now my Plex is not working. I have spent multiple hours trying to get this fixed but to avail. The plugin version is 1.25.6.5577 and release is 12.2-RELEASE-p14.

Any help would be appreciated. Sharing “Plex Media Server.log” information if that helps.

Thanks so much.

Mar 18, 2022 21:27:12.468 [0x8061a5100] INFO - Plex Media Server v1.25.6.5577-c8bd13540 - FreeBSD PC amd64 - build: freebsd-x86_64 freebsd - GMT -07:00
Mar 18, 2022 21:27:12.469 [0x8061a5100] INFO - FreeBSD version: 12.2-RELEASE-p12, language: en-US
Mar 18, 2022 21:27:12.469 [0x8061a5100] WARN - Read of sysctl machdep.cpu.brand_string failed: 2 (No such file or directory)
Mar 18, 2022 21:27:12.469 [0x8061a5100] INFO - Processor: 6-core
Mar 18, 2022 21:27:12.469 [0x8061a5100] INFO - Compiler is - Clang 11.0.1 (https://plex.tv b587490162c22e078c314e3f7dc560c691d126aa)
Mar 18, 2022 21:27:12.469 [0x8061a5100] INFO - /usr/local/share/plexmediaserver/Plex_Media_Server
Mar 18, 2022 21:27:12.468 [0x8060eb000] DEBUG - BPQ: [Idle] → [Starting]
Mar 18, 2022 21:27:12.468 [0x8060eb000] DEBUG - FeatureManager: Using cached data for features list
Mar 18, 2022 21:27:12.469 [0x8060eb000] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.35.5, threadsafe=1
Mar 18, 2022 21:27:12.470 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.472 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.474 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.476 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.478 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.480 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.482 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.484 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.486 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.488 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.489 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.491 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.493 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.495 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.497 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.499 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.501 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.503 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.505 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.507 [0x8060eb000] INFO - SQLITE3:0x10, 283, recovered 505 frames from WAL file /Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Running migrations. (EPG 0)
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Running forward migration 20210304150000.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 0.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 1.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 2.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 3.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 4.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 5.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 6.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 7.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 8.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 9.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 10.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 11.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 12.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 13.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 14.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 15.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 16.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 17.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 18.
Mar 18, 2022 21:27:12.508 [0x8060eb000] DEBUG - Captured session 19.
Mar 18, 2022 21:27:12.508 [0x8060eb000] ERROR - SQLITE3:0x10, 8, statement aborts at 28: [CREATE TABLE ‘activities’ ( ‘id’ INTEGER NOT NULL, ‘parent_id’ INTEGER, ‘type’ varchar(255), ‘title’ varchar(255), ‘subtitle’ varchar(255), ‘scheduled_at’ timestamp, ‘started_at’ times
Mar 18, 2022 21:27:12.508 [0x8060eb000] ERROR - Exception inside transaction (inside=1) (/data/jenkins/server/3483635874/Library/DatabaseMigrations.cpp:237): sqlite3_statement_backend::loadOne: attempt to write a readonly database
Mar 18, 2022 21:27:12.510 [0x8060eb000] ERROR - Exception thrown during migrations, aborting: sqlite3_statement_backend::loadOne: attempt to write a readonly database
Mar 18, 2022 21:27:12.547 [0x8060eb000] DEBUG - ChangestampAllocator: initialized to 2427772
Mar 18, 2022 21:27:12.547 [0x8060eb000] ERROR - SQLITE3:0x10, 1, no such table: activities in “update activities set finished_at=started_at where finished_at is null”
Mar 18, 2022 21:27:12.547 [0x8060eb000] ERROR - Database corruption: sqlite3_statement_backend::prepare: no such table: activities for SQL: update activities set finished_at=started_at where finished_at is null

Plex is unable to write to the database.

Check ownership / permissions for the Plex data directory.

The last statement in the log snip you provided mentions database corruption. However, that might be due to the access problems.

I do not run truenas, so cannot help with specifics on correcting the problem. I searched the forum for “attempt to write a readonly database” and found a similar post from 2018. Hopefully it will get you pointed in the right direction: Plex won’t start/

https://support.plex.tv/articles/202915258-where-is-the-plex-media-server-data-directory-located/

Thanks so much for pointing that out and after changing the permissions and starting the service, the logs did not show those errors. So one bug down and another one popped up.

The new errors were like:

Mar 18, 2022 23:21:25.909 [0x81443a000] ERROR - Error issuing curl_easy_perform(handle): 6
Mar 18, 2022 23:21:25.909 [0x81443a000] WARN - HTTP error requesting PUT https://plex.tv/devices/c90a30557cb46f9791e85532ac4cc02df1085c93?httpsEnabled=1&httpsRequired=0&dnsRebindingProtection=0&natLoopbackSupported=0&X-Plex-Token=xxxxxxxxxxxxxxxxxxxx (6, Couldn’t resolve host name) (Could not resolve host: plex.tv)
Mar 18, 2022 23:21:25.909 [0x81443a000] WARN - MyPlex: Updating device connections failed, retrying in 10 seconds.

I reinstalled the plugin using the TrueNAS plugin interface and now my Plex seems to be working.

Thanks again for your help. :slight_smile:

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