Permission problems on home server

Hello friends.

I need some help.

I am a real amateur when it comes to this stuff to bear with me. I have spent days banging my head against a wall before this and I’ve run out of brain function at this point.

I am trying to set up my home server. It’s basically a media server with some QoL docker containers (that’s the goal at least). Unfortunately I’m stuck at one of the first hurdles.

I’ve set up a Samba share to be able to access one storage directory located on the server on a few machines in the house. It seems to be working fine.

I also have set up qbittorrent in docker-compose, with the download volume also being located in this directory.

Unfortunately, I have not been able to get this to function as intended. The volume/folders created by qbittorrent are unable to be written to from my windows machines via the Samba share. The result is ‘permission denied’. If I create the folders with my windows machines, qbittorrent can not save/download to them (webUI shows ‘Erroring’ instead of ‘Downloading’, log shows ‘permission denied’).

I have made a group on the server and added the docker-user and the smb-user into it with the following.

sudo addgroup group-name
sudo adduser docker-user group-name
sudo adduser smb-user group-name
sudo chgrp group-name /path/to/storage
sudo chgrp -R group-name /path/to/storage/*
sudo chmod 775 /path/to/storage
sudo chmod -R 775 /path/to/storage/*

Here is the end of my smb.conf file.

[Storage]
    comment = Primary Storage
    path = /path/to/storage
    read only = no
    force user = smb-user
    create mask = 775
    directory mask = 775

I have also tried this with force group = group-name with no success. smbstatus prints out ‘nogroup’ under groups, if that means anything.

This the pertinent part of my docker-compose.yml file.

  qbittorrent:
    container_name: qbittorrent
    image: lscr.io/linuxserver/qbittorrent:latest
    environment:
      PUID: ${PUID}
      PGID: ${PGID}
      TZ: ${TZ}
      WEBUI_PORT: 8080
    volumes:
      - './qbittorrent/config:/config'
      - '/path/to/storage/Downloads:/downloads'
    ports:
      - 8080:8080
      - 6881:6881
      - 6881:6881/udp
    restart: unless-stopped

In my .env file, PUID is docker-user and PGID is group-name.

Any help would be greatly appreciated.

Apologies for the incoherent rambling. I hope to make this more succinct when I recover :smiley:

Kind regards.

When you look at the folders created by qbit and by windows users, who is the owner an what are the permissions on those?

Hello @Zorak. Thanks so much for your time.

Upon ls -l /path/to/storage I get the following output.

drwxr-xr-x 2 docker-user group-name 4096 Sep 14 20:27 Downloads (qbittorrent)

drwxrwxr-x 2 smb-user nogroup 4096 Sep 14 20:28 FolderMadeInWindows

Hope this helps.

I’ll compare to mine when I get home. I don’t use docker, but I did have issues with permissions when doing things directly on the server vs. doing them from windows client. I had to chown / chmod the existing folders, create a common group for all users and set the permissions for it, which is exactly what you seem to be doing, but the ls output looks like the group didn’t fully catch. I’m afraid I didn’t document my steps, so I may be forgetting something, that’s why I want to compare the result and try to reverse-engineer it from there.

1 Like

apparently its a known bug with windows smb 3 version numbers not being recognised and parsed correctly.

different application doing shares but same bug.

yep thats from 2018 the same bug shows up in 22 and 23 aswell coz win 10 smb 3 hasnt been updated to 4+

I’ve changed the smb.conf file back to force group = group name and now ls -l /path/to/storage prints out

drwxr-xr-x 2 docker-user group name 4096 Sep 14 20:27 Downloads

drwxrwxr-x 2 smb-user group name 4096 Sep 13 21:33 FolderMadeInWindows

But still, I can not simultaneously have both writing to Downloads from my windows machine enabled without qbittorrent downloading resulting in ‘Erroring’ due to permission issues.

Here’s something potentially interesting:
If I delete the Downloads folder and restart the server, once the qbittorrent container recreates it, the ls -l output is:
drwxr-xr-x 2 docker-user group name 4096 Sep 15 01:24 Downloads

Once I execute chmod 775 /path/to/storage/Downloads the output is:
drwxrwxr-x 2 docker-user group name 4096 Sep 15 01:31 Downloads

Which obviously makes sense to an extent, but doesn’t explain why in any situation it doesn’t allow qbittorrent to download into said folder.

In case the qbittorrent log helps, this is the error:

File error alert. Torrent: "torrent example". File: "/Downloads/torrent example". Reason: "torrent example file_open (/Downloads/torrent example) error: Permission denied"

So, what I get is something like (User 1 and User2 are members of sambashare):

-rwxrw-r-- 1 User1 sambashare 10782 nov 5 2020 Created_In_Win_Client
-rwxrwxrwx 1 User1 User1 19131 jun 13 2017 Created_In_Host
-rwxrw---- 1 User2 sambashare 25159 jul 4 2020 Created_In_Win_Client

for files and

drwxrwx--- 8 User1 User1 20 oct 16 2017 Created_In_Host
drwxrws--- 2 User1 sambashare 55 ago 31 09:30 Created_In_Win_Client
drwxrws--- 16 User2 sambashare 59 ene 20 2023 Created_In_Win_Client

for directories, all writeable from a win client as User1. However, there is another directory with:
drwxr-sr-x 3 User2 sambashare 3 mar 12 2023 Other_Folder

created from a Windows client, which I currently cannot access as User1. However, I don’t remember manually changing the permissions for every properly working folder…

In any case, now that you fixed group membership, I see no difference between my working folders and yours, but then again, I cannot replicate the Docker part… :thinking:

Thanks for this. I will try stare at it for some time and see if some gears start churning in my meat head.

I’m now preoccupied with trying to find a single condition in which qbittorrent can actually function regardless of Samba issues. Still a permissions error, but one that has totally stumped me as the directory was made by qbittorrent via docker itself.

EDIT: Well, I have sorted the qbittorrent downloading issue. Literally changing this line in the compose.yaml file:

- '/path/to/storage/Downloads:/downloads'
to
- '/path/to/storage/downloads:/downloads'

Go figure.

2 Likes