AdrienPoupa / docker-compose-nas

Simple Docker Compose NAS featuring Sonarr, Radarr, Prowlarr, Jellyfin, qBittorrent, PIA VPN and Traefik with SSL support
990 stars 127 forks source link

Permission denied error when attempting to download a torrent #28

Closed jacksonv1lle closed 1 year ago

jacksonv1lle commented 1 year ago

Hi there.

I am not able to get a torrent to start downloading in qBittorrent . It fails with a 'permission denied' error when attempting to write to the host file system.

Here is the error from qbittorrent.log: (W) 2023-08-14T14:49:58 - File error alert. Torrent: "2023-05-03-raspios-bullseye-armhf.img.xz". File: "/mnt/data/torrents/2023-05-03-raspios-bullseye-armhf.img.xz". Reason: "2023-05-03-raspios-bullseye-armhf.img.xz mkdir (/mnt/data/torrents/2023-05-03-raspios-bullseye-armhf.img.xz) error: Permission denied"

I have an external USB drive mounted in /mnt/data with 777 permissions. There is also a directory called torrents inside the data directory.

I am using these settings in the .env file:

USER_ID=1000
GROUP_ID=1000
TIMEZONE="Europe/London"
DATA_ROOT="/mnt/data"
DOWNLOAD_ROOT="/mnt/data/torrents"

The user and group ids are correctly assigned.

I have noticed a couple of discrepancies that I don't understand. In the qBittorrent section of the Readme it says: Set the default save path to /data/torrents in Settings I guess this should say /mnt/data/torrents right?

Also I noticed that in the qBittorrent section of the docker-compse.yml, it has:

volumes:
  - ./qbittorrent:/config
  - ${DOWNLOAD_ROOT}:/data/torrents

Is the DOWNLOAD_ROOT mapping correct here? In the qbittorrent container documentation they use this:

volumes:
  - /path/to/appdata/config:/config
  - /path/to/downloads:/downloads

You can see that the DOWNLOAD_ROOT should map to /downloads. Is that right?

Thanks in advance

jacksonv1lle commented 1 year ago

I was able to resolve the issue by doing the following:

In the qBittorrent section of the docker-compose.yml file, ensure the DOWNLOAD_ROOT is mapped to /downloads:

volumes:
    - ./qbittorrent:/config
    - ${DOWNLOAD_ROOT}:/downloads

In the the qBittorrent.conf file, ensure Session\DefaultSavePath is set to /downloads

[BitTorrent]
Session\DefaultSavePath=/downloads