-
Notifications
You must be signed in to change notification settings - Fork 63
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
Not Able to Delete Files #125
Comments
Hi there, long text, super strange issue - I never encountered a similiar issue to be honest. can you check the filesystem on the host, the permissions should be the same (at least if you look at the ids) it honestly doesn't make sense that you're not able to delete can you reproduce this with a different client? like a mac, pc or desktop linux? I suspect that maybe the ubuntu container has some issues - containers have a mutable filesystem which is stacked on top of each other - maybe this is some sort of security mechanism, although you should be able to delete files manually can you check/list all your options? (i suspected read only mounts, but you said you can create files) anything strange int the logs? have you tried an older version of this container? |
also maybe you can rety this using this minimal configuration: I also noted a issue with your configuration please use the vfs like that
and make sure on the host, that the folder which is created has permissions like |
Hi @MarvAmBass loving the rapid reply ❤️
1)
|
What kind of hardware device is mounted on the docker host? It just doesn't make sense You can remove the file on the host directly, am I right? The share is also not mounted in a special unusual way - am I right? |
Maybe you have some special attributes active 'lsattr -a your/path'? Also maybe some apparmor / selinux policies stand in your way and only allow creating / appending to files. |
Yes, I can remove the file on my host, and nope, I mount the folder on the host to the samba share via the docker compose:
This is on the samba` docker container:
I don't think that is the case on my Macbook at least |
In addition to the above, this is the results from running
|
ahh so your system is a docker for mac system, right? |
I'm going to test your setup on my mac, we will see what's wrong, or if I run into the same issue |
That's correct. I'm running Docker Desktop on my Macbook. I have a My |
Hi @MarvAmBass Update from me, I have managed to get this to work, but I have removed the volume mounts in the So instead of:
I have changed to:
And I can create and delete files within the Ubuntu So it seems that Macbook realllyy doesn't like something, and I'm not enough of a macbook expert to see what is going on. All of the permissions across the board looked fine to me. All I did was remove the I might try a third container to somewhat "replicate" my macbook, but make it another Ubuntu container, just so I can put that Let me know what your investigations find, this is one of those mysteries that have really stumped me over the last couple of days and I'd really like to find out what it is about MacOS (or maybe even the way mine is configured) that doesn't allow this to work. |
yeah I also needed some time to get the docker compose to work, and my ubuntu to mount the share of the samba container. at the end I was able to mount it, but the permissions were different from the permissions my mac system. changing owner was successful but the chmod didn't fully map into the container. But I wasn't even able to create a file on the samba share. Samba connections to a linux system running my container had no issues.
I entered the ubuntu container and mounted the share using: You have to keep in mind that Docker Desktop ist a very hacky solution for macOS and Windows - it runs some kind of virtual machine under the hood and mounts different ports, filesystem mounts etc. from and to the vm and inside the containers. I'll stop the investigation at this point. I don't see a reason to use macos as a host system - they alread ship samba. |
Yep no problems, thanks @MarvAmBass I have also been able to connect to the single Samba container that is sharing the local My setup by the way wasn't to host a long-term share, but instead write a Java / Spring application that reads/writes files to an SMB share, and we needed to be able to stand up a local samba share to do some local testing of the code. In our case, we will just roll a custom image that creates that Thanks again 👍 |
I added this issue to my |
Hi averyone. I spend some time with this issue and now I can confirm the same problem on linux.
After switch to docker-dektop with the same compose file
If I found some solution, I will share it there. I will need it in future for some my customers solutions. |
does the user |
Yes, UID is the same as OS. So
I will try enable debug in docker desktop ;-) EDIT: Noo, sorry i have not subsribed to docker Pro :( |
okay that seems like it should work... |
Hmm, I googling some time, problem is in virtualization solution and something with permissions. After create group with UID 100999, create folder/files works, but when i try delete, still getting NT_STATUS_NOT_SUPPORTED. EDIT: same situation, if i run samba container in privileged mode. |
I'm not sure If I understand - I thought you're using ubuntu as a host - but I do get, that as soon as you play around with shared filesystems you might run into problems due to mapping problems of uid etc. |
I'll be more specific. Yes, I use ubuntu as host + classic docker + docker dekstop for my comfort when debuging (switch docker context is annoying and tedious). |
ahhh I think that's the problem - with the extra vm it messes up your mapping from local machine into the container. |
Nice, that not the same problem. Docker desktop for linux run on VM, but for macOS runs almost natively, but only use use VirtioFS. |
Nice and good day. Finally i identify root of problem. I had my app in docker container and i need change file permission and files/folders owner (for generate video thumbmails). My bash script run with supervisord under root user.
I tested on: Problem commands:
This code generated errrors below only in docker desktop. In default docker works like a charm :-)
So, I use chown/chmod check in my script and this indicate situation, that my cointainer run in docker desktop :-) Second problem in my case is use inotifywait in my script. If my cointainer ruuns in docker desktop, inotifywait not catch DELETE event. In default desktop works without problem. I found lot of information about daemon.json settings "userns-remap": "default", but this not work for me (docker desktop not suport it and not start if add this option) Finally, this is all reasons why I will stop use docker desktop and why Your samba container not work correctly under docker desktop (in Linux/macOS, maybe in Windows too). I mean, than problem can be close, because this cannot be fixed in this repo :-) |
@petrmatula190 thanks, I'll add this info into the troubleshooting markdown file and maybe notice docker desktop problems in the readme! |
I am getting quite a lot of issues trying to delete files / directories on a Samba share.
I am able to create them without issue, but deleting them is where I just cannot get it to work.
docker-compose.yaml
When I docker exec onto the samba container, I can see that the
/shares/home
is owned by root, I change this usingchown -R 1000:1500 shares/
I use a separate Ubuntu container in order to mount the Samba share so I can test it. I originally did this with my Macbook but I had problems there so I wanted to remove the possibility that my Macbook was the problem. This is what is in my Dockerfile for the Ubuntu image:
Once I do a
docker-compose up --force-recreate --build
, both samba and ubuntu containers are up. I exec onto my Ubuntu container and runmount -a
, i then go to/mnt/home
and I can see all of the files/folders there that exist on my Macbook. I can even create files.They even show that they are owned by 1000:1500 - which is the
samba
uid (1000) andsambausers
gid (1500). However, I just cannot delete any files/directories. The error I get isThe fact that I can write new ones shows that write access is fine, but I have been racking my brains for the last couple of days trying to figure out why deletes don't work. I have tried all sorts of combinations in the
smb.conf
file. From forcing users, to forcing groups, to using root, to creating 777 masks, nothing I do get's deletes to work.The text was updated successfully, but these errors were encountered: