Plex on Raspberry Pi 3, Library Data on Remote Folder issue

Good evening everyone,

I have tried to move my library data to a remote folder with symlink. However, there’s a point where it simply failed therefore I decided to start afresh with a clean install.

I cannot yet manage to get it working…

The symlink is still in place, linking /var/lib/plexmediaserver/Library to /home/pi/ReadyNas/Plex (remote folder)

Permission wise, /home/pi/ReadyNas/Plex is root:root
I’ve added Plex to Root, tried using override.conf to force plex being root (even pointing directly to the folder) to no avail.

I cannot even connect to the server (192.168.1.25:32400/web)

The error message I get is “database is locked”

Here are my logs :
Dec 13, 2017 20:48:16.088 [0x73bbb400] INFO - Plex Media Server v1.10.0.4523-648bc61d4 - annapurnatrans PC arm7 - build: linux-annapurnatrans-arm7 readynas6 - GMT 01:00
Dec 13, 2017 20:48:16.090 [0x73bbb400] INFO - Linux version: 4.9.35-v7+ (#1014 SMP Fri Jun 30 14:47:43 BST 2017), language: C
Dec 13, 2017 20:48:16.090 [0x73bbb400] INFO - Processor Arm
Dec 13, 2017 20:48:16.090 [0x73bbb400] INFO - /usr/lib/plexmediaserver/Plex Media Server
Dec 13, 2017 20:48:16.007 [0x74545000] DEBUG - BPQ: [Idle] -> [Starting]
Dec 13, 2017 20:48:16.032 [0x74545000] ERROR - Unable to open named mutex 9334581e-7251-4ef7-a8ec-5bfe8e89ff68 with option 1: File exists
Dec 13, 2017 20:48:16.033 [0x74545000] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.13.0, threadsafe=1
Dec 13, 2017 20:48:17.937 [0x72fff400] DEBUG - Job running: ‘/usr/lib/plexmediaserver/CrashUploader’ ‘–directory=/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Crash Reports/1.10.0.4523-648bc61d4’ ‘–version=1.10.0.4523-648bc61d4’ ‘–platform=linux-annapurnatrans-arm7 (4.9.35-v7+ (#1014 SMP Fri Jun 30 14:47:43 BST 2017))’ ‘–serverUuid=’ ‘–userId=NOUSERID’ ‘–url=https://crashreport.plexapp.com’
Dec 13, 2017 20:48:18.029 [0x727ff400] ERROR - JobManager: child process returned: 1 (Operation not permitted)
Dec 13, 2017 20:48:31.187 [0x74545000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked

Any help would be greatly appreciated.

Thanks in advance,

DRL

@dlhoest said:
Good evening everyone,

I have tried to move my library data to a remote folder with symlink. However, there’s a point where it simply failed therefore I decided to start afresh with a clean install.

I cannot yet manage to get it working…

The symlink is still in place, linking /var/lib/plexmediaserver/Library to /home/pi/ReadyNas/Plex (remote folder)

Just use the override.conf to change the PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR and and do not change the user. Just follow the below instructions.

Permission wise, /home/pi/ReadyNas/Plex is root:root
I’ve added Plex to Root, tried using override.conf to force plex being root (even pointing directly to the folder) to no avail.

Never (!!!) run Plex as root, or any other service.

What to do:
(1) Fix the permissions of your mount point /home/pi/ReadyNas/Plex . Use a “normal” user and group for the access permissions and make sure the share is not mounted mit “noexec”.
(2) Add plex to the group you have chosen for your mount point in (1), e.g. sudo adduser plex <yourgroup>
(3) Make all data in /home/pi/ReadyNas/Plex read and writeable for the group, e.g. sudo chmod -R g+rw /home/pi/ReadyNas/Plex
(4) Set PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR in the override.conf

Howerver, this is territory where @ChuckPA can provide more detailed help. I’am quite sure he has a small tutorial for this copy&paste ready :slight_smile:

Good evening,

Thanks for your reaction!

I followed your tips and here’s the result…

/home/pi/ReadyNas/Plex is mounted as pi:pi
plex is part of pi

pi@raspberrypi:~ $ sudo service plexmediaserver status
● plexmediaserver.service - Plex Media Server for Linux
Loaded: loaded (/etc/systemd/system/plexmediaserver.service; enabled)
Drop-In: /etc/systemd/system/plexmediaserver.service.d
└─override.conf
Active: active (running) since Fri 2017-12-15 20:10:40 CET; 1min 28s ago
Process: 1186 ExecStartPre=/bin/sh -c /usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” (code=exited, status=0/SUCCESS)
Main PID: 1190 (sh)
CGroup: /system.slice/plexmediaserver.service
├─1190 /bin/sh -c LD_LIBRARY_PATH=/usr/lib/plexmediaserver /usr/lib/plexmediaserver/Plex\ Media\ Server
└─1192 /usr/lib/plexmediaserver/Plex Media Server

Dec 15 20:10:40 raspberrypi systemd[1]: Started Plex Media Server for Linux.
Dec 15 20:10:44 raspberrypi sh[1190]: Error in command line:the argument for option ‘–serverUuid’ should follow immediately after the equal sign
Dec 15 20:10:44 raspberrypi sh[1190]: Crash Uploader options (all are required):
Dec 15 20:10:44 raspberrypi sh[1190]: --directory arg Directory to scan for crash reports
Dec 15 20:10:44 raspberrypi sh[1190]: --serverUuid arg UUID of the server that crashed
Dec 15 20:10:44 raspberrypi sh[1190]: --userId arg User that owns this product
Dec 15 20:10:44 raspberrypi sh[1190]: --platform arg Platform string
Dec 15 20:10:44 raspberrypi sh[1190]: --url arg URL to upload to
Dec 15 20:10:44 raspberrypi sh[1190]: --help show help message
Dec 15 20:10:44 raspberrypi sh[1190]: --version arg Version of the product

On my browser : connection refused

Logs :

Dec 15, 2017 20:10:42.563 [0x73c65400] INFO - Plex Media Server v1.10.0.4523-648bc61d4 - annapurnatrans PC arm7 - build: linux-annapurnatrans-arm7 readynas6 - GMT 01:00
Dec 15, 2017 20:10:42.565 [0x73c65400] INFO - Linux version: 4.9.35-v7+ (#1014 SMP Fri Jun 30 14:47:43 BST 2017), language: C
Dec 15, 2017 20:10:42.565 [0x73c65400] INFO - Processor Arm
Dec 15, 2017 20:10:42.565 [0x73c65400] INFO - /usr/lib/plexmediaserver/Plex Media Server
Dec 15, 2017 20:10:42.321 [0x745ef000] DEBUG - BPQ: [Idle] -> [Starting]
Dec 15, 2017 20:10:42.377 [0x745ef000] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.13.0, threadsafe=1
Dec 15, 2017 20:10:44.317 [0x730ff400] DEBUG - Job running: ‘/usr/lib/plexmediaserver/CrashUploader’ ‘–directory=/home/pi/ReadyNas/Plex/Library/Application Support/Plex Media Server/Crash Reports/1.10.0.4523-648bc61d4’ ‘–version=1.10.0.4523-648bc61d4’ ‘–platform=linux-annapurnatrans-arm7 (4.9.35-v7+ (#1014 SMP Fri Jun 30 14:47:43 BST 2017))’ ‘–serverUuid=’ ‘–userId=NOUSERID’ ‘–url=https://crashreport.plexapp.com’
Dec 15, 2017 20:10:44.439 [0x728ff400] ERROR - JobManager: child process returned: 1 (Operation not permitted)
Dec 15, 2017 20:10:57.601 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:11:12.873 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:11:28.464 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:11:43.917 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:11:59.522 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:12:14.880 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:12:30.385 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:12:42.323 [0x71eff400] DEBUG - BPQ: [Starting] -> [Processing]
Dec 15, 2017 20:12:45.761 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:13:01.133 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked

I don’t get it…

@dlhoest said:
Good evening,

Thanks for your reaction!

I followed your tips and here’s the result…

/home/pi/ReadyNas/Plex is mounted as pi:pi
plex is part of pi

pi@raspberrypi:~ $ sudo service plexmediaserver status
● plexmediaserver.service - Plex Media Server for Linux
Loaded: loaded (/etc/systemd/system/plexmediaserver.service; enabled)
Drop-In: /etc/systemd/system/plexmediaserver.service.d
└─override.conf
Active: active (running) since Fri 2017-12-15 20:10:40 CET; 1min 28s ago
Process: 1186 ExecStartPre=/bin/sh -c /usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” (code=exited, status=0/SUCCESS)
Main PID: 1190 (sh)
CGroup: /system.slice/plexmediaserver.service
├─1190 /bin/sh -c LD_LIBRARY_PATH=/usr/lib/plexmediaserver /usr/lib/plexmediaserver/Plex\ Media\ Server
└─1192 /usr/lib/plexmediaserver/Plex Media Server

Dec 15 20:10:40 raspberrypi systemd[1]: Started Plex Media Server for Linux.
Dec 15 20:10:44 raspberrypi sh[1190]: Error in command line:the argument for option ‘–serverUuid’ should follow immediately after the equal sign
Dec 15 20:10:44 raspberrypi sh[1190]: Crash Uploader options (all are required):
Dec 15 20:10:44 raspberrypi sh[1190]: --directory arg Directory to scan for crash reports
Dec 15 20:10:44 raspberrypi sh[1190]: --serverUuid arg UUID of the server that crashed
Dec 15 20:10:44 raspberrypi sh[1190]: --userId arg User that owns this product
Dec 15 20:10:44 raspberrypi sh[1190]: --platform arg Platform string
Dec 15 20:10:44 raspberrypi sh[1190]: --url arg URL to upload to
Dec 15 20:10:44 raspberrypi sh[1190]: --help show help message
Dec 15 20:10:44 raspberrypi sh[1190]: --version arg Version of the product

On my browser : connection refused

Logs :

Dec 15, 2017 20:10:42.563 [0x73c65400] INFO - Plex Media Server v1.10.0.4523-648bc61d4 - annapurnatrans PC arm7 - build: linux-annapurnatrans-arm7 readynas6 - GMT 01:00
Dec 15, 2017 20:10:42.565 [0x73c65400] INFO - Linux version: 4.9.35-v7+ (#1014 SMP Fri Jun 30 14:47:43 BST 2017), language: C
Dec 15, 2017 20:10:42.565 [0x73c65400] INFO - Processor Arm
Dec 15, 2017 20:10:42.565 [0x73c65400] INFO - /usr/lib/plexmediaserver/Plex Media Server
Dec 15, 2017 20:10:42.321 [0x745ef000] DEBUG - BPQ: [Idle] → [Starting]
Dec 15, 2017 20:10:42.377 [0x745ef000] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.13.0, threadsafe=1
Dec 15, 2017 20:10:44.317 [0x730ff400] DEBUG - Job running: ‘/usr/lib/plexmediaserver/CrashUploader’ ‘–directory=/home/pi/ReadyNas/Plex/Library/Application Support/Plex Media Server/Crash Reports/1.10.0.4523-648bc61d4’ ‘–version=1.10.0.4523-648bc61d4’ ‘–platform=linux-annapurnatrans-arm7 (4.9.35-v7+ (#1014 SMP Fri Jun 30 14:47:43 BST 2017))’ ‘–serverUuid=’ ‘–userId=NOUSERID’ ‘–url=https://crashreport.plexapp.com
Dec 15, 2017 20:10:44.439 [0x728ff400] ERROR - JobManager: child process returned: 1 (Operation not permitted)
Dec 15, 2017 20:10:57.601 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:11:12.873 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:11:28.464 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:11:43.917 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:11:59.522 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:12:14.880 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:12:30.385 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:12:42.323 [0x71eff400] DEBUG - BPQ: [Starting] → [Processing]
Dec 15, 2017 20:12:45.761 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked
Dec 15, 2017 20:13:01.133 [0x745ef000] ERROR - SQLITE3:(nil), 5, statement aborts at 1: [PRAGMA journal_mode=WAL] database is locked

I don’t get it…

I’ve also changed plex user and group accordingly : pi:pi in the override.conf

@dlhoest There is only a NFS article in the Linux tips [1] section and it especially mentions the requirement of POSIX locks. I hope @ChuckPA can tell you if it’s even possible to put the Library on a Samba share and what mount options are required.

[1] https://forums.plex.tv/discussion/280224/plexs-metadata-on-a-network-share-advanced-tip

Does the samba server providing the share, and the local samba client, support posix or equivalent file locking?

If it does not then the answer is no.