Endless issues with Jail system

Killerjerick

Cadet
Joined
Feb 20, 2022
Messages
4
Hi all, first off, let me say, I'm definitely a newbie when it comes to Unix, and specifically BSD, though I've a little experience in other distros.

After my Readynas decided to have issues, I had decided to move my Plex and arr ecosystem to a new Nuc that I had purchased, after looking around, TrueNAS was the best looking option, I started working on it Saturday morning (11am) it's now Monday morning (6am) and I still feel like every bit of progress I make has setbacks, it started with mounting a network drive, after factory formatting my readynas, I wanted to use that as the storage, and TrueNAS as the powerhouse, I'm aware that truenas is meant to be used on the storage side, but I figured with a mounted network drive there'd be no difference, eventually the guys over at /r/homelab helped me sort it, explaining the filesystem layout of jails, that's all good, I've successfully mounted and Plex can read it.

My issue lies in that whenever I try to restore plex's database, plex reports the server as being down, funnily enough, the exact same thing happens when I add anything to any jail I have. Sonarr and Radarr allow for restoring a backup and work fine (although the prebuilt community Radarr plugin/jail doesn't work out of the box at all)

My theory was that it was a permissions issue, so I installed Jackett to test, and sure enough, the second I try to add my backed up trackers, Jackett is unresponsive, I'm pretty close to just giving up at this point and installing a different OS, but figured it was worth a shot to ask here if anyone has experienced this, and what they did to fix it.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
The first thing to ask would be "How are you 'restoring' databases?".

What are the permissions on the database locations?

What user (name and UID) are you running Plex or the other apps as?
 

Killerjerick

Cadet
Joined
Feb 20, 2022
Messages
4
Hey, thanks for the response, and sorry for the lack of info.

"Restoring database" consists of shutting down the Jail using the "stop" button on the gui, logging in as root to FTP via Filezilla deleting the existing plexmediaserver\MediaLibrary\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db and replacing it with the one I backed up as per Plex info regarding viewstate this worked previously when copying from Readynas -> New install of Readynas, no reason it shouldn't work this time I thought.

What are the permissions on the database locations?
I wouldn't even know where to start to look at that, I played around with ls -l but not too sure how to interpret the results, hence the pretense of
I'm definitely a newbie when it comes to Unix, and specifically BSD
Previously, I was controlling permissions via the SMB share (Readynas) from my PC, it seemed to work fine, I know a little about chmod and chown, but it seems overly complex for something that I'm not concerned with regards to security.

as for
What user (name and UID) are you running Plex or the other apps as?
Whatever the default Jail creates it as, from what I could tell the user group that "owns" that database file is 972 with the same username, upon trying to use shell to 'chmod -R a=rwx <Plex Media Server>' I got a whole bunch of "read only file system" errors along with "not permitted" errors
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
plexmediaserver\MediaLibrary\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db
OK, I think you're wrong about this being the only part of the database that you need for migration to work, but let's assume you're right and start with the permissions for that file after you "restore it"... ls -l followed by the full path to the file will do.

If plex will run as user 972 (probably named plex), then we would expect/need that file to be owned by it.

What I think is probably needed is the entire "Plex Media Server" directory, so that would be the next thing to work on if correcting permissions on that file isn't enough.

How about the mounting of the share? perhaps that's what's causing the read-only issues...

How are you making that available in the jail?

Is the database just stored in the jail or is that also coming from a mounted share?
 

Killerjerick

Cadet
Joined
Feb 20, 2022
Messages
4
fQtQH48.png

is what I get after ls -l

the mounting of the share is done via mkdir /mnt/NVME_Pool/iocage/jails/Plex/root/mnt/remoteshare then mount -t nfs 192.168.1.4:/Network_storage/remoteshare /mnt/NVME_Pool/iocage/jails/Plex/root/mnt/remoteshare

It works fine before I restore the database file (for viewstate) but after restoring, Plex no longer works. The exact same issue happens with Jackett/Sonarr/Radarr the second I restore any files, even files where I don't have to overwrite anything, the Jail says "up" yet browsing to the appropriate NAT address yields no result. As an example, here is my Jackett address
qbOSn1Y.png


Yet it is reported as "up"
1645447100870.png


The only files I inserted was the tracker folder from my previous installation, I didn't touch the config file yet. This is what is reported with ls -l
5wYhoIp.png


With "admin" being my SMB login in my feeble attempts to use windows
security gui to fix permissions.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
OK, one app at a time please...

You're mounting with NFS... so which user is the mapall or maproot user for that share on the remote (I guess readyNAS) side?
 

Killerjerick

Cadet
Joined
Feb 20, 2022
Messages
4
Sorry, it's just easier to show with Jackett because to me, that shows that there's an issue here, you could write off plex having issues due to files being replaced, but Jackett has had nothing replaced.

The mount is also not the issue as Jackett has nothing mounted within its jail

I'm mounting with NFS, correct, I'm mounting the ReadyNAS NFS share to where Sonarr/Radarr will move files from transmission to. Plex will then read this mount to serve media. User for the maproot is also called "admin"
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Well, for jackett, it seems obvious to me that you're using a user with an ID of 354 (probably named jackett in the jail) to run the app, but your indexers file/directory is owned by somebody called admin (who probably doesn't exist in the jail and also isn't the one running the app).

Maybe try chown-ing that to 354?
 
Last edited:
Top