On Sat, Feb 6, 2010 at 6:50 PM, David-Sarah Hopwood <span dir="ltr">&lt;<a href="mailto:david-sarah@jacaranda.org">david-sarah@jacaranda.org</a>&gt;</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>
&gt; On Sat, Feb 6, 2010 at 3:57 PM, David-Sarah Hopwood &lt;<br>
&gt; <a href="mailto:david-sarah@jacaranda.org">david-sarah@jacaranda.org</a>&gt; wrote:<br>
&gt;&gt; Jody Harris wrote:<br>
&gt;&gt;<br>
</div><div class="im">&gt;&gt;&gt; For others: SFTP doc is  located in the tarball at<br>
&gt;&gt;&gt; ~/allmydata-tahoe-1.6.0/docs/frontends/FTP-and-SFTP.txt<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Followed instructions (keys and ftp.accounts), restarted tahoe.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; port 8022 is present, but I have not yet been able to attach to the port.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &quot;Unknown error<br>
&gt;&gt;&gt; SFTP command failed for an unknown reason.&quot;<br>
&gt;&gt;<br>
&gt;&gt; Sigh, gotta love error messages like that.<br>
&gt;<br>
&gt; This was from trying to connect with KDE&#39;s Dolphin filemanager using the<br>
&gt; 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 &lt;DirectoryNode RW-MUT oen7k&gt;</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 &quot;/usr/lib/python2.6/dist-packages/twisted/conch/ssh/filetransfer.py&quot;, line 53, in dataReceived</div>

<div>            f(data)</div><div>          File &quot;/usr/lib/python2.6/dist-packages/twisted/conch/ssh/filetransfer.py&quot;, line 285, in packet_READDIR</div><div>            d.addCallback(self._cbSendDirectory, requestId)</div>

<div>          File &quot;/usr/lib/python2.6/dist-packages/twisted/internet/defer.py&quot;, line 195, in addCallback</div><div>            callbackKeywords=kw)</div><div>          File &quot;/usr/lib/python2.6/dist-packages/twisted/internet/defer.py&quot;, line 186, in addCallbacks</div>

<div>            self._runCallbacks()</div><div>        --- &lt;exception caught here&gt; ---</div><div>          File &quot;/usr/lib/python2.6/dist-packages/twisted/internet/defer.py&quot;, line 328, in _runCallbacks</div>

<div>            self.result = callback(self.result, *args, **kw)</div><div>          File &quot;/usr/lib/python2.6/dist-packages/twisted/conch/ssh/filetransfer.py&quot;, line 312, in _cbSendDirectory</div><div>            data += self._packAttributes(attrs)</div>

<div>          File &quot;/usr/lib/python2.6/dist-packages/twisted/conch/ssh/filetransfer.py&quot;, line 95, in _packAttributes</div><div>            data += struct.pack(&#39;!Q&#39;, attrs[&#39;size&#39;])</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">
&gt;&gt;&gt; I probably missed something.<br>
&gt;&gt;<br>
&gt;&gt; sftpd.py prints debugging messages on stdout whenever it receives a<br>
&gt;&gt; request. What did it print, or did it give a traceback? Can you try<br>
&gt;&gt; clients other than the command-line sftp client?<br>
&gt;&gt;<br>
&gt;&gt; (This is done using v1.6 of tahoe.)<br>
&gt;<br>
&gt; I did get connected using the sftp command line client.<br>
&gt;<br>
&gt; {{{ls}}} fails.<br>
&gt;<br>
&gt; {{{mkdir testing}}} created a directory that I can see with {{{tahoe ls}}}.<br>
&gt;<br>
&gt; .... very interesting....<br>
&gt;<br>
&gt; I copies a files {{{tahoe cp path/to/file alias:testing/}}}, and was able to<br>
&gt; do see it with {{{ls testing/}}} in sftp.<br>
&gt;<br>
&gt; I then attached to sftp://localhost:8022/testing with Dolphin, and I can see<br>
&gt; 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">
&gt; I can copy the file form the sftp-mounted directory to a local directory<br>
&gt; with Dolphin.<br>
&gt;<br>
&gt; I cannot open the file directly from the sftp-mounted directory because<br>
&gt; other programs don&#39;t have access to the kioslave.<br>
&gt;<br>
&gt; 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>
&lt;<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>&gt;<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 &quot;darcs apply &quot; followed by the path to<br>
     potential-fix-for-sftpd-path-handling-darcspatch.txt<br>
 - run &quot;python setup.py install&quot;<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&#39;s one attached to that<br>
bug as well. It can be applied using &quot;patch --strip-prefix=1 &lt;&quot; followed by<br>
the path to potential-fix-for-sftpd-path-handling-udiff.txt<br>
<div class="im"><br>
&gt; Apparently, not all of the information required for ftp/sftp is being passed<br>
&gt; by tahoe through the ftp/sftp protocol.<br>
<br>
</div>Just a tip about reporting bugs: don&#39;t speculate about the cause, unless<br>
you have specific evidence to support the speculation. It&#39;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&#39;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>