Discussion:
[Fab-user] Fabric suddenly no longer working
Rob Marshall
2018-07-23 20:04:18 UTC
Permalink
Hi,

Is there a way to get more debugging information out of Fabric? I am having
problems doing even simple commands, e.g.:

***@robs-xubuntu2: [tools]$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from fabric.api import *
with
settings(warn_only=True,user='testuser01',password='TestPass01',prompt='assword',host_string='10.10.1.85'):
... results = sudo('w')
...
[10.10.1.85] sudo: w

***@robs-xubuntu2: [tools]$

As you an see, when I execute the command it crashes and I don't know why.

Thanks,

Rob
Rob Marshall
2018-07-23 21:26:51 UTC
Permalink
Hi,
Post by Rob Marshall
import paramiko
import os
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.load_host_keys(os.path.join(os.environ['HOME'],'.ssh','known_hosts'))
Post by Rob Marshall
ssh.connect('10.10.1.85',username='testuser01',password='TestPass01')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py", line
424, in connect
passphrase,
File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py", line
652, in _auth
self._transport.auth_publickey(username, key))
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line
1446, in auth_publickey
self.auth_handler.auth_publickey(username, key, my_event)
File "/usr/local/lib/python2.7/dist-packages/paramiko/auth_handler.py",
line 103, in auth_publickey
self._request_auth()
File "/usr/local/lib/python2.7/dist-packages/paramiko/auth_handler.py",
line 165, in _request_auth
self.transport._send_message(m)
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line
1707, in _send_message
self.packetizer.send_message(data)
File "/usr/local/lib/python2.7/dist-packages/paramiko/packet.py", line
385, in send_message
out = self.__block_engine_out.update(packet)
File
"/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/ciphers/base.py",
line 149, in update
return self._ctx.update(data)
File
"/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py",
line 120, in update
n = self.update_into(data, buf)
File
"/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py",
line 131, in update_into
"unsigned char *", self._backend._ffi.from_buffer(buf)
TypeError: from_buffer() cannot return the address of the raw string within
a str or unicode or bytearray object

I've tried various "fixes" I found for Ubuntu 16.04 and Python 2.7 but none
have fixed the problem.

