Paramiko Issue : Invalid packet blocking

Paramiko Issue : Invalid packet blocking

Postby chandrani » Fri Jul 22, 2016 9:59 am

Hi All,
I am using paramiko 1.16.0 on centos with Pycrypto2.7 .While connecting using Paramiko sshClient as well as transport connect I am getting

paramiko.ssh_exception.SSHException: Invalid packet blocking

SSh works fine. This code passes in someother VMS . While looking at the packets using wireshark I found that handshaking works fine but sshd server sends encrypted packets of length 80 in the failing VMS while it is 64 in passing VMS . This is the only difference which I observed in two packets.
Can anyone suggest why the encrypted packet length is different in the passing and failing VMS?
Is there anything else which i should check or I missed for which this issue might arise?


Below is the exception chain:
Code: Select all
  File "testFailVMS.py", line 28, in <module>
    initialSetUp.connect(username='hpadmin', password='hpinvent')
  File "/usr/lib/python3.4/site-packages/paramiko/transport.py", line 1098, in connect
    self.auth_password(username, password)
  File "/usr/lib/python3.4/site-packages/paramiko/transport.py", line 1262, in auth_password
    return self.auth_handler.wait_for_response(my_event)
  File "/usr/lib/python3.4/site-packages/paramiko/auth_handler.py", line 197, in wait_for_response
    raise e
  File "/usr/lib/python3.4/site-packages/paramiko/transport.py", line 1726, in run
    ptype, m = self.packetizer.read_message()
  File "/usr/lib/python3.4/site-packages/paramiko/packet.py", line 396, in read_message------   It is getting leftover which is not multiple of 8 when the size is 80
    raise SSHException('Invalid packet blocking')
paramiko.ssh_exception.SSHException: Invalid packet blocking


Thanks
Chandrani
Last edited by Yoriz on Fri Jul 22, 2016 1:52 pm, edited 1 time in total.
Reason: First post lock. Added code tags
chandrani
 
Posts: 6
Joined: Fri Jul 22, 2016 9:45 am

Re: Paramiko Issue : Invalid packet blocking

Postby micseydel » Sat Jul 23, 2016 2:08 am

From the bit of research I've done here are my thoughts:
When it works fine over SSH, it might be because there's a cipher difference. I'd check that first.
There could be a bug in Paramiko.
There could be a bug in the SSH server you're using.

You can file a bug against Paramiko if you think that's the case, or you can look up RFCs and consider what you've seen in Wireshark or read Paramiko's source (Packetizer.read_message is where this exception gets thrown).

Someone might be a genius here, but I'm afraid our ability to help further with this problem is pretty limited.
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
micseydel
 
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: Paramiko Issue : Invalid packet blocking

Postby chandrani » Mon Jul 25, 2016 5:43 am

Hi Micseydel,
Thanks for your reply.
1. SSHD Server: It does not seem to be an sshd issue because it is the same server in which the test is passing in other VM.
2. Cipher used is the same in both cases because in wireshark the algorithm displayed is aes-128
What I checked last day was there is some issues with the failing VM setup which I am not able to find out.
What could be the reason of underlying packet length changing on the failing VM beacause the Cipher used is same in bothe the cases.
This might be a bug in Paramiko but it is happening because of the underlying packet length change.
As this is my Root Cause Analysis phase so I need to dig into the reason of failure.

Looking forward for help.....
chandrani
 
Posts: 6
Joined: Fri Jul 22, 2016 9:45 am

Re: Paramiko Issue : Invalid packet blocking

Postby micseydel » Mon Jul 25, 2016 5:47 am

As I said before, you might not get any more help here. This is a pretty specific problem, and we can't reproduce it locally to tinker.
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
micseydel
 
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: Paramiko Issue : Invalid packet blocking

Postby chandrani » Mon Jul 25, 2016 5:56 am

Hi Micseydel,
Thanks for your reply. Yes I do agree that this is a specific problem related to our local environment setup. Shall post the failure details if I find some.
chandrani
 
Posts: 6
Joined: Fri Jul 22, 2016 9:45 am

Re: Paramiko Issue : Invalid packet blocking

Postby chandrani » Wed Jul 27, 2016 6:38 am

Hi All,
Finally i found the issue. The issue was with Python build. Probably during the previous build some libraries were not installed on missing in CentOS.
I enabled YUM and installed "Development Tools" and few other libraries which were needed like db4-devel etc. After which i build Python and everything worked fine..... So though I had a working version of Python3.4 i had some build issues for sure.
chandrani
 
Posts: 6
Joined: Fri Jul 22, 2016 9:45 am

Re: Paramiko Issue : Invalid packet blocking

Postby micseydel » Wed Jul 27, 2016 7:05 am

Thanks for posting back. That's an unhelpful error message for the problem, people might really benefit from what you found out! :)
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
micseydel
 
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA


Return to Networking

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests