How to understand what an App can see of the truenas datasets

tre4B

Dabbler
Joined
Dec 6, 2022
Messages
33
I have been trying to setup the Emby App. Initially I made a mistake by trying to add a HostPath and an SMB share on the same dataset.

I now have a DataSet with nothing else using it. When I setup the application I give it the host path of that Dataset and a mount path. The challenge is that I cannot see the mount path when I try to add a library path in Emby. I think this means the path is not mapping but I do not know why. I have removed and re-setup Emby several times with different combinations of data set, different mount path names with and without /'s and still no luck.

I had one time when the mount path showed up, but no files were discovered. I found out this was because the ACLs on the folder were not allowing anything to access it and I corrected it... or so I thought, now I cannot get it to show in the library path at all anymore.

Problem I have is I have no console access or anything to the Emby application (pod?). If I try the shell option with the Apps three dots menu I get this:

"WARN[ØØØØ] Unable to read /etc/rancher/k3s/k3s.yamI, please start server with --write-kubeconfig-mde to modify kube config permissions
error: error loading config file "/etc/rancher/k3s/k3s.yam1": open /etc/rancher/k3s/k3s.yæ1: permission denied"

Having never really played with Kubernetes (which I think is what is running this) I don't know where to go with this. There does not seem to be any permissions needed for the App itself so I think that is okay.

Can anyone help point me the right way?
 

MisterE2002

Patron
Joined
Sep 5, 2015
Messages
211
Can you clearer describe what Host (truenas) you mount inside the container (path). I find it difficult to follow.

That said, HostPath and SMB on the same dataset is possible if you use "Apps -> Settings -> Advanced Settings -> untick "Enable Host Path Safety Checks"
 

tre4B

Dabbler
Joined
Dec 6, 2022
Messages
33
@MisterE2002 I've got a bit further along now. I've now managed to get the host to see the host paths using a path that looks like this

Media - dataset with SMB share against it
Media/movies - dataset
Media/music - dataset
Media/tv - dataset

With this setup mapping the host paths to the datasets they were recognised in the App setup and mounted into a library. The challenge I have is that when the application does a library scan it finds no files. I can see by going in on the SMB share that there are files there, but clearly the app itself cannot see them. As the mount point is a dataset only it does not have any acls (I assume) that differ from what is in the rest of the Media share?

Usually I would try and go into Emby with a shell and see what files it can see to give me a clue of what is going wrong. I can find no way though to see what files emby thinks it can see.
 

MisterE2002

Patron
Joined
Sep 5, 2015
Messages
211
still quite unclear, so i make some assumptions. You mapped your nas (/mnt/Media) into your Emby container. Lets say you used "/media". You start the app and let Emby locate files in "/media/movies".

It is possible the app has no rights to read the files. Use the truenas shell option (the 3 points - hamburger menu). You are probably the user which is used by the Emby app itself. Verify with "id" or "whoami". Now you can test what the app is doing to read a file.
For example:

Code:
cd /media/movies/
ls
# use a result
file <enter filename>
 

tre4B

Dabbler
Joined
Dec 6, 2022
Messages
33
I am certain the app has no rights to read the files. It reports a permissions issue for each mount in the logs.

If I go into the shell and access the directories, I can see the files and can cat the contents of a json file so the shell user does have the rights.

And I figured it out. I looked through the list of system users, and found one called BIN. When I added the Emby app its initial offer of a user name was one called "bin" which seemed weird so I changed it for something more emby related. It occurred to me that this might mean the app was installed as a user called bin, so I made sure that bin had access to the DataSets and it worked.

Solution: Add user bin to the ACLS of the directories you want to share with Emby.
 

billbillw

Dabbler
Joined
Jan 6, 2023
Messages
33
I am having similar but not exact problem with my Plex setup (official Plex chart). I am trying to figure out the permissions to let plex self install its universal encoder because I error out whenever it tries to playback Dolby TrueHD material on clients that don't support TrueHD.

I tried to go into the shell for the Plex app and it spits out this error:

WARN[0000] Unable to read /etc/rancher/k3s/k3s.yaml, please start server with --write-kubeconfig-mode to modify kube config permissions
error: error loading config file "/etc/rancher/k3s/k3s.yaml": open /etc/rancher/k3s/k3s.yaml: permission denied

I am a little confused by this. I know nothing about Kubernetes and don't want to screw anything up.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I tried to go into the shell for the Plex app and it spits out this error:
...because you're logged in as a non-root admin user. iX kind of half-assed (I'm sure they'd prefer to consider it a "work in progress", which raises the question of why they release with incomplete features) this feature. They want you to use it (the web UI lies to you about the root user's password being disabled if you don't have one), but you can't use the shell--either for the NAS itself or for your apps--if you're logged in as a user other than root.
 

billbillw

Dabbler
Joined
Jan 6, 2023
Messages
33
...because you're logged in as a non-root admin user. iX kind of half-assed (I'm sure they'd prefer to consider it a "work in progress", which raises the question of why they release with incomplete features) this feature. They want you to use it (the web UI lies to you about the root user's password being disabled if you don't have one), but you can't use the shell--either for the NAS itself or for your apps--if you're logged in as a user other than root.
Yeah, I figured that out. I thought I put an edit, but I guess I didn't save it
 

tre4B

Dabbler
Joined
Dec 6, 2022
Messages
33
Do the same as I did. Give rights to the bin user to access the shares you want Plex to access and it will probably work.
 
Top