linuxserver / docker-transmission

GNU General Public License v3.0
577 stars 179 forks source link

[BUG] PUID and PGID not having any effect #276

Closed Lebo77 closed 6 months ago

Lebo77 commented 6 months ago

Is there an existing issue for this?

Current Behavior

When starting the container it creates volumes with UID of GID of 911, which are not a user on my system. I have PUID and PGID set to 1000 (which is the correct user) in my docker-compose file as environment items, as shown in the sample docker-compose.

Expected Behavior

Directories and files should be created with UID and GID of 1000.

Steps To Reproduce

On a linux system, Run a docker container with the following compose file:

bit:
    image: lscr.io/linuxserver/transmission:latest
    container_name: bit
    environment:
        - PUID=1000
        - PGID=1000
        - TZ=America/New_York
    volumes:

per the example, your locations may vary

    restart: unless-stopped
    network_mode: 'service:vpn'
    depends_on:
        - vpn

Environment

- OS:Ubuntu 22.04.4 LTS
- How docker service was installed: I can not recall. It works for 10 other docker containers however.

CPU architecture

x86-64

Docker creation

docker-compose pull
docker-compose up -d

Container logs

[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

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

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

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

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

User UID:    911
User GID:    911
───────────────────────────────────────

[custom-init] No custom files found, skipping...
Connection to localhost (127.0.0.1) 9091 port [tcp/*] succeeded!
[ls.io-init] done.
localhost:9091/transmission/rpc/ responded: success
Closing transmission session... done.
github-actions[bot] commented 6 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 6 months ago

Post the output of docker inspect bit

Lebo77 commented 6 months ago

Post the output of docker inspect bit

Went to set it up this morning to do this and it worked. Unclear why.

Close this bug report.

NautillusSs commented 1 month ago

When using Podman

For those trying to find out why the PUID and PGID mapping makes transmission create folders and files with a new user (and not the one provided with PUID) while using Podman, you need to set to set your PUID and PGID to 0 (root user). Podman will then launch your container in rootless as usual, the internal root == external user that launched the container, transmission will be run as internal root. Then externally you'll see the files and folders created using the same user that launched the container (your actual external user) and it'll be a total match of owner users.