linuxserver / docker-sonarr

GNU General Public License v3.0
809 stars 141 forks source link

[BUG] Optional volumes mounted with incorrect permissions when running in rootless Docker #299

Closed Razerfish closed 2 months ago

Razerfish commented 2 months ago

Is there an existing issue for this?

Current Behavior

Optional volumes such as /tv and /downloads are mounted as being owned by root rather than by user abc when running in rootless Docker.

Expected Behavior

The aforementioned volumes should be mounted with user abc as the owner as they are when running with non-rootless Docker.

Steps To Reproduce

  1. In Ubuntu 24.04 with Docker installed from get-docker.sh from https://get.docker.com and Docker rootless installed via dockerd-rootless-setuptool.sh.
  2. With this file structure:
    /home/fiona/
    ├── downloads
    ├── sonarr
    └── tv
  3. Use the example compose file with paths updated to reflect the existing file structure.
  4. Attempt to configure a root directory under Settings>Media Management.

Environment

- OS: Ubuntu 24.04
- How docker service was installed: `get-docker.sh` and `dockerd-rootless-setuptool.sh`

CPU architecture

x86-64

Docker creation

services:
  sonarr:
    image: lscr.io/linuxserver/sonarr:latest
    container_name: sonarr
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - /home/fiona/sonarr/config:/config
      - /home/fiona/tv:/tv
      - /home/fiona/downloads:/downloads
    ports:
      - 8989:8989
    restart: unless-stopped

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support the app dev(s) visit:
Sonarr: https://sonarr.tv/donate

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: 4.0.8.1874-ls250
Build-date: 2024-08-09T23:32:52+00:00
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[Debug] Bootstrap: Console selected 
[Debug] Microsoft.Extensions.Hosting.Internal.Host: Hosting starting 
[Trace] EventAggregator: Publishing ConfigFileSavedEvent 
[Debug] MigrationController: Took: 00:00:04.2079016 
[Trace] EventAggregator: ConfigFileSavedEvent ~> ReconfigureLogging 
[ls.io-init] done.
[Warn] SonarrErrorPipeline: Invalid request Validation failed: 
 -- Path: Folder '/tv/' is not writable by user 'abc'
github-actions[bot] commented 2 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

aptalca commented 2 months ago

Optional volumes are entirely managed by the user. The container does not touch their permissions and expects them to be correct.

Also, we don't provide official support for rootless docker, but we can provide some help in discord https://docs.linuxserver.io/misc/support-policy/#reasonable-endeavours-support

Closing as it's not a bug