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

Edit existing file, but cannot create (continued) #22

Open
colearendt opened this issue Nov 5, 2018 · 6 comments
Open

Edit existing file, but cannot create (continued) #22

colearendt opened this issue Nov 5, 2018 · 6 comments

Comments

@colearendt
Copy link

@sjiveson I am running into this same issue and attempting to resolve based on your comments on Jan 29 on #7 / #17 . Unfortunately, I am not very experienced with NFS, so I do not completely follow this advice. What should I change? Should I just remove the no_root_squash option or replace it with something?

The no_root_squash option is entirely different and changes to -mapall=. Would you be able to try building the container from scratch after changing this in the nfs-server-alpine/confd/tmpl/exports.tmpl file?

FWIW, this error has popped up between docker containers (client / server as separate containers) on my Mac host using the same UIDs, as well as with Mac as the client. Editing files and reading files works fine, but creating fails at the following line (in an strace):

openat(AT_FDCWD, "/mnt/tmp/blah.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EIO (Input/output error)
@colearendt
Copy link
Author

colearendt commented Nov 5, 2018

Hooray! Removing the no_root_squash option fixed things! Now files get mounted with owner/group nobody/nobody, but that's resolved easy enough with chown -R root:root .... workable, at least! 😄 I will poke a bit at this mapall shenanigans and see if I can make that clean things up a little.

EDIT: No luck so far. Just creating a bunch of permission errors for myself. Probably a function of having no idea what I'm doing.

Related Mac / NFS link

@sjiveson
Copy link
Owner

I wonder if all_squash,anonuid=NNN,anongid=NNN may help here as this will make all requests appear to come from user NNN. If the source user is root, perhaps root_squash,anonuid=NNN,anongid=NNN.

@St3S0f
Copy link

St3S0f commented Mar 30, 2020

I just run into this (macos server, linux client) and tested a bunch of combination of different no_root_squash, all_squash, anonuid,anongid combos... I can delete and modify existing files in the share, but attempting to create a new file results in a Input/output error. If someone has any clue I'd be happy to test different config parameters.

@colearendt
Copy link
Author

colearendt commented Mar 31, 2020

In case it is helpful, these are the options I ended up using. I am sharing from mac to mac and haven't tried from mac to linux, but this works for me:

rw,async,fsid=0,no_subtree_check,no_auth_nlm,insecure,crossmnt

I set these based on my PR in #23. Worth noting that I believe no_root_squash is not supported on Mac OSX. I forget where I learned that 🤷‍♂ As a result, keep in mind that the root user does not have super powers. In fact, it has the nobody powers of the least privileged user on the system. It is best to try writing as a different user.

Also be sure to set --privileged or privileged: true

@liechtjc
Copy link

liechtjc commented Jan 5, 2023

I'm trying to override the NFS option and remove the no_root_squash option by using

-e SET_OPTS=rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure or 
-e NFS_OPTS=rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure 

when starting the container but, when I check with docker logs nfs, I still have the default options:

Displaying /etc/exports contents:
/nfsshare *(rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure,no_root_squash)

--> I'm not really an expert but can someone tell me how to alter the nfs mount options?

@liechtjc
Copy link

liechtjc commented Jan 9, 2023

Fixed as described in #23 with fork https://github.com/kvalev/nfs-server-alpine

docker run -d --name nfs --privileged -p 2049:2049 -e "PERMITTED=*" -e "NFS_OPTS=rw,async,fsid=0,no_subtree_check,no_auth_nlm,insecure" ....

I'm trying to override the NFS option and remove the no_root_squash option by using

-e SET_OPTS=rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure or -e NFS_OPTS=rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure

when starting the container but, when I check with docker logs nfs, I still have the default options:

Displaying /etc/exports contents: /nfsshare *(rw,fsid=0,async,no_subtree_check,no_auth_nlm,insecure,no_root_squash)

--> I'm not really an expert but can someone tell me how to alter the nfs mount options?

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

4 participants