FS#55242 - [sshfs] Git operations fail over sshfs >= 3.2 connection

Attached to Project: Community Packages
Opened by Alan Moore (lykwydchykyn) - Tuesday, 22 August 2017, 18:57 GMT
Last edited by Eli Schwartz (eschwartz) - Sunday, 24 September 2017, 14:54 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Anatol Pomozov (anatolik)
Giancarlo Razzolini (grazzolini)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

When trying to work in a git repository on a remote linux server mounted via sshfs, some git commands fail with "Invalid argument" errors.

`git commit` fails with:

fatal: cannot update the ref 'HEAD': unable to append to '.git/logs/HEAD': Invalid argument

`git push origin master` fails with:

unable to append to '.git/logs/refs/remotes/origin/master': Invalid argument

(although the remote is actually updated, but the local repo seems unaware of it).

Additional info:
* package version: 3.2.0-1
* remote server was running Debian Jessie
* server was mounted with the command: `sshfs -o idmap=user user@remoteserver:/path/to/content local/mountpoint`
* this arrangement has worked for many years.

Steps to reproduce:
1. Mount remote server directory containing git repo over sshfs using 3.2.0
2. Attempt a commit or push operation in repo over the sshfs connection
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Sunday, 24 September 2017, 14:54 GMT
Reason for closing:  Fixed
Additional comments about closing:  sshfs 3.3.0-1 removes the broken writeback cache support
Comment by Alan Moore (lykwydchykyn) - Tuesday, 22 August 2017, 18:58 GMT
Forgot to mention, downgrading to 3.0.0-1 and remounting the shares fixes the problem.
Comment by Alan Moore (lykwydchykyn) - Tuesday, 22 August 2017, 19:55 GMT
Update: apparently using the (undocumented) option "writeback_cache=no" fixes the issue.
Comment by Anatol Pomozov (anatolik) - Thursday, 24 August 2017, 14:20 GMT
It sounds like an issue with sshfs implementation. Could you please file a bug upstream and post it here?
Comment by Anatol Pomozov (anatolik) - Friday, 25 August 2017, 00:02 GMT Comment by Alan Moore (lykwydchykyn) - Friday, 25 August 2017, 03:59 GMT
Yes, it turns out to be an issue with O_APPEND. I was able to work around it by adding the undocumented switch " -o writeback_cache=no" to disable writeback caching. There is already an upstream bug about the lack of documentation on this switch.
Comment by Sebastiaan Lokhorst (lonaowna) - Friday, 01 September 2017, 11:07 GMT
So this is intended behaviour by upstream?

I've documented it in our wiki: https://wiki.archlinux.org/index.php/SSHFS#Git_doesn.27t_work_in_a_mounted_directory
Comment by Stefan Husmann (stefanhusmann) - Thursday, 21 September 2017, 08:07 GMT
Is it correct that the sshfs binary reports Version 3.1.0, while the package's Version is 3.2.0?
Comment by Sebastiaan Lokhorst (lonaowna) - Thursday, 21 September 2017, 09:32 GMT
This bug is no longer valid as of 3.3.0, since writeback caching was removed.
https://github.com/libfuse/sshfs/commit/d193b19a8f60e8830f0aa5696d2bf3d4fd8d7930

Loading...