SFTP interface not working over sshfs on OS X #1040

Closed
opened 2010-05-14 16:33:47 +00:00 by josipl · 7 comments
josipl commented 2010-05-14 16:33:47 +00:00
Owner

Using SFTP interface on OS X (10.5.8) raises following exception:

exceptions.TypeError: ('Could not adapt', <allmydata.frontends.sftpd.SFTPUser instance at 0x27e34e0>, <InterfaceClass twisted.conch.interfaces.ISession>)

The problem occurs with ExpanDrive and Transmit. Connecting with sshfs command worked, but only if it was issued as root - in that case other users can't access the mounted disk.

You can see the full log for sftp, sshfs, and Transmit.

Using SFTP interface on OS X (10.5.8) raises following exception: `exceptions.TypeError: ('Could not adapt', <allmydata.frontends.sftpd.SFTPUser instance at 0x27e34e0>, <InterfaceClass twisted.conch.interfaces.ISession>)` The problem occurs with [ExpanDrive](http://expandrive.com) and [Transmit](http://panic.com/transmit). Connecting with `sshfs` command worked, but only if it was issued as root - in that case other users can't access the mounted disk. You can see the [full log](http://gist.github.com/401328) for sftp, sshfs, and Transmit.
tahoe-lafs added the
code-frontend
major
defect
1.6.1
labels 2010-05-14 16:33:47 +00:00
tahoe-lafs added this to the undecided milestone 2010-05-14 16:33:47 +00:00
tahoe-lafs modified the milestone from undecided to 1.7.0 2010-05-14 16:38:38 +00:00
davidsarah commented 2010-05-15 01:12:59 +00:00
Author
Owner

I've made SFTPUser implement ISession (the interface that the logs showed it as failing to be adapted to), which should either fix this problem or allow it to get slightly further. Please 'darcs pull' on the ticket1037 branch and try again.

I've made SFTPUser implement ISession (the interface that the logs showed it as failing to be adapted to), which should either fix this problem or allow it to get slightly further. Please 'darcs pull' on the ticket1037 branch and try again.
josipl commented 2010-05-15 14:40:47 +00:00
Author
Owner

Replying to davidsarah:

I've made SFTPUser implement ISession (the interface that the logs showed it as failing to be adapted to), which should either fix this problem or allow it to get slightly further. Please 'darcs pull' on the ticket1037 branch and try again.

source:src/allmydata/frontents/sftpd.py was missing from allmydata.util import log and self on line 1247.

Unfortunately it didn't fix the problem, the only exception it now reports is
exceptions.NotImplementedError.

Only new thing I noticed in [http://gist.github.com/402203 log] is executing command "df -P -k /".

I've noticed some weird behaviour too: Finder manages to create .Trashes directory and .DS_Store file on the server, but dragging a new file to the disk creates an empty file on the server. Now, even weirder thing is that dragging files into Transmit (for which I suspect is using sshfs internally) uploads the files correctly but it can't list directories, just like Finder.

Replying to [davidsarah](/tahoe-lafs/trac-2024-07-25/issues/1040#issuecomment-118927): > I've made SFTPUser implement ISession (the interface that the logs showed it as failing to be adapted to), which should either fix this problem or allow it to get slightly further. Please 'darcs pull' on the ticket1037 branch and try again. source:src/allmydata/frontents/sftpd.py was missing `from allmydata.util import log` and `self` on line 1247. Unfortunately it didn't fix the problem, the only exception it now reports is `exceptions.NotImplementedError`. Only new thing I noticed in [http://gist.github.com/402203 log] is `executing command "df -P -k /"`. I've noticed some weird behaviour too: Finder manages to create .Trashes directory and .DS_Store file on the server, but dragging a new file to the disk creates an empty file on the server. Now, even weirder thing is that dragging files into Transmit (for which I suspect is using sshfs internally) uploads the files correctly but it can't list directories, just like Finder.
davidsarah commented 2010-05-16 02:14:16 +00:00
Author
Owner

Replying to [josipl]comment:3:

Only new thing I noticed in log is executing command "df -P -k /".

The ticket1037 branch now attempts to fake the output of this command (but I've had to make some guesses about how to implement execCommand since the Twisted documentation is very sparse). Please pull and try again.

I've noticed some weird behaviour too: Finder manages to create .Trashes directory and .DS_Store file on the server, but dragging a new file to the disk creates an empty file on the server.

This is an independent problem -- probably the same one mentioned in /tahoe-lafs/trac-2024-07-25/issues/8542#comment:5. The file is empty because the handle is opened with FXF_EXCL (equivalent to POSIX O_EXCL) in the flags, which means that we have to create a zero-length file first. Then the 'close' hangs and the zero-length file is left in place.

Now, even weirder thing is that dragging files into Transmit (for which I suspect is using sshfs internally) uploads the files correctly but it can't list directories, just like Finder.

Perhaps it only depends on the 'df' command when showing a directory listing (which would make sense if the listing shows the free space on the disk).

Replying to [josipl]comment:3: > Only new thing I noticed in [log](http://gist.github.com/402203) is `executing command "df -P -k /"`. The ticket1037 branch now attempts to fake the output of this command (but I've had to make some guesses about how to implement [execCommand](http://twistedmatrix.com/trac/browser/trunk/twisted/conch/interfaces.py?rev=25365#L74) since the Twisted documentation is very sparse). Please pull and try again. > I've noticed some weird behaviour too: Finder manages to create .Trashes directory and .DS_Store file on the server, but dragging a new file to the disk creates an empty file on the server. This is an independent problem -- probably the same one mentioned in [/tahoe-lafs/trac-2024-07-25/issues/8542](/tahoe-lafs/trac-2024-07-25/issues/8542)#comment:5. The file is empty because the handle is opened with FXF_EXCL (equivalent to POSIX O_EXCL) in the flags, which means that we have to create a zero-length file first. Then the 'close' hangs and the zero-length file is left in place. > Now, even weirder thing is that dragging files into Transmit (for which I suspect is using sshfs internally) uploads the files correctly but it can't list directories, just like Finder. Perhaps it only depends on the 'df' command when showing a directory listing (which would make sense if the listing shows the free space on the disk).
josipl commented 2010-05-16 15:28:45 +00:00
Author
Owner

The ticket1037 branch now attempts to fake the output of this command (but I've had to make some guesses about how to implement execCommand since the Twisted documentation is very sparse). Please pull and try again.

Unfortunately, the problem is still there. Sometimes, a file or two get shown in Finder but that's it. From the log I'd say that the connection is dropped too early. Now this exception is being raised all the time:

exceptions.AttributeError: 'NoneType' object has no attribute 'write'

> The ticket1037 branch now attempts to fake the output of this command (but I've had to make some guesses about how to implement [execCommand](http://twistedmatrix.com/trac/browser/trunk/twisted/conch/interfaces.py?rev=25365#L74) since the Twisted documentation is very sparse). Please pull and try again. Unfortunately, the problem is still there. Sometimes, a file or two get shown in Finder but that's it. From the [log](http://gist.github.com/402762) I'd say that the connection is dropped too early. Now this exception is being raised all the time: `exceptions.AttributeError: 'NoneType' object has no attribute 'write'`
zooko commented 2010-05-17 05:36:43 +00:00
Author
Owner

David-Sarah think that this issue has been fixed in their branch. Here are their instructions for testing the branch:

http://tahoe-lafs.org/pipermail/tahoe-dev/2010-May/004339.html

David-Sarah think that this issue has been fixed in their branch. Here are their instructions for testing the branch: <http://tahoe-lafs.org/pipermail/tahoe-dev/2010-May/004339.html>
josipl commented 2010-05-17 13:43:39 +00:00
Author
Owner

Replying to zooko:

David-Sarah think that this issue has been fixed in their branch. Here are their instructions for testing the branch:

http://tahoe-lafs.org/pipermail/tahoe-dev/2010-May/004339.html

Unfortunately not even the latest patches fixed the problem (there was a missing write method on FakeTransport).
According to log no exceptions are raised, yet nothing shows up in Finder.

Replying to [zooko](/tahoe-lafs/trac-2024-07-25/issues/1040#issuecomment-118931): > David-Sarah think that this issue has been fixed in their branch. Here are their instructions for testing the branch: > > <http://tahoe-lafs.org/pipermail/tahoe-dev/2010-May/004339.html> Unfortunately not even the latest patches fixed the problem (there was a missing `write` method on `FakeTransport`). According to [log](http://gist.github.com/403758) no exceptions are raised, yet nothing shows up in Finder.
davidsarah commented 2010-05-18 06:07:05 +00:00
Author
Owner

Please darcs revert then darcs pull again. The problem appears to have been due to sshfs refusing to operate on files and directories that are not world-readable (or world-writeable for writing). sshfs arguably shouldn't have been doing that, but in any case, the current branch now reports the permissions needed for it to work.

(Thanks to josipl and francois for help with debugging this.)

Please `darcs revert` then `darcs pull` again. The problem appears to have been due to sshfs refusing to operate on files and directories that are not world-readable (or world-writeable for writing). sshfs arguably shouldn't have been doing that, but in any case, the current branch now reports the permissions needed for it to work. (Thanks to josipl and francois for help with debugging this.)
tahoe-lafs added the
fixed
label 2010-06-10 17:35:37 +00:00
davidsarah closed this issue 2010-06-10 17:35:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#1040
No description provided.