Why am I suddenly unable to write to this sshfs volume?

4

1

There is a remote server which I connect to daily through ssh. I do a lot of editing of files on the server, so I use sshfs to do so.

I mount the directory with $ sshfs user@host:/var/www/html ~/sshfs/html. This has worked very well over the past few months, and still should work even now. However, I'm having some strangely inconsistent access problems.

Case 1 - Sublime Text: I'm completely unable to save anything using my editor of choice (Sublime Text). I can't Save-As to create a new file in ~/sshfs/html/ either. I can open files, but not save.

Sublime gives the following message in an alert box when trying to save:

screenshot

Unable to save ~/sshfs/html/foo
Error: rename(/home/ben/sshfs/html/.subl219.tmp, /home/ben/sshfs/html/foo) failed
errno: 1

Case 2 - Kate: I tried opening things in Kate to see if Sublime was just being dumb. I'm still unable to edit existing files, but I can create new files with no problems in Kate.

Kate gives the following message in an alert box when trying to save an edit:

screenshot

The document could not be saved, as it was not possible to write to /home/ben/sshfs/html/foo.
Check that you have write access to this file or that enough disk space is available.

Case 3 - Vim: Here's where things start making less sense. I tried using Vim on my local machine with

$ vim ~/sshfs/html/foo

Surprisingly, I have no problems at all using Vim. It opens, edits, saves, and creates files without problems. I also have no problems when using shell commands such as touch.

Things to consider

  • Group access
    • The group developers has access to all files I want to edit.
    • My local user is a member of the group developers.
    • My remote user (The account I login to via SSH) is a member of the group developers.
    • The group developers exists on both the server and my local machine with the same ID.
  • Other things
    • I have several directories across a couple of servers that I use like this. None of the other directories on other servers are giving me any trouble.
  • Running $ ls -l on my local host inside the mount point:

Output

drwxrwxr-x 1 root developers  4096 Sep  8 06:47 admin
drwxrwxr-x 1 root developers  4096 Jun  4  2013 agent_submit
-rwxrwxr-x 1 root developers  6605 Jun  4  2013 authorize.php
  • Running $ ls -l on the remote host through an ssh shell:

Output

drwxrwxr-x 10 root developers  4096 Sep  8 06:47 admin
drwxrwxr-x  2 root developers  4096 Jun  4  2013 agent_submit
-rwxrwxr-x  1 root developers  6605 Jun  4  2013 authorize.php

dotVezz

Posted 2013-12-04T20:13:24.363

Reputation: 529

What are the permissions of these files (output of ls -l) ? Can you edit files via shell commands, such as touch foo or echo "blah" >> foo ? – Levans – 2013-12-04T20:59:43.560

@Levans: I've updated the question with ls output. And I have no problems editing or creating via shell commands. – dotVezz – 2013-12-04T21:16:31.710

It shouldn't make any difference, but do you get the same behavior if you mount it like $ sshfs user@host:/var/www/html /home/ben/sshfs/html? – rickhg12hs – 2013-12-05T04:39:19.913

@rickhg12hs no difference. – dotVezz – 2013-12-05T13:12:33.820

Strange, but seems like it's probably fuse. Perhaps you could enable debugging and/or extend timeouts to see what's happening. sshfs man page has the switches to try.

– rickhg12hs – 2013-12-05T14:09:54.323

Answers

3

okias

Posted 2013-12-04T20:13:24.363

Reputation: 116

4Even if accurate, posting just a command and links doesn't answer the question or help in the long run. It is best to explain what is wrong and why the command provided is the solution as well as explaining any pertinent portions of the provided links. – MaQleod – 2014-04-24T03:33:08.753