munnerz/kube-plex

Sub directories under data dir are not owned by plex

Opened this issue · 5 comments

The mounted claim under data directory have root as the owner, I even tried to update the deployment and passed the uid and gid, however the sub directories still owned by root. Not sure if this is being developed actively but, great concept!

Hello @shwetkprabhat, thank you for your issue!

Can you provide a little more detail about your request? Do you expect that the data directory would be mounted as a specific user, or do you expect that kube-plex would chown the data directory recursively?
My apologies, I am not exactly sure what you mean with 'claim'. Is this somehow in reference to the Plex Claim Token?

hello @chaosaffe, I am expecting that the data directory would be mounted as a specific user.

@chaosaffe I did not clarify the claim question, its basically the media dataset on a nas server, defined by persistence.data.claimName

Krm1t commented

Hey

I'd like to expand on this issue as i think i have the same problem.
Let's first get my setup out of the way.
Data is stored on my NAS let's just call it Storage
kube-plex is hosted on my kubernetes server called master-node
Data is accessed via nfs PersistantVolumes (data volume defined below)

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-nfs-shared-media-1
  labels:
    bucket: shared-media
    location: nfs
spec:
  capacity:
    storage: 999T
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  nfs:
    server: storage.mydomain.local
    path: "/volume1/kubernetes/media"
  mountOptions:
    - rw

Once kube-plex is up and running i do a port-forward to access plex so i can set up the server.
When i go to add a new library and i browse the \data folder i can't see any subfolders in it even though i know they exist (in the nfs share). If i add the library anyway and scan for files then none are found.
I started by looking at the PV as i thought i had done something wrong there but after looking over it several times i concluded that it should be working just fine as i practically mirrored the config pv which was working fine.
So i turned my focus to the pod instead. So i accessed it (i.e. kubectl exec) and there i found the following permissions on the /data directory:
drwxrwxrwx 4 plex plex 4096 Mar 26 20:46 data

Notice plex is the user and group - This makes sense.
But if i enter the /data directory i get this:
-rwxrwxrwx 1 1026 users 2596802818 Mar 7 2019 somemoviefile.mkv
drwxrwxrwx 3 1026 users 4096 Jan 16 21:08 movies

Now it makes sense that plex cannot see the files and folders as the plex user does not have access to those files and folders.
If i understand @geek-baba correctly then this is his problem as well.
If it's not the same then plz say so and i'll create a new issue instead.

As i write this i realize that this may not actually be a kube-plex issue but a kubernetes issue instead. Unfortunately i'm not a kubernetes expert so i don't know for sure.

Yes same issue, its definitely kube-plex issue and I could not use this at that time, now I see you have ability to mount multiple directories and that should solve the issue. I use plexinc image and have no permissions issues. This could also be solved if kube-plex let me set the uid and gid of the container before it starts.