Rob
Post by Rob Marshall
Hi,
Is there a way to get more debugging information out of Fabric? I am
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from fabric.api import *
with settings(warn_only=True,user='testuser01',password='
... results = sudo('w')
...
[10.10.1.85] sudo: w
As you an see, when I execute the command it crashes and I don't know why.
Thanks,
Rob
Jeff Forcier
2018-07-24 03:25:38 UTC
Permalink
If you check out the traceback, it's actually coming from the Cryptography
library, not Paramiko itself. I'd double check whether perhaps an upgraded
version of that library might be the trigger?

Otherwise, nothing about this jumps out at me with an obvious cause (you're
doing very normal things & it looks like it's code paths taken by the test
suite & almost all users all the time), so try the usual things:

- doublecheck what changed in your environment around the time of the error
- switch up some dependency versions (eg try an older Paramiko,
Cryptography or maybe even OpenSSL, if that's easy to do) to see if the
behavior stops with one of them
- search around Cryptography's issue tracker (
https://github.com/pyca/cryptography/issues) in case you find a hit (I
briefly search and didn't find anything, but it was extremely brief!)
- post more details about your latest setup (output of `pip list`, etc) in
case someone else notices a clue

Good luck,
Jeff
Post by Rob Marshall
Hi,
Post by Rob Marshall
import paramiko
import os
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.load_host_keys(os.path.join(os.environ['HOME'],'.ssh','
known_hosts'))
Post by Rob Marshall
ssh.connect('10.10.1.85',username='testuser01',password='TestPass01')
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py", line
424, in connect
passphrase,
File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py", line
652, in _auth
self._transport.auth_publickey(username, key))
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py",
line 1446, in auth_publickey
self.auth_handler.auth_publickey(username, key, my_event)
File "/usr/local/lib/python2.7/dist-packages/paramiko/auth_handler.py",
line 103, in auth_publickey
self._request_auth()
File "/usr/local/lib/python2.7/dist-packages/paramiko/auth_handler.py",
line 165, in _request_auth
self.transport._send_message(m)
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py",
line 1707, in _send_message
self.packetizer.send_message(data)
File "/usr/local/lib/python2.7/dist-packages/paramiko/packet.py", line
385, in send_message
out = self.__block_engine_out.update(packet)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/ciphers/base.py",
line 149, in update
return self._ctx.update(data)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py",
line 120, in update
n = self.update_into(data, buf)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py",
line 131, in update_into
"unsigned char *", self._backend._ffi.from_buffer(buf)
TypeError: from_buffer() cannot return the address of the raw string
within a str or unicode or bytearray object
I've tried various "fixes" I found for Ubuntu 16.04 and Python 2.7 but
none have fixed the problem.
Rob
Post by Rob Marshall
Hi,
Is there a way to get more debugging information out of Fabric? I am
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from fabric.api import *
with settings(warn_only=True,user='testuser01',password='TestPass
... results = sudo('w')
...
[10.10.1.85] sudo: w
As you an see, when I execute the command it crashes and I don't know why.
Thanks,
Rob
_______________________________________________
Fab-user mailing list
https://lists.nongnu.org/mailman/listinfo/fab-user
--
Jeff Forcier
Unix sysadmin; Python engineer
http://bitprophet.org
Rob Marshall
2018-07-24 04:51:38 UTC
Permalink
Hi,

Did some more checking and found:

https://github.com/pyca/cryptography/commit/0517d1ae49061f486e2e4d279d70b6b61361de2f

Part-way down in that thread was a note about Python CFFI. I followed the
instructions and removed the apt installed (I'm running Ubuntu
16.04) python-cffi-backend and then did:

sudo pip install --upgrade cffi

And now it works...

Thanks,

Rob
Post by Jeff Forcier
If you check out the traceback, it's actually coming from the Cryptography
library, not Paramiko itself. I'd double check whether perhaps an upgraded
version of that library might be the trigger?
Otherwise, nothing about this jumps out at me with an obvious cause
(you're doing very normal things & it looks like it's code paths taken by
- doublecheck what changed in your environment around the time of the error
- switch up some dependency versions (eg try an older Paramiko,
Cryptography or maybe even OpenSSL, if that's easy to do) to see if the
behavior stops with one of them
- search around Cryptography's issue tracker (https://github.com/pyca/
cryptography/issues) in case you find a hit (I briefly search and didn't
find anything, but it was extremely brief!)
- post more details about your latest setup (output of `pip list`, etc) in
case someone else notices a clue
Good luck,
Jeff
Post by Rob Marshall
Hi,
Post by Rob Marshall
import paramiko
import os
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.load_host_keys(os.path.join(os.environ['HOME'],'.ssh','k
nown_hosts'))
Post by Rob Marshall
ssh.connect('10.10.1.85',username='testuser01',password='TestPass01')
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py", line
424, in connect
passphrase,
File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py", line
652, in _auth
self._transport.auth_publickey(username, key))
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py",
line 1446, in auth_publickey
self.auth_handler.auth_publickey(username, key, my_event)
File "/usr/local/lib/python2.7/dist-packages/paramiko/auth_handler.py",
line 103, in auth_publickey
self._request_auth()
File "/usr/local/lib/python2.7/dist-packages/paramiko/auth_handler.py",
line 165, in _request_auth
self.transport._send_message(m)
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py",
line 1707, in _send_message
self.packetizer.send_message(data)
File "/usr/local/lib/python2.7/dist-packages/paramiko/packet.py", line
385, in send_message
out = self.__block_engine_out.update(packet)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/ciphers/base.py",
line 149, in update
return self._ctx.update(data)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py",
line 120, in update
n = self.update_into(data, buf)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py",
line 131, in update_into
"unsigned char *", self._backend._ffi.from_buffer(buf)
TypeError: from_buffer() cannot return the address of the raw string
within a str or unicode or bytearray object
I've tried various "fixes" I found for Ubuntu 16.04 and Python 2.7 but
none have fixed the problem.
Rob
Post by Rob Marshall
Hi,
Is there a way to get more debugging information out of Fabric? I am
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from fabric.api import *
with settings(warn_only=True,user='testuser01',password='TestPass
... results = sudo('w')
...
[10.10.1.85] sudo: w
As you an see, when I execute the command it crashes and I don't know why.
Thanks,
Rob
_______________________________________________
Fab-user mailing list
https://lists.nongnu.org/mailman/listinfo/fab-user
--
Jeff Forcier
Unix sysadmin; Python engineer
http://bitprophet.org
Jeff Forcier
2018-07-24 04:56:34 UTC
Permalink
Awesome! Glad to hear it.
Post by Rob Marshall
Hi,
https://github.com/pyca/cryptography/commit/0517d1ae49061f486e2e4d279d70b6
b61361de2f
Part-way down in that thread was a note about Python CFFI. I followed the
instructions and removed the apt installed (I'm running Ubuntu
sudo pip install --upgrade cffi
And now it works...
Thanks,
Rob
Post by Jeff Forcier
If you check out the traceback, it's actually coming from the
Cryptography library, not Paramiko itself. I'd double check whether perhaps
an upgraded version of that library might be the trigger?
Otherwise, nothing about this jumps out at me with an obvious cause
(you're doing very normal things & it looks like it's code paths taken by
- doublecheck what changed in your environment around the time of the error
- switch up some dependency versions (eg try an older Paramiko,
Cryptography or maybe even OpenSSL, if that's easy to do) to see if the
behavior stops with one of them
- search around Cryptography's issue tracker (
https://github.com/pyca/cryptography/issues) in case you find a hit (I
briefly search and didn't find anything, but it was extremely brief!)
- post more details about your latest setup (output of `pip list`, etc)
in case someone else notices a clue
Good luck,
Jeff
Post by Rob Marshall
Hi,
Post by Rob Marshall
import paramiko
import os
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.load_host_keys(os.path.join(os.environ['HOME'],'.ssh','k
nown_hosts'))
Post by Rob Marshall
ssh.connect('10.10.1.85',username='testuser01',password='Tes
tPass01')
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py",
line 424, in connect
passphrase,
File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py",
line 652, in _auth
self._transport.auth_publickey(username, key))
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py",
line 1446, in auth_publickey
self.auth_handler.auth_publickey(username, key, my_event)
File "/usr/local/lib/python2.7/dist-packages/paramiko/auth_handler.py",
line 103, in auth_publickey
self._request_auth()
File "/usr/local/lib/python2.7/dist-packages/paramiko/auth_handler.py",
line 165, in _request_auth
self.transport._send_message(m)
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py",
line 1707, in _send_message
self.packetizer.send_message(data)
File "/usr/local/lib/python2.7/dist-packages/paramiko/packet.py",
line 385, in send_message
out = self.__block_engine_out.update(packet)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/ciphers/base.py",
line 149, in update
return self._ctx.update(data)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py",
line 120, in update
n = self.update_into(data, buf)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py",
line 131, in update_into
"unsigned char *", self._backend._ffi.from_buffer(buf)
TypeError: from_buffer() cannot return the address of the raw string
within a str or unicode or bytearray object
I've tried various "fixes" I found for Ubuntu 16.04 and Python 2.7 but
none have fixed the problem.
Rob
Post by Rob Marshall
Hi,
Is there a way to get more debugging information out of Fabric? I am
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from fabric.api import *
with settings(warn_only=True,user='testuser01',password='TestPass
... results = sudo('w')
...
[10.10.1.85] sudo: w
As you an see, when I execute the command it crashes and I don't know why.
Thanks,
Rob
_______________________________________________
Fab-user mailing list
https://lists.nongnu.org/mailman/listinfo/fab-user
--
Jeff Forcier
Unix sysadmin; Python engineer
http://bitprophet.org
--
Jeff Forcier
Unix sysadmin; Python engineer
http://bitprophet.org
Rob Marshall
2018-07-24 04:59:03 UTC
Permalink
Hi,

And just for completeness sake:

I had previously upgraded paramiko to 2.4.1 and cryptography to 2.3 and
cffi is now at: 1.11.5.

Rob
Post by Jeff Forcier
Awesome! Glad to hear it.
Post by Rob Marshall
Hi,
https://github.com/pyca/cryptography/commit/0517d1ae49061f48
6e2e4d279d70b6b61361de2f
Part-way down in that thread was a note about Python CFFI. I followed the
instructions and removed the apt installed (I'm running Ubuntu
sudo pip install --upgrade cffi
And now it works...
Thanks,
Rob
Post by Jeff Forcier
If you check out the traceback, it's actually coming from the
Cryptography library, not Paramiko itself. I'd double check whether perhaps
an upgraded version of that library might be the trigger?
Otherwise, nothing about this jumps out at me with an obvious cause
(you're doing very normal things & it looks like it's code paths taken by
- doublecheck what changed in your environment around the time of the error
- switch up some dependency versions (eg try an older Paramiko,
Cryptography or maybe even OpenSSL, if that's easy to do) to see if the
behavior stops with one of them
- search around Cryptography's issue tracker (
https://github.com/pyca/cryptography/issues) in case you find a hit (I
briefly search and didn't find anything, but it was extremely brief!)
- post more details about your latest setup (output of `pip list`, etc)
in case someone else notices a clue
Good luck,
Jeff
Post by Rob Marshall
Hi,
Post by Rob Marshall
import paramiko
import os
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.load_host_keys(os.path.join(os.environ['HOME'],'.ssh','k
nown_hosts'))
Post by Rob Marshall
ssh.connect('10.10.1.85',username='testuser01',password='Tes
tPass01')
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py",
line 424, in connect
passphrase,
File "/usr/local/lib/python2.7/dist-packages/paramiko/client.py",
line 652, in _auth
self._transport.auth_publickey(username, key))
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py",
line 1446, in auth_publickey
self.auth_handler.auth_publickey(username, key, my_event)
File "/usr/local/lib/python2.7/dist-packages/paramiko/auth_handler.py",
line 103, in auth_publickey
self._request_auth()
File "/usr/local/lib/python2.7/dist-packages/paramiko/auth_handler.py",
line 165, in _request_auth
self.transport._send_message(m)
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py",
line 1707, in _send_message
self.packetizer.send_message(data)
File "/usr/local/lib/python2.7/dist-packages/paramiko/packet.py",
line 385, in send_message
out = self.__block_engine_out.update(packet)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/primitives/ciphers/base.py",
line 149, in update
return self._ctx.update(data)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py",
line 120, in update
n = self.update_into(data, buf)
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py",
line 131, in update_into
"unsigned char *", self._backend._ffi.from_buffer(buf)
TypeError: from_buffer() cannot return the address of the raw string
within a str or unicode or bytearray object
I've tried various "fixes" I found for Ubuntu 16.04 and Python 2.7 but
none have fixed the problem.
Rob
Post by Rob Marshall
Hi,
Is there a way to get more debugging information out of Fabric? I am
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from fabric.api import *
with settings(warn_only=True,user='testuser01',password='TestPass
... results = sudo('w')
...
[10.10.1.85] sudo: w
As you an see, when I execute the command it crashes and I don't know why.
Thanks,
Rob
_______________________________________________
Fab-user mailing list
https://lists.nongnu.org/mailman/listinfo/fab-user
--
Jeff Forcier
Unix sysadmin; Python engineer
http://bitprophet.org
--
Jeff Forcier
Unix sysadmin; Python engineer
http://bitprophet.org
Loading...