linuxserver / docker-qbittorrent

GNU General Public License v3.0
1.03k stars 148 forks source link

[BUG] Can't write to mapped directory #282

Closed RostKost closed 7 months ago

RostKost commented 9 months ago

Is there an existing issue for this?

Current Behavior

BitTorrent can't write to the mapped directory

(W) 2024-01-10T16:39:28 - File error alert. Torrent: "Name of the torrent". File: "/downloads/media/Name_of_the_file". Reason: "Name_of_the_file file_stat (/downloads/media/Name_of_the_file) error: Permission denied"
(W) 2024-01-10T20:08:37 - Removed torrent but failed to delete its content and/or partfile. Torrent: "Name of the torrent". Error: "Permission denied"

Expected Behavior

No response

Steps To Reproduce

  1. Run container
docker run -d \
  --name=qbittorrent \
  -e PUID=1026 \
  -e PGID=100 \
  -e TZ=America/New_York \
  -e WEBUI_PORT=8080 \
  -p 8080:8080 \
  -p 16881:16881 \
  -p 16881:16881/udp \
  -v /volume1/docker/qbittorrent/config:/config:rw \
  -v /volume1/media/:/downloads/media/:rw \
  -e 'DOCKER_MODS'='linuxserver/mods:universal-stdout-logs' \
  -e 'LOGS_TO_STDOUT'='/config/qBittorrent/logs/qbittorrent.log' \
  --restart unless-stopped \
  lscr.io/linuxserver/qbittorrent:latest
  1. Login to WEBUI and add torrent with target location "/downloads/media/"

  2. Now, in the logs, the following appear "File error alert"

  3. Troubleshooting steps

Add torrent with target location "/downloads/" That works as a charm.

Login to the container and check permissions on the file system

root@qbt:/downloads# ls -l 
total 13311008
-rw-r--r-- 1 abc abc 17987838080 Jan 10 20:27 The.file.mkv
drwxr-xr-x 1 abc abc           0 Jan 10 20:09 incomplete
d--------- 1 abc abc        2556 Jan 10 20:25 media

Check permissions in the target directory

root@qbt:/downloads/media# touch 1
root@qbt:/downloads/media# ls -ls 
total 229483836
       0 ---------- 1 root root           0 Jan 10 20:57  1
       0 drwxrwxrwx 1 abc  abc         3252 Jan 10 09:39  @eaDir

Check permissions in the target directory on behalf of user "abc"

root@qbt:/downloads/media# su abc
root@qbt:/downloads/media# whoami
root
root@qbt:/downloads/media# sudo -u abc "touch 2"
bash: sudo: command not found

Environment

- OS: Synology DSM 7

toor@synology:~$ uname -a
Linux box 4.4.302+ #64570 SMP Tue Jun 13 21:40:10 CST 2023 x86_64 GNU/Linux synology_broadwellnk_3622xs+

CPU architecture

x86-64

Docker creation

docker run -d \
  --name=qbittorrent \
  -e PUID=1026 \
  -e PGID=100 \
  -e TZ=America/New_York \
  -e WEBUI_PORT=8080 \
  -p 8080:8080 \
  -p 16881:16881 \
  -p 16881:16881/udp \
  -v /volume1/docker/qbittorrent/config:/config:rw \
  -v /volume1/media/:/downloads/media/:rw \
  -e 'DOCKER_MODS'='linuxserver/mods:universal-stdout-logs' \
  -e 'LOGS_TO_STDOUT'='/config/qBittorrent/logs/qbittorrent.log' \
  --restart unless-stopped \
  lscr.io/linuxserver/qbittorrent:latest

Container logs

(W) 2024-01-10T16:39:28 - File error alert. Torrent: "Name of the torrent". File: "/downloads/media/Name_of_the_file". Reason: "Name_of_the_file file_stat (/downloads/media/Name_of_the_file) error: Permission denied"
(W) 2024-01-10T20:08:37 - Removed torrent but failed to delete its content and/or partfile. Torrent: "Name of the torrent". Error: "Permission denied"
github-actions[bot] commented 9 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.

pagdot commented 9 months ago

Seems like the /downloads/media directory has no permissions for anyone. This is probably the culprit. As this is most likely an issue with your setup and not a bug with the container, I'd recommend to ask for further support on the lsio discord server

LinuxServer-CI commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

Bierdusche commented 8 months ago

I have the same problem.

pagdot commented 8 months ago

@Bierdusche I'd recommend to ask for support on the lsio discord server