jaymoulin / docker-jdownloader

JDownloader 2 Docker Image (Multiarch) - 50M+ Downloads
https://brands.jaymoulin.me/me/docker-jdownloader
MIT License
180 stars 36 forks source link

Download directory on CIFS/SMB can only be mounted ro #129

Closed DaCHack closed 9 months ago

DaCHack commented 9 months ago

Output of docker inspect jdownloader --format='{{index .Config.Labels.version}}':

2.1.2-armhf

Description

SMB share for the downloads directory is mounted ro only and seemly cannot be forced to mount in rw mode.

Command line I used to start the container

Docker compose in Portainer:

  jdownloader:
    image: jaymoulin/jdownloader
    container_name: jdownloader
    network_mode: "host"
    restart: "unless-stopped"
    tty: true
    user: 0:0
    volumes:
      - /root/containers/jdownloader:/opt/JDownloader/app/cfg:rw
      - inbox:/opt/JDownloader/Downloads:rw
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MYJD_USER=xxxxxxxxxx@gmail.com
      - MYJD_PASSWORD=xxxxxxxxxxxx
      - MYJD_DEVICE_NAME=server
#      - XDG_DOWNLOAD_DIR=/opt/JDownloader/Downloads/jDownloader
    ports:
      - 3129:3129

volumes:
  inbox:
    driver: local
    driver_opts:
      type: cifs
      o: "username=xxxxx,password=xxxxxxxx,rw"
      device: "//192.168.1.2/inbox"

Steps to reproduce the issue:

  1. Run docker compose
  2. Try to download a file or create a file in the download folder via the console

Describe the results you received: MyJDownloader gives "Invalid download directory" Touch test in download directory via console gives read-only file system

Describe the results you expected: Directory is writable and downloads are stored there

Additional information you deem important (e.g. issue happens only occasionally):

Provide some logs (docker logs jdownloader)

docker logs jdownloader

149|Log.L.log 12/18/23, 5:41:25 PM - FINER [ org.appwork.loggingv3.LogV3(finer) ] -> Read Config(File): /opt/JDownloader/app/cfg/jd.controlling.faviconcontroller.FavIconsConfig.failedhosts.json

THREAD: 41
41|Log.L.log 12/18/23, 5:41:27 PM - FINEST [ org.appwork.loggingv3.LogV3(finest) ] -> jd.controlling.downloadcontroller.DownloadWatchDog@1ea7cfc State changed IDLE--1(31704528) -> RUNNING--1(23734786)

THREAD: 168
168|Log.L.log 12/18/23, 5:41:27 PM - FINER [ org.appwork.loggingv3.LogV3(finer) ] -> Init StorageHandler for Interface:org.jdownloader.controlling.hosterrule.HosterRuleConfig|Path:null

THREAD: 171
171|Log.L.log 12/18/23, 5:41:27 PM - INFO [ org.appwork.storage.JsonKeyValueStorage() ] -> Prefer (merged) JSon Storage from File: /opt/JDownloader/app/cfg/plugins/HOSTER/rapidgator.net.json

THREAD: 179
179|Log.L.log 12/18/23, 5:41:30 PM - FINER [ org.appwork.loggingv3.LogV3(finer) ] -> Read Config(File): /opt/JDownloader/app/cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.customdeviceips.json

THREAD: 357
357|Log.L.log 12/18/23, 5:41:32 PM - FINEST [ org.appwork.loggingv3.LogV3(finest) ] -> jd.controlling.downloadcontroller.DownloadWatchDog@1ea7cfc State changed RUNNING--1(23734786) -> STOPPING--1(21325974)
357|Log.L.log 12/18/23, 5:41:32 PM - FINEST [ org.appwork.loggingv3.LogV3(finest) ] -> jd.controlling.downloadcontroller.DownloadWatchDog@1ea7cfc State changed STOPPING--1(21325974) -> STOPPED_STATE--1(29164518)

findmnt

├─/var/lib/docker/volumes/nas-apps_inbox/_data                                                     //192.168.1.2/inbox cifs       ro,relatime,vers=3.1.1,cache=strict,username=xxxxxx,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.2,file_mode=0755,dir_mode
jaymoulin commented 9 months ago

Thank you for reporting this. If you find this product useful, please consider donation to help me continue maintain and create great products (PayPal donation Buy me a coffee Become a Patron)

I don't think the issue is related to this image nor to JDownloader but seems to be related to your configuration. Please, have a look at https://forums.docker.com/t/docker-compose-mount-samba-volume/132407/12

DaCHack commented 9 months ago

I was in fact just me not understanding how Portainer/Docker Manages the volumes.

I already tried to fix it by adding uid=0,gid=0,forceuid,forcegid,rw to the mount options and then updating the stack. But I needed to manually remove the old volume first. Now it works.