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
file module assumes it can do operations as salt user (root) then modify perms #45067
Comments
As the error is thrown by OS, a longshot would be SELinux. Is it enabled? Are there any notes about that access in /var/log/secure? |
I've disabled SElinux and the issue persists. No messages in |
I tried writing the file locally then using For now I'm writing locally and using a |
Was this working previously? Glancing at the code it looks like it might be trying to create a temp directory on that nfs mount without using the auth of the user. |
I've not tried using it before on an NFS mount so can't confirm if it worked previously. From the error I would agree it's during the temp file creation. |
Just run into the same issue again with |
Actually after looking at the code it is doing exactly that:
So the user salt is running as (root in my case) is creating the dir then using |
ahhh that makes sense nice find. Looks like we will need to create the dir as the user specified here. Please feel free to give a go at a PR for this. Thanks for the extra investigation here :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
This is still an issue. |
Thank you for updating this issue. It is no longer marked as stale. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
This is still an issue |
Thank you for updating this issue. It is no longer marked as stale. |
I think this is an issue with This also fails with on MacOS read only file system. Minimal code extracted from Salt: >>> import salt.utils.files
>>> import os
>>> os.getcwd()
'/'
>>> z = salt.utils.files.mkstemp(suffix="", dir=None)
# Salt by default passes in a dir="" which uses the CWD. Use of None lets Python choose.
>>> z = salt.utils.files.mkstemp(suffix="", dir="")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/salt/lib/python3.7/site-packages/salt-3002.5-py3.7.egg/salt/utils/files.py", line 106, in mkstemp
fd_, f_path = tempfile.mkstemp(*args, **kwargs)
File "/opt/salt/lib/python3.7/tempfile.py", line 340, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "/opt/salt/lib/python3.7/tempfile.py", line 258, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
OSError: [Errno 30] Read-only file system: '__salt.tmp.x7rmqfjp' |
Description of Issue/Question
file.managed
is unable to write to a nfs mountSetup
Create an nfs share, mount it on the minion.
Steps to Reproduce Issue
touch /path/to/nfs/share/test
Errors
nfs mount details:
192.168.10.13:/nfs/blah on /path/to/nfs/share type nfs4 (rw,noatime,vers=4.1,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.10.14,lookupcache=pos,local_lock=none,addr=192.168.10.13)
To confirm, I am able to read/write/delete files on the nfs share with the user specified manually, it is only Salt unable to write.
Versions Report
The text was updated successfully, but these errors were encountered: