[paramiko] Intermittent problem (no attachments)

jd jdsw2002 at yahoo.com
Sat Sep 1 00:14:23 PDT 2007


After very long debugging and tracing session.. I have
been able to capture the behavior in traces. 

I have filed the following bug

https://bugs.launchpad.net/paramiko/+bug/136532

Would really appreciate if someone can take a look and
suggest workaround/patch.

Thanks
/Jd

--- Todd Whiteman <toddw at activestate.com> wrote:

> Hi Jd,
> 
> First off, does this problem also exist when using
> the latest paramiko 
> release (1.7.1):
> http://www.lag.net/paramiko/
> 
> Todd.
> 
> jd wrote:
> > Hi
> >   I had sent this email, but is waiting for
> approval
> > as the attached sources seems to cross the limit
> of
> > the distribution list. 
> >   Can the owner kindly approve the message with
> files.
> >   does anyone have tips/pointers to resolve this ?
> > Thanks
> > /Jd
> > 
> > --- jd <jdsw2002 at yahoo.com> wrote:
> > 
> >> Hi Everyone.
> >>    I have written a ssh tunnel transport for
> >> XML-RPC.
> >> It seems to work pretty good, but has
> intermittent
> >> failures. 
> >>
> >>  It seems that the client/parser missed the first
> >> chunk of data from the server.
> >>
> >>   This does not happen when I use the normal
> xml-rpc
> >> over http. so I am assuming that the server is
> ok.
> >>
> >>  Attached is test program that reproduces the
> >> problem.
> >> Environment is  FC7, python 2.5,
> >> python-paramiko-1.6.4-1.fc7, Xen 3.1
> >>
> >> Can someone spot something wrong which might be
> >> causing this ? Or some paramiko tweak that might
> be
> >> useful in this scenario.
> >>
> >> Any other ideas on how to narrow down the problem
> >> are
> >> welcome. 
> >>
> >> Thanks
> >> /Jd
> >>
> >> === Attached description of files ===
> >> phelper.py : Just some utility wrapper over
> paramiko
> >> lib.
> >> test_proxy.py : simple driver program that
> >> reproduces
> >> the problem. 
> >> test_output : output : 2 out of N tries succeed.
> >> XenServreProxy.py : Proxy that implements the
> >> paramiko
> >> transport for XML-RPC.
> >>
> >>
> >>
> >>
> >>
> >>        
> >>
> >
>
____________________________________________________________________________________
> >> Sick sense of humor? Visit Yahoo! TV's 
> >> Comedy with an Edge to see what's on, when. 
> >> http://tv.yahoo.com/collections/222>
> #!/usr/bin/env
> > python
> >> #
> >> #   XenMan   -  Copyright (c) 2007 Jd & Hap
> Hazard
> >> #   ======
> >> #
> >> # XenMan is a Xen management tool with a GTK
> based
> >> graphical interface
> >> # that allows for performing the standard set of
> >> domain operations
> >> # (start, stop, pause, kill, shutdown, reboot,
> >> snapshot, etc...). It
> >> # also attempts to simplify certain aspects such
> as
> >> the creation of
> >> # domains, as well as making the consoles
> available
> >> directly within the
> >> # tool's user interface.
> >> #
> >> #
> >> # This software is subject to the GNU Lesser
> General
> >> Public License (LGPL)
> >> # and for details, please consult it at:
> >> #
> >> #   
> http://www.fsf.org/licensing/licenses/lgpl.txt
> >> #
> >> # author : Jd <jd_jedi at users.sourceforge.net>
> >> #
> >>
> >> import paramiko
> >> from paramiko import SSHException
> >> import os, sys
> >> import getpass
> >> import socket
> >>
> >> """Paramiko helper class. Provides common
> functions
> >> as
> >>    -- validating host keys,
> >>    -- initializing a new transport,
> >>    -- agent based and password based
> authentication
> >> etc.
> >> """
> >> class HostValidationException(Exception):
> >>     def __init__(self, errno, description):
> >>         self.errno = errno
> >>         self.description = description
> >>
> >>     def __repr__(self):
> >>         return "[Error %s], %s" % (self.errno,
> >> self.description)
> >>
> >>     def __str__(self):
> >>         return self.__repr__()
> >>
> >> class AuthenticationException(Exception):
> >>     def __init__(self, errno, description):
> >>         self.errno = errno
> >>         self.description = description
> >>
> >>     def __repr__(self):
> >>         return "[Error %s], %s" % (self.errno,
> >> self.description)
> >>     
> >>     def __str__(self):
> >>         return self.__repr__()
> >>
> >>
> >> class CommunicationException(Exception):
> >>     def __init__(self, errno, description):
> >>         self.errno = errno
> >>         self.description = description
> >>
> >>     def __repr__(self):
> >>         return "[Error %s], %s" % (self.errno,
> >> self.description)
> >>
> >>     def __str__(self):
> >>         return self.__repr__()
> >>     
> >>
> >>
> >> class PHelper:
> >>     
> >>     host_keys = {}
> >>
> >>     # credential helper
> >>     credentials_helper = None
> >>
> >>     ## The credendital helper needs to
> >> get_credentials(hostname) method
> >>     ## to return credentials
> >>     ## the object returned should:
> >>     ##    get_username() and get_password()
> methods
> >>     ## This would be used when the transport can
> not
> >> be initialized
> >>     ## using given methods
> >>     
> >>     @classmethod
> >>     def set_credentials_helper(cls, cred_helper):
> >>         """ Set the helper class"""
> >>         cls.credentials_helper = cred_helper
> >>
> >>         
> >>     @classmethod
> >>     def load_keys(cls):
> >>         # TODO : May be we need to load
> >> /etc/ssh/known_hosts and merge it here.
> >>         try:
> >>             path =
> >> os.path.expanduser('~/.ssh/known_hosts')
> >>             cls.host_keys =
> >> paramiko.util.load_host_keys(path)
> >>         except IOError:
> 
=== message truncated ===



       
____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222



More information about the paramiko mailing list