Failure to Save to SSHFS volumes

Bug #36091 reported by BenWoosley
30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gedit (Ubuntu)
New
Low
Unassigned
sshfs-fuse (Ubuntu)
New
Medium
Unassigned

Bug Description

When editing a document on a volume mounted using SSHFS
http://fuse.sourceforge.net/sshfs.html

the file fails to save, presenting a bar under the toolbar which says:
"Could not save the file <file path>. You do not have the permissions necessary to save the file. Please, check that you typed the location correctly and try again."

Additionally, the buttons on the toolbar actually disappear and are replaced by solid yellow. Strange...

Revision history for this message
BenWoosley (ben-woosley) wrote :
Revision history for this message
Dennis Kaarsemaker (dennis) wrote : Re: [Bug 36091] Failure to Save to SSHFS volumes

On do, 2006-03-23 at 01:50 +0000, BenWoosley wrote:
> When editing a document on a volume mounted using SSHFS
> http://fuse.sourceforge.net/sshfs.html
>
> the file fails to save, presenting a bar under the toolbar which says:
> "Could not save the file <file path>. You do not have the permissions
> necessary to save the file. Please, check that you typed the location
> correctly and try again."

Did you mount the sshfs share as root?

> Additionally, the buttons on the toolbar actually disappear and are
> replaced by solid yellow. Strange...

That's another bug, which is solved already.

Revision history for this message
BenWoosley (ben-woosley) wrote :

>That's another bug, which is solved already.
It is indeed

>Did you mount the sshfs share as root?
No. With each restart I must run:
`sudo mknod /dev/fuse c 10 229`
`sudo chmod o+rw /dev/fuse`
then I can mount the volume as myself:
`sshfs <email address hidden>: /media/that/`

As of now, the gedit allows me to save successfully once, then on the second save it fails... The permissions are the same, but
Before editing successfully:
-rw-r--r-- 1 1103 users 6064 2006-03-26 15:07 README
After editing, now uneditable. It shows the message:
-rw-r--r-- 1 1103 users 6089 2006-03-30 17:24 README
-rw-r--r-- 1 1103 users 6064 2006-03-26 15:07 README~

Revision history for this message
Dennis Kaarsemaker (dennis) wrote : Re: [Bug 36091] Re: Failure to Save to SSHFS volumes

No. You should add fuse to /etc/modules and add yourself to the fuse
group, as documented in the fuse documentation.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

User error, so rejecting.

 status Rejected

Changed in gedit:
status: Unconfirmed → Rejected
Revision history for this message
BenWoosley (ben-woosley) wrote :

> You should add fuse to /etc/modules
This removed the need to `mknod /dev/fuse` and `chmod o+rw /dev/fuse`. Thanks for that.

> You should ... add yourself to the fuse group
That isn't the problem, it had been done already
<me>@<mine>:~$ groups <me>
<me> : <me> adm dialout cdrom floppy audio dip video plugdev lpadmin scanner admin fuse

> as documented in the fuse documentation.
These aren't mentioned in either the fuse or sshfs sites:
http://fuse.sourceforge.net/
http://fuse.sourceforge.net/sshfs.html
I did find them in a forum posting:
http://www.ubuntuforums.org/showthread.php?t=103860
But you can hardly call that "the documentation"

Anyway, the problem still exists. On the first save, things work out fine, on the second save to a file with identical ownership and permissions, the edit fails. Further, nano edits it just fine. I continue to believe this is a gedit issue...

Revision history for this message
BenWoosley (ben-woosley) wrote :

Eclipse also has no problem w/ the sshfs files that are giving gedit trouble. Just so you understand my thinking here, it's these 2 cases (nano and eclipse), which lead me to believe that it isn't fuse or user error.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

Interesting - Are you sure the sshfs share is still mounted? I've
repeatedly have similar issues due to malfunctioning SSH servers.

 status Unconfirmed

Changed in gedit:
status: Rejected → Unconfirmed
Revision history for this message
BenWoosley (ben-woosley) wrote :

Yeah the share is still mounted, based on the fact I can edit it before and after getting the error in gedit.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

Can you please mount it in debug mode (sshfs -d) and see whether this
gives useful information?

Revision history for this message
BenWoosley (ben-woosley) wrote : `sshfs -d` debug output illustrating issue

Here's the debug output. I mounted the drive, opened /myfolder/README in gedit without the use of nautilus, edited the file, saved the file successfully, then edited and saved again, this time unsuccessfully. The following milestones are marked in the log:

2: Logged in and mounted
9: Opened in gedit
34: First edit made successfully
53: Second edit fails

The points of interest are 22-25 and 46-47
In the first case, README~ is not found, and README is renamed to README~, then the gedit temp file is renamed to README.
In the second case, README~ is found, then it tries to rename README to README~, which fails with:
" unique: 47, error: -1 (Operation not permitted), outsize: 16",
the error gedit is seeing.

Revision history for this message
Dennis Kaarsemaker (dennis) wrote :

Looks like an sshfs bug to me, I'll investigate this.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Dennis, did you have any look with that?

Revision history for this message
Dennis Kaarsemaker (dennis) wrote : Re: [Bug 36091] Re: Failure to Save to SSHFS volumes

On wo, 2006-08-02 at 10:13 +0000, Daniel Holbach wrote:
> Dennis, did you have any look with that?

RENAME /myfolder/README -> /myfolder/README~
   unique: 47, error: -1 (Operation not permitted), outsize: 16

sshfs doesn't allow one to rename files to existing files. Normal sftp
also doesn't allow this:

sftp> rename foo bar
Couldn't rename file "/home/dennis/foo" to "/home/dennis/bar": Failure

I'm not sure where exactly the bug in sshfs is, but I think it's not a
bug but specified as such in the ssh protocol. gedit should not fail
saving if a backup can't be created imho so the bug is back at gedit.
--
Dennis K.

Time is an illusion, lunchtime doubly so.

Revision history for this message
mszeredi (miklos) wrote :

There's an sshfs option '-oworkaround=rename' which works around this sftp misfeature, although the resulting rename operation will no longer be atomic as required by POSIX.

Revision history for this message
Sebastien Bacher (seb128) wrote :

looks somewhat similar to http://bugzilla.gnome.org/show_bug.cgi?id=336738 upstream

Revision history for this message
Tim Butler (timbutler) wrote :

Marked this as a duplicate of the problem described in Ubuntu Bug #34813 as it is linked to the problem upstream. The renaming of open files appears to be the same bug and only affects gedit.

Revision history for this message
Jonathan Dodson (jbdodson) wrote :

I get this same problem in Gutsy with sshfs and gedit. I can save fine in VIM but GEdit thinks there is a permissions problem. Save works fine once, after that it fails due to permission issues(that is not the case permissions are fine).

Revision history for this message
reech (r-mcmillan) wrote :

Can confirm this on Hardy and gedit /sshfs - sometimes first edit saves however subsequent edits fail.

Revision history for this message
Arno Teigseth (arno-teigseth) wrote :

This is also an issue in Ibex; I know there are related bugs but this one is labeled especifically SSHFS.

The problem is as explained above that on sshfs you cannot rename a file "A.txt" to "A.txt~" if "A.txt~" already exists. Even if the target filesystem can.

To me this is not gedit specific - all similar operations give the same error:

arno@arno-laptop:~/jobbpc/var/www/dir$ mv stats.php stats.php~
mv: cannot move `stats.php' to `stats.php~': Operation not permitted

...while it works just fine if you mount with the rename workaround option to sshfs, like mszeredi says above:
https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/36091/comments/15

What worries me is that sshfs isn't able to do this kind of renaming even when the target filesystem is ext3. On my system it's all linux, and I mount the remote ext3 system on a local ext3 tree via sshfs. OK maybe the tree isnt ext3 but the filesystems are. Then from a user standpoint I was puzzled that I couldn't do normal ext3 operations. Until I found this bug :)

Revision history for this message
Sean G (sean-gilbertson) wrote :

Note that there is a preference in Gedit that fixes this issue (Edit > Preferences > Editor > Create a backup copy of files before saving).

Solution documented here: http://blog.linuxtoday.com/blog/2009/05/gedit-wont-save.html

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.