Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEST_FINAL is not writable #3

Open
Caledrith opened this issue Dec 23, 2023 · 5 comments
Open

DEST_FINAL is not writable #3

Caledrith opened this issue Dec 23, 2023 · 5 comments

Comments

@Caledrith
Copy link

Caledrith commented Dec 23, 2023

I apologize if there is something about docker I don't understand, but I attempted to build a docker compose yml to run this container.

version: "2.1"
  services:
    seedbox-fetcher:
      container_name: seedbox-fetcher
      image: layr/seedbox-rclone-fetch-extract
      environment:
       - REMOTE=seedbox
       - SRC_DIR=/torrents/rtorrent
       - DEST_INITIAL=/path/to/initial
       - DEST_FINAL=/path/to/final
       - PUID=1000 
       - PGID=1000
    volumes:
     - /media:/data 
     - /path/to/config:/config 

(1000:1000 is my normal user on the vm)

When I locally use the config file (which is contained on my vm) to sync, it works. In the container logs, the container gives me this log essentially over and over

crond: USER abc pid 1184 cmd sync.sh sendmail: can't connect to remote host (127.0.0.1): Connection refused

When I use sudo docker exec -it --user abc seedbox-fetcher /bin/sh to get into the container, I get the following error when I run ./sync.sh

[sync-34] ERROR DEST_FINAL /path/to/final] is not writable

This seems insane to me as the /path/to/final permissions are drwxrwxrwt 2 abc abc 4096 Dec 23 08:23 Downloads (I realize this is insecure, I just have been beating my head against the wall about this forever).

When I execute just echo "$DEST_FINAL is $( [[ -w "$DEST_FINAL" ]] && echo "writable" || echo "not writable" )", I get that the folder is writable. Only within the script does it fail, and I've altered the script to export the condition that's giving this error in common.sh.

Is there something I'm missing?

@laur89
Copy link
Owner

laur89 commented Dec 25, 2023

Could you post the actual contents of the compose file? Current example shows no volume mapping for /path/to/{initial,final}. Also ls -lt output of said folders would be nice to verify dir permissions.

@Caledrith
Copy link
Author

version: "2.1"
  services:
    seedbox-fetcher:
        container_name: seedbox-fetcher
        image: layr/seedbox-rclone-fetch-extract
        environment:
         - REMOTE=seedbox
         - SRC_DIR=/torrents/rtorrent
         - DEST_INITIAL=/data/rclone-tmp
         - DEST_FINAL=/data/Downloads
         - PUID=1000
         - PGID=1000
        volumes:
         - /media:/data 
         - /home/jmnemelka/.config/rclone:/config

/media on my vm is a mount of my NAS. docker is my vm name. As you can see, I've completely removed file restrictions from almost everything
image
1000 (the PUID/PGID in my compose) is that of my user.
image
Screenshot of confirmed permissions inside container
image

@laur89
Copy link
Owner

laur89 commented Jun 23, 2024

@Caledrith did you manage to get down to this? Back then was unable to reproduce it in any way.

@Caledrith
Copy link
Author

So sorry, I haven't touched it since I got frustrated haha. I'll see if I can check it out today.

@Caledrith
Copy link
Author

I finally got around to finding a solution, but I'm not happy with it.

Inside of common.sh is the validate_config_common() function, and for whatever reason, on the [[ -w "$DEST_FINAL" ]] and [[ -w "$DEST_INITIAL" ]] calls fails. When I run the commands via the terminal, it works, but not when it runs via the script. I deleted the two lines and the sync is working properly. I verified the right user and right user permissions are being utilized, and in the terminal, whether I use root or abc it works. Very strange behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants