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

NSFileManager: data loss when copying files over the network #452

Open
eukara opened this issue Oct 12, 2024 · 2 comments
Open

NSFileManager: data loss when copying files over the network #452

eukara opened this issue Oct 12, 2024 · 2 comments

Comments

@eukara
Copy link

eukara commented Oct 12, 2024

Re-filing this here so we don't forget:

As discussed in the meeting, referencing gnustep/apps-gworkspace#18, it appears that copying directories* over NSFileManager results in data loss in certain environments, specifically NFS imports. The current theory is that because the underlying ownership/permissions are different due to all_squash being set on the server side, ignoring incoming user-ids as a result, will cause some higher-level mismatch that will error out the file operation.

* Single files copy fine. Directories (empty ones) copy fine. It is merely the contents of directories which are omitted.

Test case for NSFileManager is pending

@rfm
Copy link
Contributor

rfm commented Oct 13, 2024

I have tried to reproduce this without success using this simple code to copy from a directory containing two subdirectories each containing a plain text file.

[mgr copyItemAtPath: @"." toPath: @"/nfs/general/xxx" error: &err];

The copy was to an Ubuntu server with a pretty standard /etc/exports entry as follows:
/srv/nfs/share 10.211.55.9(rw,sync,no_subtree_check)

That works fine for me, and I note that in gnustep/apps-gworkspace#18 Riccardo ried to reproduce the problem using GWorkspace and was unable to do so.

So we definitely need instructions on how to reproduce the issue; exact information on what nfs set up to use etc.
I suppose it may be the case that, rather than a bug copying, this is a permissions issue on the particular machine preventing the copy, and the issue is a failure to report it well (or at all). We need instructions to reproduce the problem either way.

@gcasa
Copy link
Member

gcasa commented Oct 13, 2024

I think what might help is if you run Gworkspace or your test case in the debugger. Perhaps it is getting some error that the calling code in nsfilemanager is ignoring. @eukara

I would suggest setting breakpoints where nsfilemanager makes low level calls to do the copy. My suspicions are similar to @rfm

It's alarming that you were able to reproduce it during the meeting. Very concerning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants