-
Notifications
You must be signed in to change notification settings - Fork 502
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
Add workaround for SFTP servers that don't support O_APPEND #117
Comments
Thanks for the report! Most likely the problem is with O_APPEND. There's been some code churn related to that. |
Specifically, only since version 3.2.0 SSHFS actually supports O_APPEND (by forwarding it to the server). Before that, this flag was a no-op. I suspect your SFTP server does not support it. Could you run with --debug and post the output? And maybe comment out https://github.com/libfuse/sshfs/blob/master/sshfs.c#L2526 and see if that works around the problem? |
Many thanks for the quick response! You are correct - commenting out the The debug log I am getting doesn't look terribly useful, but here are what appears to be the relevant bits, let me know if you would prefer the full thing:
If I telnet to the server on port 22, I am greeted with: |
Arg, sorry. The correct option is That said, there isn't much we can do at the SSHFS side. The server is refusing to open files with O_APPEND, sshfs is just forwarding that error. Just stripping away that option doesn't seem like a good idea - the application is probably using it for a reason. |
Best solution is probably to add another workaround that emulates O_APPEND by always seeking to EOF before writing (similar to what NFS does). |
Are there still plans to implement this? It appears I ran into this trying to commit to a Git repository that is mounted over SSH. It boils down to this: sshfs -V
grep /etc/fstab <remote-machine>
cat /etc/fuse.confs
mount -o sshfs_debug MOUNTPOINT
cd MOUNTPOINT/DIR_WITH_WRITE_PERMISSIONS
echo foo > foobar
echo bar >> foobar
Note: I asked for help over at StackExchange first in the hope of a work-around but all I got was a pointer to this issue. |
Thanks for the detailed report! I am afraid as far as I'm aware there have never been concrete plans to implement this. However, if someone wanted to work on this, then I'd be happy to review patches and (hopefully) merge them. |
@Nikratio: Thank you for the prompt reply and the heads up. I have a feeling this is probably not the kind of issue for a first contribution. If you think it is doable by somebody unfamiliar with the codebase who used C only for small hobbyist-type one-man projects (couple of hundred lines a year at best), I could give it a shot though. Some pointers of where to start would be great in that case. @adam-nielsen: Did you ever find a viable work-around (other than patching Git)? |
@mschilli87 I can help you debug this issue.
error is EACCES.
I think I need help adding logs to verify this hypothesis. |
I tried using sshfs to clone github repo. but no success.
maybe I am not using it right way. I will attempt a patch. if I am successful. |
@mschilli87 When I was testing I disabled
Definitely a dodgy fix but it has been working for a while now. |
There is no need to get
If that would be my server, I could probably active support for
All the logs I can think of are already included in my previous mesage. Thank you for getting back at me. Would @adam-nielsen's hack be an acceptable solution via an 'offical' |
I recently upgraded my system and in the process went from sshfs 3.0.0 to 3.3.1 and I can no longer use git over an sshfs mount.
The file itself has no permission issues:
Running git through strace says:
Why would
openat()
be returningEACCES
when whatever functions the shell is using work just fine on the same file path?Is anyone else able to run
git fetch
on a git repository accessed over sshfs?The text was updated successfully, but these errors were encountered: