-
Notifications
You must be signed in to change notification settings - Fork 313
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
macFUSE + LoopbackFS copying files through Finder not working #516
Comments
For my specific fuse filesystem, not breaking the go-fuse server loop but instead continuing on EIO, recovers and the filesystem is still usable. No hanging file, and no unmount. Just the file copy fails. Interesting enough, is that in the go-fuse/fuse/server.go on readRequest method, handleEINTR func, just retrying the syscall.Read once in the case of an EIO succeeds and no longer breaks the loop. On the loopback example there was never an EIO error on the fuse conn. |
the report is difficult to follow. Your log snippet shows a file that already exists, but you say creating (ie. copying) the file is the first operation to cause problems. Where is the log output for the failed creation? In your log snippet, the line Line: 2024/05/16 08:21:23 tx 5: OK, {n15 g0 tE=0s tA=0s {M0100700 SZ=0 L=1 501:20 B0*16777216 i0:15 A 1715836883.722600 M 1715836883.994815 C 1715836883.994815}} suggests that something in the response is wrong. The Darwin flavor of FUSE on OSX is generally not very reliable; I would not trust it to behave reliably after the first error happens. |
Thank you for the input! I think there are two issues here: The one in the title, that is reproducible with the go-fuse/examples/loopback/main.go reported in the first part of the report (with full logs attached here: https://github.com/hanwen/go-fuse/files/15329802/output.txt ). And a second issue that triggers on my custom filesystem under the same action taken in finder, that results in an EIO while reading from the macFUSE FD. For this second part this is my Getattr - The Crtime_ and Flags_ don't get populated, I think they default to 0:
Full logs for the custom filesystem that result in EIO can be found here: After trying to populate Crtime_ and Flags_ with the same values as the syscall.Stat_t.Crtime/Flags, I can confirm it has no effect towards the EIO error while reading from the FD I think both problems have to do with the ._DS_Store and ._Filename files created by Finder for every file. |
Using the following example from macFUSE https://github.com/macfuse/demo/tree/master/LoopbackFS-C/loopback I cannot reproduce the issue encountered with the go-fuse loopback example. |
I have tested with the go-fuse memfs example, and it's the same problem when dragging and dropping files in finder (the files dont get created in the filesystem, or they get created and have 0 size, while Finder pop ups a message with an error code). I have tested against a different FUSE library (jacobsa/fuse memfs example) and it is the exact same issue when dragging and dropping files in Finder from outside the filesystem inside filesystem. There is a Finder error code and the files have 0 bytes in size. I suspect the issue with dragging and dropping files in Finder and macFUSE affects other library developers too Edit: I have tested a third library and it seems it is not affected by this issue (winfps/cgofuse both memfs/passthrough examples) create the files on drag and drop, and have all the data |
I don´t have an OSX machine, so I can't fix any bugs by reproducing and investigating myself. I don't have appetite to comb through your entire 300kb logfile. Is there a way you can reproduce the problem to something that looks like a go-fuse unittest? If copy & paste in the finder does not work, you could try to use strace (or its equivalaent on OSX) to understand what the Finder actually does under the hood? |
Hello, Thank you for all the input! Thanks to osxfuse/osxfuse#1018 (comment) for pointing towards the xattr. Implementing the interfaces for extended attributes and returning error code 0 makes Finder drag and drop work. For my case I was returning syscall.ENOTSUP which also caused the error code while reading from the macFUSE FD. |
Hello,
OS: Sonoma 14.4.1
macFUSE version: 4.7.1 and 4.7.2
The issue is as follows:
I have run the example in examples/loopback/main.go
go run main.go -debug t1 t2
From the terminal
cp ~/Desktop/file t1/file
succeeds and works as expectedEverytime I open Finder and drag and drop files from outside the filesystem in the filesystem:
I get:
The operation can’t be completed because an unexpected error occurred (error code -50).
The file gets created, but it is completely empty.
Here are the logs from the example program ran with -debug flag (
test.txt
- i think a couple of bytes in size; andScreenshot 2024-05-16 at 04.59.21.png
- a few MB in size; are the files added using finder):output.txt
How I encountered this issue: I was using finder on my custom filesystem, the exact same example as above results in this log message from go-fuse after which the filesystem is no longer usable (however there is no crash in my program):
Finder message:
The last logs outputed by my filesystem: (i think the important part is:
Failed to read from fuse conn: 5=input/output error
)I don't support XAttr, i just return
syscall.ENOTSUP
on all calls related to them.Saving the files in my filesystem from applications such as Sublime text, Visual studio code, or pdf Viewer, works without issues. Also once the files are in the filesystem, I can use Finder to rename, drag them into subfolders, etc. without any problems. But pasting files with
command + v
fails withThe operation can’t be completed because an unexpected error occurred (error code -8062).
- which I can't seem to find what the error code means - and the sameFailed to read from fuse conn: 5=input/output error"
The text was updated successfully, but these errors were encountered: