linuxserver / docker-sabnzbd

GNU General Public License v3.0
273 stars 66 forks source link

[BUG] Sabz cant write to incomplete directory despite having correct perms #222

Closed jamess60 closed 8 months ago

jamess60 commented 8 months ago

Is there an existing issue for this?

Current Behavior

When SABZ is first loaded, I get two errors: /downloads is not writable at all. This blocks downloads. /incomplete-downloads is not writable at all. This blocks downloads.

Subsequent download requests that hit sabz error out with the following: Failed making (/incomplete-downloads/demo-filename) Traceback (most recent call last): File "/app/sabnzbd/sabnzbd/filesystem.py", line 762, in create_all_dirs os.mkdir(path_part_combined) PermissionError: [Errno 13] Permission deied: '/incomplete-downloads/demo-filename'

Note that from the container shell, I can touch files in both directories without issue

Expected Behavior

These errors shouldnt occur and sabz should be able to download

Steps To Reproduce

  1. Deploy sabz with the following config:

Docker compose:

    sabz:
        container_name: sabnzbd
        image: linuxserver/sabnzbd:latest
        restart: always
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Etc/UTC
        volumes:
            - /containers/v-cont-01/data/plex/sabz:/config
            - /mnt/plex/cont-temp/sabz-completed:/downloads
            - /mnt/plex/cont-temp/sabz-incomplete:/incomplete-downloads
        ports:
            - 8585:8080

/mnt/plex resides on an SMB share. fstab:

//10.0.5.63/plex /mnt/plex cifs credentials=/root/.smbcredentials,file_mode=0777,dir_mode=0777 0 0

^ Yes, im aware this is too permissive, but its only for testing at this stage. I can restrict it when working

Environment

- OS: Debian 12
- How docker service was installed: Following the official docker.io steps for installing docker on debian 

https://docs.docker.com/engine/install/debian/

CPU architecture

x86-64

Docker creation

Docker compose - block is pasted in above section

Container logs

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

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

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

To support the app dev(s) visit:
SABnzbd: https://sabnzbd.org/donate

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

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

User UID:    1000
User GID:    1000
───────────────────────────────────────

[custom-init] No custom files found, skipping...
2024-03-25 15:06:24,864::INFO::[SABnzbd:1144] --------------------------------
2024-03-25 15:06:24,864::INFO::[SABnzbd:1145] SABnzbd.py-4.2.3
2024-03-25 15:06:24,864::INFO::[SABnzbd:1155] Commit = e7e06dea419a03bfe179af64b7a69398f652a7b9
2024-03-25 15:06:24,865::INFO::[SABnzbd:1157] Full executable path = /app/sabnzbd/SABnzbd.py
2024-03-25 15:06:24,865::INFO::[SABnzbd:1158] Arguments = "/app/sabnzbd/SABnzbd.py" "--config-file" "/config" "--server" "::"
2024-03-25 15:06:24,865::INFO::[SABnzbd:1159] Python-version = 3.11.8 (main, Feb 19 2024, 17:01:17) [GCC 13.2.1 20231014]
2024-03-25 15:06:24,866::INFO::[SABnzbd:1160] Dockerized = True
2024-03-25 15:06:24,866::INFO::[SABnzbd:1161] CPU architecture = x86_64
2024-03-25 15:06:24,871::INFO::[SABnzbd:1164] Platform = posix - Linux-6.1.0-16-amd64-x86_64-with
2024-03-25 15:06:24,872::INFO::[SABnzbd:1170] Preferred encoding = UTF-8
2024-03-25 15:06:24,872::INFO::[SABnzbd:1192] SSL version = OpenSSL 3.1.4 24 Oct 2023
2024-03-25 15:06:24,873::INFO::[SABnzbd:1201] Certifi version = 2024.02.02
2024-03-25 15:06:24,874::INFO::[SABnzbd:1202] Loaded additional certificates from /lsiopy/lib/python3.11/site-packages/certifi/cacert.pem
2024-03-25 15:06:24,874::INFO::[SABnzbd:1212] Using INI file /config/sabnzbd.ini
2024-03-25 15:06:24,874::INFO::[notifier:142] Sending notification: Error - download_dir directory: /incomplete-downloads error accessing (type=error, job_cat=None)
2024-03-25 15:06:24,874::ERROR::[filesystem:423] download_dir directory: /incomplete-downloads error accessing
2024-03-25 15:06:24,875::ERROR::[filesystem:423] complete_dir directory: /downloads error accessing
2024-03-25 15:06:24,876::INFO::[postproc:143] Loading postproc queue
2024-03-25 15:06:24,877::INFO::[scheduler:190] Scheduling RSS interval task every 60 min (delay=33)
2024-03-25 15:06:24,877::INFO::[scheduler:200] Scheduling version check in 10 minutes and daily at 11:3
2024-03-25 15:06:24,877::INFO::[scheduler:225] Setting schedule for midnight BPS reset
2024-03-25 15:06:24,878::INFO::[scheduler:234] Setting schedule for midnight server expiration check
2024-03-25 15:06:24,878::INFO::[scheduler:243] Setting schedule for server quota check
2024-03-25 15:06:24,878::INFO::[__init__:323] All processes started
2024-03-25 15:06:24,879::INFO::[SABnzbd:338] Template location for Glitter is /app/sabnzbd/interfaces/Glitter
2024-03-25 15:06:24,879::INFO::[SABnzbd:338] Template location for Config is /app/sabnzbd/interfaces/Config
2024-03-25 15:06:24,880::INFO::[misc:1230] [N/A] Running external command: ['/usr/bin/unrar']
2024-03-25 15:06:24,886::INFO::[misc:1230] [N/A] Running external command: ['/usr/bin/7zz']
2024-03-25 15:06:24,891::INFO::[misc:1230] [N/A] Running external command: ['/usr/local/bin/par2', '-V']
2024-03-25 15:06:24,895::INFO::[SABnzbd:423] SABCTools module (v8.1.0)... found!
2024-03-25 15:06:24,896::INFO::[SABnzbd:424] SABCTools module is using SIMD set: AVX2
2024-03-25 15:06:24,896::INFO::[SABnzbd:425] SABCTools module is linked to OpenSSL: True
2024-03-25 15:06:24,896::INFO::[SABnzbd:445] Cryptography module (v41.0.7)... found!
2024-03-25 15:06:24,896::INFO::[SABnzbd:451] par2 binary... found (/usr/local/bin/par2)
2024-03-25 15:06:24,896::INFO::[SABnzbd:458] UNRAR binary... found (/usr/bin/unrar)
2024-03-25 15:06:24,896::INFO::[SABnzbd:466] UNRAR binary version 7.00
2024-03-25 15:06:24,896::INFO::[SABnzbd:473] 7za binary... found (/usr/bin/7zz)
2024-03-25 15:06:24,897::INFO::[SABnzbd:475] 7za binary version 23.01
2024-03-25 15:06:24,897::INFO::[SABnzbd:481] nice binary... found (/bin/nice)
2024-03-25 15:06:24,897::INFO::[SABnzbd:485] ionice binary... found (/bin/ionice)
2024-03-25 15:06:24,897::INFO::[SABnzbd:1399] Starting web-interface on :::8080
2024-03-25 15:06:24,898::INFO::[_cplogging:213] [25/Mar/2024:15:06:24] ENGINE Bus STARTING
2024-03-25 15:06:25,002::INFO::[_cplogging:213] [25/Mar/2024:15:06:25] ENGINE Serving on http://:::8080
2024-03-25 15:06:25,002::INFO::[_cplogging:213] [25/Mar/2024:15:06:25] ENGINE Bus STARTED
2024-03-25 15:06:25,003::INFO::[SABnzbd:1444] Starting SABnzbd.py-4.2.3
2024-03-25 15:06:25,005::INFO::[dirscanner:111] Dirscanner starting up
2024-03-25 15:06:25,006::INFO::[panic:239] Launching browser with http://127.0.0.1:8080/sabnzbd
2024-03-25 15:06:25,008::INFO::[notifier:142] Sending notification: SABnzbd - SABnzbd 4.2.3 started (type=startup, job_cat=None)
2024-03-25 15:06:25,009::INFO::[zconfig:61] No bonjour/zeroconf support installed
2024-03-25 15:06:25,009::INFO::[ssdp:108] Serving SSDP on 172.18.0.20 as SABnzbd
2024-03-25 15:06:25,023::INFO::[notifier:142] Sending notification: Warning - /incomplete-downloads is not writable at all. This blocks downloads.
To prevent all helpful warnings, disable Special setting 'helpful_warnings'. (type=warning, job_cat=None)
2024-03-25 15:06:25,023::WARNING::[misc:94] /incomplete-downloads is not writable at all. This blocks downloads.
To prevent all helpful warnings, disable Special setting 'helpful_warnings'.
2024-03-25 15:06:25,025::WARNING::[misc:94] /downloads is not writable at all. This blocks downloads.
To prevent all helpful warnings, disable Special setting 'helpful_warnings'.
2024-03-25 15:06:25,025::INFO::[database:576] Scheduled history purge
[ls.io-init] done.
2024-03-25 15:07:19,785::INFO::[nzbparser:87] Attempting to add DOWNLOAD-NAME
2024-03-25 15:07:19,794::INFO::[filesystem:746] Creating directories: /incomplete-downloads/DOWNLOAD-NAME
2024-03-25 15:07:19,795::INFO::[notifier:142] Sending notification: Error - Failed making (/incomplete-downloads/DOWNLOAD-NAME) (type=error, job_cat=None)
2024-03-25 15:07:19,794::ERROR::[filesystem:768] Failed making (/incomplete-downloads/DOWNLOAD-NAME)
Traceback (most recent call last):
  File "/app/sabnzbd/sabnzbd/filesystem.py", line 762, in create_all_dirs
    os.mkdir(path_part_combined)
PermissionError: [Errno 13] Permission denied: '/incomplete-downloads/DOWNLOAD-NAME'
github-actions[bot] commented 8 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.

j0nnymoe commented 8 months ago

This is going to be due to your permissions that you've set on your remote mounts. They need to be mounted/owned by the same user that is used for deploying the container.

Not a bug with the container, it's a configuration/permissions issue on your host.

jamess60 commented 8 months ago

Thanks for the quick reply.

The SMB mount is mounted as 0777, the root user is running the container, and the GID/UID is set to 1000 (unsure if it should be 0 instead?)

The user on the SMB server its self has full read write to that share. Unsure what else I could do to make this any more permissive?

jamess60 commented 8 months ago

Fixed - seems to work only if you create a docker smb volume, it doesnt like you mounting the smb share within linux and mapping it to a local path