On Sat, Feb 6, 2010 at 6:50 PM, David-Sarah Hopwood <span dir="ltr"><<a href="mailto:david-sarah@jacaranda.org">david-sarah@jacaranda.org</a>></span> wrote:<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Jody Harris wrote:<br>
> On Sat, Feb 6, 2010 at 3:57 PM, David-Sarah Hopwood <<br>
> <a href="mailto:david-sarah@jacaranda.org">david-sarah@jacaranda.org</a>> wrote:<br>
>> Jody Harris wrote:<br>
>><br>
</div><div class="im">>>> For others: SFTP doc is located in the tarball at<br>
>>> ~/allmydata-tahoe-1.6.0/docs/frontends/FTP-and-SFTP.txt<br>
>>><br>
>>> Followed instructions (keys and ftp.accounts), restarted tahoe.<br>
>>><br>
>>> port 8022 is present, but I have not yet been able to attach to the port.<br>
>>><br>
>>> "Unknown error<br>
>>> SFTP command failed for an unknown reason."<br>
>><br>
>> Sigh, gotta love error messages like that.<br>
><br>
> This was from trying to connect with KDE's Dolphin filemanager using the<br>
> sftp kioslave....<br>
<br>
</div>Any messages from sftpd at that point?<br>
<div class="im"><br></div></blockquote><div><div>2010-02-06 19:09:37-0700 [SSHChannel session (0) on SSHService ssh-connection on SSHServerTransport,11,127.0.0.1] OPENDIRECTORY /</div><div>2010-02-06 19:09:37-0700 [SSHChannel session (0) on SSHService ssh-connection on SSHServerTransport,11,127.0.0.1] CONVERT []</div>
<div>2010-02-06 19:09:37-0700 [SSHChannel session (0) on SSHService ssh-connection on SSHServerTransport,11,127.0.0.1] ROOT <DirectoryNode RW-MUT oen7k></div><div>2010-02-06 19:09:37-0700 [SSHChannel session (0) on SSHService ssh-connection on SSHServerTransport,11,127.0.0.1] PATH []</div>
<div>2010-02-06 19:09:37-0700 [SSHChannel session (0) on SSHService ssh-connection on SSHServerTransport,11,127.0.0.1] Unhandled Error</div><div> Traceback (most recent call last):</div><div> File "/usr/lib/python2.6/dist-packages/twisted/conch/ssh/filetransfer.py", line 53, in dataReceived</div>
<div> f(data)</div><div> File "/usr/lib/python2.6/dist-packages/twisted/conch/ssh/filetransfer.py", line 285, in packet_READDIR</div><div> d.addCallback(self._cbSendDirectory, requestId)</div>
<div> File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 195, in addCallback</div><div> callbackKeywords=kw)</div><div> File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 186, in addCallbacks</div>
<div> self._runCallbacks()</div><div> --- <exception caught here> ---</div><div> File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 328, in _runCallbacks</div>
<div> self.result = callback(self.result, *args, **kw)</div><div> File "/usr/lib/python2.6/dist-packages/twisted/conch/ssh/filetransfer.py", line 312, in _cbSendDirectory</div><div> data += self._packAttributes(attrs)</div>
<div> File "/usr/lib/python2.6/dist-packages/twisted/conch/ssh/filetransfer.py", line 95, in _packAttributes</div><div> data += struct.pack('!Q', attrs['size'])</div><div> struct.error: cannot convert argument to long</div>
<div><br></div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
>>> I probably missed something.<br>
>><br>
>> sftpd.py prints debugging messages on stdout whenever it receives a<br>
>> request. What did it print, or did it give a traceback? Can you try<br>
>> clients other than the command-line sftp client?<br>
>><br>
>> (This is done using v1.6 of tahoe.)<br>
><br>
> I did get connected using the sftp command line client.<br>
><br>
> {{{ls}}} fails.<br>
><br>
> {{{mkdir testing}}} created a directory that I can see with {{{tahoe ls}}}.<br>
><br>
> .... very interesting....<br>
><br>
> I copies a files {{{tahoe cp path/to/file alias:testing/}}}, and was able to<br>
> do see it with {{{ls testing/}}} in sftp.<br>
><br>
> I then attached to sftp://localhost:8022/testing with Dolphin, and I can see<br>
> the file.<br>
<br>
</div>Can you see it by attaching to sftp://localhost:8022/ and then navigating<br>
to testing?<br>
<div class="im"><br></div></blockquote><div>Yes. On attaching (authorization), I get the error, but I do get connected. After connecting, I can append testing to the path, and it opens fine.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">
> I can copy the file form the sftp-mounted directory to a local directory<br>
> with Dolphin.<br>
><br>
> I cannot open the file directly from the sftp-mounted directory because<br>
> other programs don't have access to the kioslave.<br>
><br>
> So the problem with with the root directory of the alias.<br>
<br>
</div>Either with the root directory of the alias, or with empty directories.<br>
Can the contents of empty non-root directories be listed in each client?<br>
<br></blockquote><div>Empty non-root directories list without errors or warnings.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
After testing that, please apply the patch that I just attached to bug #645:<br>
<<a href="http://allmydata.org/trac/tahoe/raw-attachment/ticket/645/potential-fix-for-sftpd-path-handling-darcspatch.txt" target="_blank">http://allmydata.org/trac/tahoe/raw-attachment/ticket/645/potential-fix-for-sftpd-path-handling-darcspatch.txt</a>><br>
and try again.<br>
<br>
To be more explicit:<br>
- put the Tahoe alias directory back to the same state you started from<br>
above (empty, presumably?)<br>
- stop the node<br>
- cd to the root of the Tahoe source tree (fetched from trunk using darcs,<br>
as described in <a href="http://allmydata.org/trac/tahoe/wiki/Dev" target="_blank">http://allmydata.org/trac/tahoe/wiki/Dev</a>)<br>
- enter "darcs apply " followed by the path to<br>
potential-fix-for-sftpd-path-handling-darcspatch.txt<br>
- run "python setup.py install"<br>
- restart the node<br>
- repeat the same tests using the same clients<br>
<br></blockquote><div>Okay... I got allmydata-tahoe: 1.6.0-r4228 running, but sftp for alias roots still fails for sftp client as well as both Nautilus and Dolphin. Subdirectories still work fine in all contexts.</div><div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
If you prefer a unified diff to a darcspatch, there's one attached to that<br>
bug as well. It can be applied using "patch --strip-prefix=1 <" followed by<br>
the path to potential-fix-for-sftpd-path-handling-udiff.txt<br>
<div class="im"><br>
> Apparently, not all of the information required for ftp/sftp is being passed<br>
> by tahoe through the ftp/sftp protocol.<br>
<br>
</div>Just a tip about reporting bugs: don't speculate about the cause, unless<br>
you have specific evidence to support the speculation. It's easy to go down<br>
blind alleys that way. Here, there are quite a few possibilities for what<br>
*could* be wrong:<br>
<br>
- sftpd.py could be misimplementing the SFTP protocol in some cases,<br>
either doing the wrong thing and/or returning incorrect information<br>
in responses<br>
- sftpd.py could be correct but tickling a bug elsewhere in Tahoe (fairly<br>
unlikely)<br>
- one or more of the sftp clients could be misimplementing the protocol<br>
(also fairly unlikely)<br>
- the protocol could be ambiguously specified, and some clients rely on the<br>
ambiguous cases while other clients avoid them.<br>
<br>
Also note that when testing a stateful system with several different<br>
protocol implementations, it's important to begin with the same state<br>
with each combination of server and client implementation (where possible).<br>
<div><div></div><div class="h5"><br>
--<br>
David-Sarah Hopwood ⚥ <a href="http://davidsarah.livejournal.com" target="_blank">http://davidsarah.livejournal.com</a><br>
<br>
</div></div><br>_______________________________________________<br>
tahoe-dev mailing list<br>
<a href="mailto:tahoe-dev@allmydata.org">tahoe-dev@allmydata.org</a><br>
<a href="http://allmydata.org/cgi-bin/mailman/listinfo/tahoe-dev" target="_blank">http://allmydata.org/cgi-bin/mailman/listinfo/tahoe-dev</a><br>
<br></blockquote></div><br>