-
-
Notifications
You must be signed in to change notification settings - Fork 8
Dockermod causes jellyfin to crash due to config files ownership #68
Comments
Thank you for the detailed report. I think we can fix it by adding using some args and changing ownership of these files in our container (they are currently just built with the container root user). Line 95 in b445644
I am not a docker expert, but I'm pretty sure that can be done. We do something similar in other images (https://github.com/LizardByte/Sunshine/blob/cea9f152d8a73aca2fcef30205afc8fb3389a258/docker/ubuntu-22.04.dockerfile#L148-L171). I think it could be a simpler version of that. Can you share your docker compose configuration (strip anything sensitive)? Also, just putting this here for my own reference: https://docs.linuxserver.io/images/docker-jellyfin#environment-variables-e |
This is the relevant parts of my I think with the docker-mods the actual docker image is built by your github workflow pipeline, and what gets downloaded by the docker client is a pre-built layer that gets laid on top. This means (I think) that anything put into During startup, the linuxserverio containers use s6 init scripts to set the ownership of files to match whatever the system is running as (it looks like they always map the user:group I suspect the right way (but perhaps not the only way) to do it is to create an s6 script to run Oddly I am finding that my install isn't actually downloading any mp3's, even though the logs say it worked and it creates the themerr.json file. I wonder if the version of YoutubeExploder needs bumping?
|
Now that I think about it, I think you're right. I'm going to make an attempt at setting up the s6 init script. It doesn't seem that complex from the example you shared. I'll let you know when I have the PR up if you'd want to give it a review. |
@agittins This was easier than I thought it would be. Would you mind looking over my PR? I don't normally ask the people who open an issue to do so, but you seem to have a pretty good grasp of this issue. |
That was quick! 🙂 I'm only on my phone but I've done a review and I think the approach looks good. |
This issue has been fixed and will be available in the next release. |
@agittins Thanks for the review. It was a pretty simple change all things considered. I'll need to remember this in the future if there's actually anything architecture specific in our build as the docker mod doesn't actually try to pull the architecture that matches the base image. Anyway, this is merged into nightly and available on docker hub and ghcr. Do you mind trying with the |
Ok, that's interesting! I stopped the container, removed the When it started up it gave me:
which again caused jellyfin to continually restart. Two things of note - the plugin config path is indeed now root@dockerhost:/srv/docker# ls -alFn jellyfin-config/data/plugins/themerr-jellyfin/
total 336
drwxr-xr-x 2 0 0 4096 Aug 26 00:08 ./
drwxr-xr-x 17 1000 1000 4096 Aug 26 00:08 ../
-rw-r--r-- 1 0 0 20992 Aug 26 00:08 Jellyfin.Plugin.Themerr.dll
-rw-r--r-- 1 0 0 294400 Aug 26 00:08 YoutubeExplode.dll
-rw-r--r-- 1 0 0 480 Aug 26 00:08 meta.json
-rw-r--r-- 1 0 0 8281 Aug 26 00:08 themerr-jellyfin.png So it seems the s6 script isn't running. Maybe adding some echo statements to get some output in the logs might help to diagnose, but I suspect it's probably a naming issue (run.sh vs run?), file mode (maybe the init files need to be +x) and also taking a look at the The good news though is that once I manually fixed the permissions the actual downloads worked for me :-) Happy to give it another shot once you've got a tested nightly. 👍🏼 |
I wanted to use Unfortunately I don't think there is a way to use a local image for a docker mod (at least not that I'm aware of)... so I have to merge it before it can actually be tested. |
Although, I was under the impression it could be named something else, as the name is defined in the Can you confirm the location is in And did you not get this output? Initializing Themerr-jellyfin, as a mod for Linuxserver.io Jellyfin container
╔═══════════════════════════════════════════════════════════════╗
║ ║
║ Themerr-jellyfin, a LizardByte application ║
║ ║
║ Docs: https://docs.lizardbyte.dev/projects/themerr-jellyfin ║
║ Support center: https://app.lizardbyte.dev/#Support ║
║ Donate: https://app.lizardbyte.dev/#Donate ║
║ ║
╚═══════════════════════════════════════════════════════════════╝ |
Put up another PR. This time I think it will work. I previously forgot to
|
@agittins Do you mind trying nightly again? |
Have you been able to replicate the issue on your end, and verify that it's fixed? I am still getting the exact same issue. What happens on your system when you test your changes? Logs from run just now:
|
The problem is that I don't think the mods accept local docker images... Maybe I'm wrong but I'm pretty sure I tried before with a Plex mod. Not sure what the problem could be though. Doesn't seem to be printing anything from that run file. |
I believe I found the issue. I have pushed the change and test... and I think I will open an issue with the docker mod repo, as I believe there should be the ability to test local images to avoid this situation. |
It also did not resolve the issue. |
Trying to make sense of this, whatever this s6 system is, is just not logical at all. But I think I have it now. Themerr-jellyfin in #77 |
Still not working. It doesn't appear the s6 init files are added to the image, I don't understand why. The directory is copied to the final stage, the same stage where the plugin files are. Line 101 in f9d1112
Not sure what else to try. |
Made a little progress, there's still an issue though. 2023-08-29 14:51:26 [mod-init] Attempting to run Docker Modification Logic
2023-08-29 14:51:26 [mod-init] Adding lizardbyte/themerr-jellyfin:nightly to container
2023-08-29 14:51:27 [mod-init] Downloading lizardbyte/themerr-jellyfin:nightly from registry-1.docker.io
2023-08-29 14:51:28 [mod-init] Installing lizardbyte/themerr-jellyfin:nightly
2023-08-29 14:51:28 [mod-init] lizardbyte/themerr-jellyfin:nightly applied to container
2023-08-29 14:51:28 s6-rc-compile: fatal: invalid /etc/s6-overlay/s6-rc.d/init-mod-jellyfin-themerr-config/type: must be oneshot, longrun, or bundle It's already a |
Okay, good news... the s6 init logic is working. But the bad news... There is a new directory that claims it doesn't have correct permissions. In my opinion this should be handled by the Jellyfin image, and I have submitted a PR to fix it there. linuxserver/docker-jellyfin#214 If they accept the PR, then I believe this issue will be fully resolved. If they do not accept the PR, I will add the fix here. |
@agittins do you mind testing this again with latest jellyfin image and our nightly image? They have merged my fix linuxserver/docker-jellyfin#214 If not, I'll try to get to it soon. |
I am no longer getting the permissions error on the jellyfin plugin config directory now. I will publish a new release soon. |
Latest release file? |
@rohitghali for docker you can use |
Describe the Bug
TLDR: The DOCKER_MOD installs the config dir and files with root ownership instead of the user that jellyfin runs as, causing jellyfin to crash on startup.
I have jellyfin running in a docker container on linux which has been working well for some time. I'm using the linuxserver/jellyfin image, along with their recommended
PUID
andPGUID
options set to1000
, andUMASK_SET
of022
.Following the install docs, I added
DOCKER_MODS=lizardbyte/themerr-jellyfin:latest
to the environment variables in mydocker-compose.yaml
and issued adocker-compose up -d
.Examining the jellyfin logs reveals that the server repeatedly crashes due to an exception in the Themerr plugin with
System.UnauthorizedAccessException: Access to the path '/config/data/plugins/Themerr/meta.json' is denied.
I noticed that the directory
/config/data/plugins/Themerr
and its files are all owned byroot
instead of the UID configured for the container, hence why the plugin is unable to access them once it starts up in jellyfin.I manually chmod'd the files and everything fired up OK.
From looking at the linuxserver s6 init scripts I am guessing the fix would be to place an init script so that s6 changes ownership to the
abc
user on startup. Their own docker-mods docs don't seem to cover this situation, but maybe some other docker-mods out there have a simple solution.It's likely this only happens if the mod is installed after jellyfin has already been initialised previously.
Expected Behavior
The jellyfin server should start and begin answering network requests instead of crashing.
Additional Context
Complete cycle from the logfile - this pattern repeats as docker restarts the container:
The text was updated successfully, but these errors were encountered: