-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Improve data directory write checking for NFS mounts #13237
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
Conversation
|
I'm very doubtful the developers want this logic to be completely removed. I'd love some feedback from the developers on what the appropriate solution should be. Additional configuration to disable the checks? Replace the checks with something less ambiguous? Let me know. |
|
After some checking this seems to indeed be bug in the is_writable (or more precisely in the access function called). This might not work correctly on NFS mounts. @rcdailey can I ask you to modify this PR. And instead of removing the faling tests. if the test fail try to write a file to the data directory (generate a long unqiue fiename, try to write it?). Then I'm fine with getting this in. |
ab7428a to
f5dfe18
Compare
|
@rullzer Could we please get this into Also, I run Nextcloud in a docker container. Using VS Code to debug PHP from Windows to a Docker Container seems sophisticated, so I'm not sure the best way to test this. Advice is appreciated. I am not normally a PHP developer so this technology is new to me. |
|
So I just replaced the PHP code in my config directory on my live instance, booted, and it worked. For a moment when I refreshed the page, I saw the text of the filename in the browser view, but after I did a 2nd refresh it went back to Nextcloud. So I'm not sure what that was about. |
f5dfe18 to
9d8acf6
Compare
|
It gets into master first and then it gets backported. |
|
Ok I will let you test on master. I don't know how to do that without updrading my server to v16 which I don't want to do. |
9d8acf6 to
f9da25e
Compare
|
@rullzer I've worked through a lot of the issues I had, although I can't consistently get Nextcloud to execute the In the meantime, I think I am settled on the implementation. Would love your feedback as soon as you have time. |
|
Looks sane to me. Let me get the others in here. |
blizzz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good, didn't test
f9da25e to
99d86ea
Compare
|
Do you prefer the target branch be On an unrelated note, I find the way your developers do backports of fixes to stable branches confusing & unintuitive. Normally, hotfixes are applied to your stable releases and merged to your development branches (e.g. In any case, take it as general feedback, but we won't solve process issues here. I had to keep it on |
|
@rullzer Sorry to keep pinging you. Could I get an update on this? When can we merge it? I want it off my plate. Thanks ! |
Yes
server/lib/private/legacy/util.php Lines 726 to 728 in 99d86ea
Try to comment the block above. It seems that |
If `is_writable()` fails, fall back to logic that attempts to create a file and then checks if it exists. If this check fails, an error occurs as it did before. Discussion on this solution was found here: https://help.nextcloud.com/t/write-errors-for-nfs-mount/23328 Fixes nextcloud#7124 Signed-off-by: Robert Dailey <rcdailey@gmail.com>
99d86ea to
a170bf8
Compare
|
@danielkesselberg I have rebased my branch onto |
rullzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets do this 🚀
|
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
|
/backport to stable15 |
|
backport to stable15 in #13906 |
|
still not solved…getting crazy with NFS /data mount because of no write/read permission on folder I # following files: /usr/src/nextcloud/lib/private/legacy/OC_Util.php lines: i can write on data folder from inside the container My dockerfile: version: "2"
nextcloud_db:
volumes: |
|
In case anyone else still has problems with NFS and finds this ticket: I'm mounting the data directory with samba now and it works fine. |
The built-in method `is_writable()` is not reliable on NFS mounts so we should fall back to creating a random file to check for delete permissions. Ref https://stackoverflow.com/a/50801358 Ref #13237 Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
If
is_writable()fails, fall back to logic that attempts to create a fileand then checks if it exists. If this check fails, an error occurs as it
did before.
Discussion on this solution was found here:
https://help.nextcloud.com/t/write-errors-for-nfs-mount/23328
Fixes #7124