• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Jellyfin Docker Permissions

    Pages (2): 1 2 Next »

     
    • 0 Vote(s) - 0 Average

    Jellyfin Docker Permissions

    Jellyfin Permission problems while setting up Gpu acceleration
    erik15
    Offline

    Junior Member

    Posts: 6
    Threads: 1
    Joined: 2023 Aug
    Reputation: 0
    #1
    2023-08-28, 12:03 PM
    I run jellyfin in a docker container on a linux server with the --user option as 1000:1000(my non root user)

    I followed the guide for gpu acceleration with nvidia, but run into a problem on the last steps.
    When i try to run docker exec -it jellyfin ldconfig i get an error that i dont have permission.
    I kinda solved the problem by removing the --user option and running as root but this isn't so secure. Everything worked fine after that.

    Is there a way to run that command without running as root, with my previous --user setting?
    bitmap
    Offline

    Community Moderator

    Posts: 776
    Threads: 9
    Joined: 2023 Jul
    Reputation: 24
    #2
    2023-08-28, 03:51 PM
    Does ldconfig need sudo/root access to run or just access to render/video whatever groups your card is part of in your system?
    Jellyfin 10.10.7 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage

    [Image: AIL4fc84QG6uSnTDEZiCCtosg7uAA8x9j1myFaFs...qL0Q=w2400]
    erik15
    Offline

    Junior Member

    Posts: 6
    Threads: 1
    Joined: 2023 Aug
    Reputation: 0
    #3
    2023-08-28, 04:44 PM
    Not sure but when i use the cli command "sudo docker run ... --user 1000:1000" it has the problem. When i remove the user option it works fine. I havent added my server user to docker group is use sudo. I also have added him to the video group. I think its with privliges inside the container but i dont know to fix it.
    erik15
    Offline

    Junior Member

    Posts: 6
    Threads: 1
    Joined: 2023 Aug
    Reputation: 0
    #4
    2023-08-28, 05:34 PM
    (2023-08-28, 03:51 PM)bitmap Wrote: Does ldconfig need sudo/root access to run or just access to render/video whatever groups your card is part of in your system?

    When I run "sudo docker exec -it jellyfin ldconfig" I get this error:

    "ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied"

    Also get an error for running "sudo docker exec -it jellyfin nvidia-smi" too:

    "Failed to initialize NVML: Insufficient Permissions"
    bitmap
    Offline

    Community Moderator

    Posts: 776
    Threads: 9
    Joined: 2023 Jul
    Reputation: 24
    #5
    2023-08-28, 11:05 PM
    So you're running sudo docker exec, which isn't what you want. Because inside the container is a completely different file system layer, it has different permissions. You could technically run:

    Code:
    docker exec -it jellyfin /bin/bash

    And then go in and try to run ldconfig or nvidia-smi. It seems like a permissions issue. Looking at the hardware acceleration documentation, I'm wondering if there was a step missed or something like that. So taking a step back, I have a few troubleshooting requests... 

    1. Could you post (using the code block tool and not a quick post, preferably) your redacted docker run command or compose file? 
    2. Also confirm that you installed the NVIDIA driver and container toolkit (steps 1 and 2 in the virtualized hardware acceleration guide). 
    3. Maybe confirm your user and group IDs by running ID and ensuring that your user and group ID numbers match 1000:1000 and not something else (I've never had them be 1000:1000).

    Hopefully that'll put us on the right path...
    Jellyfin 10.10.7 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage

    [Image: AIL4fc84QG6uSnTDEZiCCtosg7uAA8x9j1myFaFs...qL0Q=w2400]
    erik15
    Offline

    Junior Member

    Posts: 6
    Threads: 1
    Joined: 2023 Aug
    Reputation: 0
    #6
    2023-08-30, 05:45 PM
    (2023-08-28, 11:05 PM)bitmap Wrote: So you're running sudo docker exec, which isn't what you want. Because inside the container is a completely different file system layer, it has different permissions. You could technically run:

    Code:
    docker exec -it jellyfin /bin/bash

    And then go in and try to run ldconfig or nvidia-smi. It seems like a permissions issue. Looking at the hardware acceleration documentation, I'm wondering if there was a step missed or something like that. So taking a step back, I have a few troubleshooting requests... 

    1. Could you post (using the code block tool and not a quick post, preferably) your redacted docker run command or compose file? 
    2. Also confirm that you installed the NVIDIA driver and container toolkit (steps 1 and 2 in the virtualized hardware acceleration guide). 
    3. Maybe confirm your user and group IDs by running ID and ensuring that your user and group ID numbers match 1000:1000 and not something else (I've never had them be 1000:1000).

    Hopefully that'll put us on the right path...

    I can only run 
    Code:
    docker exec -it jellyfin /bin/bash
    with sudo.

    After that, that's what I tried:

    Code:
    I have no name!@myhomeserver:/$ groups
    groups: cannot find name for group ID 1000
    1000
    I have no name!@myhomeserver:/$ id
    uid=1000 gid=1000 groups=1000
    I have no name!@myhomeserver:/$ who

    Code:
    I have no name!@myhomeserver:/$ ldconfig
    ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
    I have no name!@myhomeserver:/$ su
    Password:
    su: Authentication failure

    Also my user on the server has 1000:1000 but his not in the docker group, and i dont know the password for su inside the jellyfin container.

    My yml file:

    Code:
    version: '3.5'
    services:
      jellyfin:
        image: jellyfin/jellyfin
        container_name: jellyfin
        user: 1000:1000
        network_mode: 'host'
        volumes:
          - /home/erik/srv/jellyfin/config:/config
          - /home/erik/srv/jellyfin/cache:/cache
          - /home/erik/Media:/media
        restart: 'unless-stopped'
        runtime: nvidia
        deploy:
          resources:
            reservations:
              devices:
                - capabilities: [gpu]

    I comment out the user fot gpu acceleration to work.
    bitmap
    Offline

    Community Moderator

    Posts: 776
    Threads: 9
    Joined: 2023 Jul
    Reputation: 24
    #7
    2023-08-30, 06:19 PM
    Okay, so you don't have a docker group that you added to avoid sudo, which is fine. Not a big deal, more of an annoyance for you.

    Your last line might lead you to the answer here -- you generally shouldn't (most times can't) swap between users running the docker container. If you don't specify a user, generally containers don't run as root, they have a user set up inside the container to run as a preset UID/GID that works with the services inside the container. Setting a user/group changes those IDs to match so that file/group permissions work properly with your existing infrastructure. So by giving your user access to the card, then commenting out that information to try and get the card to work, you're muddling things pretty hard.

    Looking at your id command output, you don't seem to have access to the video/render group, which means you don't have access to your video card, which could explain why you can't access it in the docker container. Step 4 of the docker guide explicitly states that you should add your user (on the host) to the correct group.

    Skipping steps is the primary reason HWA didn't work for me, even if I swore I hit every step previously. Even if you think you don't need something. Note that this last step you're trying to do is just updating dynamic links, per the guide. Follow the guide, step-by-painstaking-step. You need to start, run, and keep the container run by the same user in perpetuity unless you plan to have a full changeover for the foreseeable future. A momentary change can destroy access to your files, databases, etc.. So I'd recommend making the correct steps to ensure your user has the right access. The guide walks you through this.
    Jellyfin 10.10.7 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage

    [Image: AIL4fc84QG6uSnTDEZiCCtosg7uAA8x9j1myFaFs...qL0Q=w2400]
    erik15
    Offline

    Junior Member

    Posts: 6
    Threads: 1
    Joined: 2023 Aug
    Reputation: 0
    #8
    2023-08-30, 11:37 PM (This post was last modified: 2023-08-30, 11:38 PM by erik15. Edited 1 time in total.)
    (2023-08-30, 06:19 PM)bitmap Wrote: Okay, so you don't have a docker group that you added to avoid sudo, which is fine. Not a big deal, more of an annoyance for you.

    Your last line might lead you to the answer here -- you generally shouldn't (most times can't) swap between users running the docker container. If you don't specify a user, generally containers don't run as root, they have a user set up inside the container to run as a preset UID/GID that works with the services inside the container. Setting a user/group changes those IDs to match so that file/group permissions work properly with your existing infrastructure. So by giving your user access to the card, then commenting out that information to try and get the card to work, you're muddling things pretty hard.

    Looking at your id command output, you don't seem to have access to the video/render group, which means you don't have access to your video card, which could explain why you can't access it in the docker container. Step 4 of the docker guide explicitly states that you should add your user (on the host) to the correct group.

    Skipping steps is the primary reason HWA didn't work for me, even if I swore I hit every step previously. Even if you think you don't need something. Note that this last step you're trying to do is just updating dynamic links, per the guide. Follow the guide, step-by-painstaking-step. You need to start, run, and keep the container run by the same user in perpetuity unless you plan to have a full changeover for the foreseeable future. A momentary change can destroy access to your files, databases, etc.. So I'd recommend making the correct steps to ensure your user has the right access. The guide walks you through this.

    The id command was run while I was inside the container when i run "docker exec jellyfin /bin/bash/"

    This is my actual id command on my server user:
    Code:
    uid=1000(erik) gid=1000(erik) groups=1000(erik),10(wheel),27(video),28(render),100(users)

    And groups command:
    Code:
    wheel video render users erik

    and nvidia-smi works fine on my server user.

    I already had my server user in the video group and just added him to render group but it didnt work.
    Also thanks for helping me work this out.
    1
    bitmap
    Offline

    Community Moderator

    Posts: 776
    Threads: 9
    Joined: 2023 Jul
    Reputation: 24
    #9
    2023-08-31, 06:04 AM (This post was last modified: 2023-08-31, 06:04 AM by bitmap. Edited 1 time in total.)
    Weird question...who owns the files in your persistent volumes for Jellyfin? Your 1000 user? Or a different user? You can try running the container as privileged and see if that works. It's a bit of a security risk, but as a troubleshooting step, it will provide you with an indication of what's going on.

    You may also be able to run the container as privileged, update the dynamic links, remove the privileged line, and everything is peachy. Added the line between container_name and network_mode.

    Code:
    version: '3.5'
    services:
      jellyfin:
        image: jellyfin/jellyfin
        container_name: jellyfin
        privileged: true
        network_mode: 'host'
        volumes:
          - /home/erik/srv/jellyfin/config:/config
          - /home/erik/srv/jellyfin/cache:/cache
          - /home/erik/Media:/media
        restart: 'unless-stopped'
        runtime: nvidia
        deploy:
          resources:
            reservations:
              devices:
                - capabilities: [gpu]
    Jellyfin 10.10.7 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage

    [Image: AIL4fc84QG6uSnTDEZiCCtosg7uAA8x9j1myFaFs...qL0Q=w2400]
    erik15
    Offline

    Junior Member

    Posts: 6
    Threads: 1
    Joined: 2023 Aug
    Reputation: 0
    #10
    2023-09-02, 11:31 AM
    (2023-08-31, 06:04 AM)bitmap Wrote: Weird question...who owns the files in your persistent volumes for Jellyfin? Your 1000 user? Or a different user? You can try running the container as privileged and see if that works. It's a bit of a security risk, but as a troubleshooting step, it will provide you with an indication of what's going on.

    You may also be able to run the container as privileged, update the dynamic links, remove the privileged line, and everything is peachy. Added the line between container_name and network_mode.

    Code:
    version: '3.5'
    services:
      jellyfin:
        image: jellyfin/jellyfin
        container_name: jellyfin
        privileged: true
        network_mode: 'host'
        volumes:
          - /home/erik/srv/jellyfin/config:/config
          - /home/erik/srv/jellyfin/cache:/cache
          - /home/erik/Media:/media
        restart: 'unless-stopped'
        runtime: nvidia
        deploy:
          resources:
            reservations:
              devices:
                - capabilities: [gpu]

    I don't have any other user on the server just the erik one and the root.

    Also I think by not using a uid:guid option I am using a privileged user(root) as the jellyfin documentation says.
    https://jellyfin.org/docs/general/instal...container/

    Code:
    Using Docker Compose

    Create a docker-compose.yml file with the following contents. Add in the UID and GID that you would like to run jellyfin as in the user line below, or remove the user line to use the default (root).

    Is this different to "privileged:true"?
    Pages (2): 1 2 Next »

    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode