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

transmission permission denied #64

Closed
gwicksted opened this issue Aug 9, 2020 · 6 comments
Closed

transmission permission denied #64

gwicksted opened this issue Aug 9, 2020 · 6 comments

Comments

@gwicksted
Copy link

Issue appears to be related to transmission user id / group id but I'm unsure how to solve.

  • At first I thought it was because the "tv/" and "movies/" paths in Nefarious caused a double slash: "tv//xyz"
  • Then thought it was an issue with the destination being an nfs share so I changed it to a local path
  • Noticed it keeps setting my downloads directory to be owned by 911:911 which is the uid:gid used as a placeholder when something goes wrong
  • Was thinking perhaps the Nefarious .env user needed to exist so I created admin:admin and set that in the transmission user and password boxes
  • I've even tried setting the docker user to my uid:gid in the docker compose file ... and it just wouldn't start afterwards so I removed this

I'm a software dev but generally unfamiliar with docker and transmission.

Context: running in a debian 10 minimal vm inside proxmox using the instructions from this git repo to install.

transmission

@lardbit
Copy link
Owner

lardbit commented Aug 9, 2020

Hi @gwicksted,

Yes, I believe I know the issue and a solution. I really should mention this in the docs.

The transmission docker image (https://hub.docker.com/r/linuxserver/transmission) supports user & group variables so content is downloaded with those values.

For example, this is what I have in my docker-compose.yml for transmission.

environment:
      - PUID=1000
      - PGID=1000

This makes all the downloads have user id 1000 and group id 1000.

After you make the change don't forget to restart the transmission container.

Let me know if this works for you.

@gwicksted
Copy link
Author

That definitely solved the 911:911 user and group issue on the download folder.

However, even though the permissions now look perfect, it's still getting the same error. I force recreated the transmission docker image. After it failed, I even tried setting the transmission user and password in nefarious settings UI (not sure if that matters?) but again same error. So I cleared it and retried - same error. So I stopped all containers and started them all again. Still failed.

This is what the folder looks like now (which is perfect):

drwxrwxr-- 4 gwicksted gwicksted 4096 Aug 8 20:51 .
drwxr-xr-x 13 root root 4096 Aug 8 20:49 ..
drwxrwxr-- 2 gwicksted gwicksted 4096 Aug 8 20:51 complete
drwxrwxr-- 2 gwicksted gwicksted 4096 Aug 8 20:51 incomplete

I never see it create a file (or even a dot directory) under either folder while downloading. Transmission shows this in the details:

1.63 MB of 3.41 GB (0.05%), 344.0 kB Unverified

when it gets this error:

Permission denied (/var/downloads/complete/redacted-file-name.mp4)

A different one shows this:

1.21 MB of 2.05 GB (0.07%), 245.7 kB Unverified

when it gets this error:

Permission denied (/var/downloads/complete/.nefarious-unprocessed-downloads/tv/redacted-folder/redacted-filename)

Any thoughts where to go next? I have the suggested change applied to the docker-compose but that is the only difference from stock.

I see this with ps aux:

root 9147 0.0 0.0 200 4 ? S 17:00 0:00 s6-supervise transmission
gwickst+ 10325 0.3 0.6 15960 12748 ? Sl 17:10 0:00 /usr/bin/transmission-daemon -g /config -c /watch -f

.env is:

host download path

HOST_DOWNLOAD_PATH=/var/downloads

default user and password

NEFARIOUS_USER=admin
NEFARIOUS_PASS=admin

number of workers for searching and downloading.

leave as "0" to use the maximum number of CPUs on the system

NUM_CELERY_WORKERS=0

transmission-settings.json is:

{
"download-dir": "/var/downloads/complete",
"incomplete-dir": "/var/downloads/incomplete",
"rpc-whitelist": "*",
"rpc-host-whitelist-enabled": "false"
}

docker-compose.yml (partial - just showing transmission):

transmission:
image: linuxserver/transmission
volumes:
- ${HOST_DOWNLOAD_PATH:-/tmp}:/downloads
- ./transmission-settings.json:/config/settings.json:ro
ports:
- "9091:9091"
environment:
- PUID=1000
- PGID=1000

@gwicksted
Copy link
Author

If it helps, viewing the docker logs, it shows it couldn't create the folder itself due to permission denied... but it already exists.

[2020-08-09 21:21:24.515] Couldn't create "/var/downloads": Permission denied (/home/buildozer/aports/community/transmission/src/transmission-3.00/libtransmission/file-posix.c:243)

@lardbit
Copy link
Owner

lardbit commented Aug 9, 2020

I think I may know the issue. The abstraction that docker introduces with volumes from the host to container can start to get pretty confusing. I believe your issue is that you edited transmission-settings.json and defined download-dir as /var/downloads/complete but then left the file mounting for transmission in docker-compose.yml as /downloads when it should now be /var/downloads.

I think the line that's tripping you up is:

- ${HOST_DOWNLOAD_PATH:-/tmp}:/downloads

Since you told transmission to download to /var/downloads.

However, I suggest reverting transmission-settings.json back to it's original. It shouldn't need any editing unless you're adding additional transmission settings.

Try that and restarting transmission via the force-restart method.

Here's a quick docker host/container volume explanation. Every container has it's "own filesystem". So, in this case, transmission downloads to /downloads (Not on the host system. The host doesn't see any of this by default). But, since we told transmission to mount $HOST_DOWNLOAD_PATH to /downloads, it's actually downloading to your host path. Hope that makes sense. It's sort of like actual VM's where you mount host-to-vm.

@gwicksted
Copy link
Author

You got it! Thanks!!

I learned a lot since the start of this ticket. Willing to contribute. Possibly a .env for the PUID/PGID as well as some documentation.

@lardbit
Copy link
Owner

lardbit commented Aug 9, 2020

Nice! Yeah, I learned a lot too along the way with this project.

Glad you got it sorted out.

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