samba icon indicating copy to clipboard operation
samba copied to clipboard

error '/var/cache/samba/msg.lock': has 0750 should be 0755

Open marininpa opened this issue 1 year ago • 9 comments

Hello, I am getting an error when running the docker-compose file. error: smbd version 4.21.3 started. Copyright Andrew Tridgell and the Samba Team 1992-2024 invalid permissions on directory '/var/cache/samba/msg.lock': has 0750 should be 0755

docker-compose file:

services: samba: image: dockurr/samba:latest container_name: samba ports: - 445:445

If I run the same thing on another Docker host, the container starts successfully.

marininpa avatar Feb 12 '25 22:02 marininpa

Any ideas?

marininpa avatar Mar 06 '25 07:03 marininpa

Can you re-pull the latest image and let me know if its fixed now?

kroese avatar Mar 06 '25 07:03 kroese

Yes, the problem exists.

`docker run -it --rm -p 445:445 -e "USER=samba" -e "PASS=secret" -v "/tmp/share:/storage" dockurr/samba

Unable to find image 'dockurr/samba:latest' locally

latest: Pulling from dockurr/samba

d62bb7eb03b5: Already exists

a129247ec79c: Pull complete

acbc6bba6dd0: Pull complete

21944e2851a6: Pull complete

Digest: sha256:7f40bc83f888b97b0e7690a9f0e8087e55e43378846ccff45b2031b493c7e191

Status: Downloaded newer image for dockurr/samba:latest

smbd version 4.21.4 started.

Copyright Andrew Tridgell and the Samba Team 1992-2024

invalid permissions on directory '/var/cache/samba/msg.lock': has 0750 should be 0755 `

marininpa avatar Mar 06 '25 08:03 marininpa

@marininpa Thanks, I made another change, can you try again one more time please.

kroese avatar Mar 06 '25 09:03 kroese

I did, but the problem persists. ` server:/tmp/share$ docker images | grep samba

dockurr/samba latest 41248a7e6ee0 2 hours ago 68MB

server:/tmp/share$ docker image rm 41248a7e6ee0

Untagged: dockurr/samba:latest

Untagged: dockurr/samba@sha256:7f40bc83f888b97b0e7690a9f0e8087e55e43378846ccff45b2031b493c7e191

Deleted: sha256:41248a7e6ee046dcc530c4e208c9d9fbb320c3c0b503bdd3ab917bf6043ed109

Deleted: sha256:a0780a4ee07926ba0bd1c94d2b119615e10da28f8fc4208628920c3bffc4055e

Deleted: sha256:3cc5611c0734f205f6123ca4012ed539d0b34630c53a84c68b2824c95ad0875c

Deleted: sha256:02a1b20addf6a61bd0aac27462d5975223b32f43f1224c7eefd09669f838ff23

server:/tmp/share$ docker run -it --rm -p 445:445 -e "USER=samba" -e "PASS=secret" -v "/tmp/share:/storage" dockurr/samba

Unable to find image 'dockurr/samba:latest' locally

latest: Pulling from dockurr/samba

d62bb7eb03b5: Already exists

30987dfb8c35: Pull complete

c93fb5e4f4eb: Pull complete

bfc05c80e242: Pull complete

Digest: sha256:a05da6bde17cd11781d12228c645f7956ae8766f3a63d48cac1fca2043a2a911

Status: Downloaded newer image for dockurr/samba:latest

smbd version 4.21.4 started.

Copyright Andrew Tridgell and the Samba Team 1992-2024

invalid permissions on directory '/var/cache/samba/msg.lock': has 0750 should be 0755

`

marininpa avatar Mar 06 '25 09:03 marininpa

Mmmh.. I added this line:

chmod -R 0755 /var/cache/samba/msg.lock

but it seems it has no effect, really strange.

I have no clue what is causing this problem, and the strange thing is that I cannot find any information on Google about it. I would expect more people running into the same thing.

kroese avatar Mar 06 '25 09:03 kroese

Yes, I also cannot find the reason for the problem. The issue is only on one Docker host

marininpa avatar Mar 06 '25 09:03 marininpa

Hi @marininpa

I tried to enforce this bug by settings UMASK on docker daemon, changed permissions in overlay in /var/lib/docker, even used podman with umask and such things. No chance to running into this issue :D

Are you still running into this problem? Can you please more about your system? OS, docker version, rootfull / rootless docker daemon? Are there any docker configuration you did? What about the filesystem on the host? Any uncommon filesystem you are using where dock stores it images? Default umask or overrides?

I hope this issue is already solved for you, but if not, please let me know. Maybe I can get another idea which may help you. But I think it must be fixed, because of the samba.sh script which does (does not help at the first run, when theese folders won't exist :D)

[ -d /run/samba/msg.lock ] && chmod -R 0755 /run/samba/msg.lock
[ -d /var/log/samba/cores ] && chmod -R 0700 /var/log/samba/cores
[ -d /var/cache/samba/msg.lock ] && chmod -R 0755 /var/cache/samba/msg.lock

dr3st avatar Jul 03 '25 16:07 dr3st

I have that problem now as well. @dr3st

Due to a faulty RAM module that constantly corrupted big data writes, I reinstalled my whole Openmediavault server from scratch before I found out (due to this https://github.com/dockur/windows/issues/1374) that it was a defect RAM.

I tried to reuse my compose yaml from the old installation but could not get the network to work anymore at all. I had a nice single IP setup where QEMU Remote access and Windows shared the same IP. With the help of Grok i got it to work now with Docker QEMU and Windows having both individual IPs via macvlan but my SMB share with the host is not working.

❯ Starting Windows for Docker v4.35...
❯ For support visit https://github.com/dockur/windows
❯ CPU: Intel Core i7 7700K | RAM: 14/16 GB | DISK: 170 GB (ext4) | KERNEL: 6.12.38+deb12-amd64...

❯ ERROR: Samba daemon failed to start!
smbd version 4.22.1-Debian-4.22.1+dfsg-1 started.
Copyright Andrew Tridgell and the Samba Team 1992-2025
invalid permissions on directory '/run/samba/msg.lock': has 0750 should be 0755
❯ Booting Windows using QEMU v10.0.0...
BdsDxe: loading Boot0004 "Windows Boot Manager" from HD(1,GPT,3B503733-AF92-4A88-A8E3-D701B1649406,0x800,0x40000)/\EFI\Microsoft\Boot\bootmgfw.efi
BdsDxe: starting Boot0004 "Windows Boot Manager" from HD(1,GPT,3B503733-AF92-4A88-A8E3-D701B1649406,0x800,0x40000)/\EFI\Microsoft\Boot\bootmgfw.efi

Grok gave me this script as a possible solution:

#!/bin/bash
# Fix Samba directory permissions
mkdir -p /run/samba
chmod 0755 /run/samba/msg.lock || chmod 0755 /run/samba  # Ensure correct permissions
# Start the original dockur/windows entrypoint
exec /usr/local/bin/docker-entrypoint.sh "$@"

Executed by adding this to the yaml:

volumes: 
   - ./entrypoint.sh:/entrypoint.sh  # Add custom entrypoint

But without luck. I then manually tried to change the permissions by executing the commands by hand but that also did not help.

If that helps:

  • The IP of my Host is fixed 192.168.1.84
  • the QEMU Container got .85 assigned and fixed in my DHCP
  • The Windows VM has .86 assigned and all 3 are visible in the network.

Instead of the "Host" computer visible in the network environment, I have a computer named with 192.168.1.85 if that helps but I cannot access it.

My Compose file: compose.yaml

And my macvlan config:

  {
    "Name": "vlan",
    "Id": "3f96f0f10b33c17d9a13cad46567c25595a5e0de3ba7523c9b9ae4c7c0aab939",
    "Created": "2025-09-10T18:33:02.531418073+02:00",
    "Scope": "local",
    "Driver": "macvlan",
    "EnableIPv4": true,
    "EnableIPv6": false,
    "IPAM": {
      "Driver": "default",
      "Options": {},
      "Config": [
        {
          "Subnet": "192.168.1.0/24",
          "IPRange": "192.168.1.0/24",
          "Gateway": "192.168.1.1"
        }
      ]
    },
    "Internal": false,
    "Attachable": false,
    "Ingress": false,
    "ConfigFrom": {
      "Network": ""
    },
    "ConfigOnly": false,
    "Containers": {
      "a14e2091397fa4c8b922d2ae8c0d737c718b2ef954da1a6f6ad453ac77267112": {
        "Name": "windows",
        "EndpointID": "50d885a8a01f4f803da2daab6b15fbb010c3564fb617585d413c7e41a1ab1d44",
        "MacAddress": "fa:54:99:07:42:56",
        "IPv4Address": "192.168.1.85/24",
        "IPv6Address": ""
      }
    },
    "Options": {
      "parent": "enp0s31f6"
    },
    "Labels": {}
  }

b14ckyy avatar Sep 10 '25 18:09 b14ckyy