bzr can't work sftp or ssh with the paramiko

Bug #239709 reported by RedSun
4
Affects Status Importance Assigned to Milestone
paramiko
Invalid
Undecided
Unassigned

Bug Description

when I use bzr ver1.5 with paramiko 1.7.3 , I can't use sftp and ssh protocols.
1:
   I use it localhost,it's not work.
2:
   I use it from another box , also it not work.

finally:
   I use the paramiko 1.6.1, haha, It works!

when I use sftp it report 'Gabage packet recive'.
when I use bzr+ssh it report None,just exit.

Revision history for this message
Erk (eric-noulard) wrote :

I have a similar issue (paramiko 1.7.2) when trying to
SSHClient.open_sftp()
if the .bashrc is printing something.

You should be able to reproduce the bug if you add
echo "hello there"
in your .bashrc

Here comes the stack trace:
self.SFTPClient = self.SSHClient.open_sftp()
  File "/usr/lib/python2.5/site-packages/paramiko/client.py", line 350, in open_sftp
    return self._transport.open_sftp_client()
  File "/usr/lib/python2.5/site-packages/paramiko/transport.py", line 769, in open_sftp_client
    return SFTPClient.from_transport(self)
  File "/usr/lib/python2.5/site-packages/paramiko/sftp_client.py", line 106, in from_transport
    return cls(chan)
  File "/usr/lib/python2.5/site-packages/paramiko/sftp_client.py", line 87, in __init__
    server_version = self._send_version()
  File "/usr/lib/python2.5/site-packages/paramiko/sftp.py", line 108, in _send_version
    t, data = self._read_packet()
  File "/usr/lib/python2.5/site-packages/paramiko/sftp.py", line 183, in _read_packet
    raise SFTPError('Garbage packet received')
SFTPError: Garbage packet received

Revision history for this message
Jonathan Marsden (jmarsden) wrote :

It is not clear that this is a paramiko bug at all.

.bashrc is not *supposed* to output anything when invoked non-interactively. If you fix that, and do something like

> if [[ $- = *i* ]] ; then
> echo "hello there"
> fi

in your .bashrc (so only generating output if the shell is interactive), then bzr and sftp and similar applications should still work just fine via paramiko.

If the problem disappears when you do this, then the "bug" is not in paramiko, it is in your .bashrc :-)

Jonathan

Revision history for this message
Jonathan Marsden (jmarsden) wrote :

"Bug" is caused by misuse of .bashrc to generate output in non-interactive shells, not by paramiko.

Changed in paramiko:
status: New → Invalid
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.