PID check failed. RNG must be re-initialized after fork()

Bug #649158 reported by Hugo Bernier on 2010-09-27
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
paramiko
Confirmed
Undecided
Unassigned
paramiko (Ubuntu)
Undecided
Unassigned

Bug Description

This bug has already been reported at the website below.
http://code.fabfile.org/issues/show/214

This issue occurs with paramiko 1.7.6 and pycrypto 2.1.0 on Arch Linux.

The website above links to a git diff:
http://github.com/sugarc0de/fabric/commit/ec39e90f5ffaaf5d2dd6a653f5f6ddef30a6b150

I applied it and it resolved the issue.

Hugo Bernier (hbernier) wrote :

Here is some more background on how to reproduce the problem. Theoretically, you would have to have access to multiple ssh servers to reproduce it, though I'm not sure how many.

I use paramiko on top of the multiprocessing library, using queues to feed tasks to threads. Each thread or worker imports the paramiko module, and using a library we developed for internal use, does RPC on hundreds of linux machines simultaneously. I run 64-128 threads at a time so I'm not sure at what point the issue occurs.

Clint Byrum (clint-fewbar) wrote :

Just experienced this on Ubuntu 11.04 alpha3 when using uec-run-instances from the cloud-utils package. To reproduce:

sudo apt-get install cloud-utils
--- setup Amazon EC2_PRIVATE_KEY and EC2_CERT environment variables
uec-run-instances -l your-launchpad-id -t m1.small --wait-for=ssh ami-da3eccb3

Result:

2011-03-15 14:43:12,906 root/WARNING: i-a2759bcd is pending
2011-03-15 14:43:22,694 ssh-key-scanner(i-a2759bcd)/ERROR: Unknown exception: PID check failed. RNG must be re-initialized after fork(). Hint: Try Random.atfork()
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: Traceback (most recent call last):
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: File "/usr/lib/pymodules/python2.7/paramiko/transport.py", line 1522, in run
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: self._send_kex_init()
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: File "/usr/lib/pymodules/python2.7/paramiko/transport.py", line 1686, in _send_kex_init
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: m.add_bytes(rng.read(16))
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: File "/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.py", line 185, in read
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: return self._singleton.read(bytes)
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: File "/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.py", line 161, in read
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: return _UserFriendlyRNG.read(self, bytes)
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: File "/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.py", line 120, in read
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: self._check_pid()
2011-03-15 14:43:22,805 ssh-key-scanner(i-a2759bcd)/ERROR: File "/usr/lib/python2.7/dist-packages/Crypto/Random/_UserFriendlyRNG.py", line 136, in _check_pid
2011-03-15 14:43:22,806 ssh-key-scanner(i-a2759bcd)/ERROR: raise AssertionError("PID check failed. RNG must be re-initialized after fork(). Hint: Try Random.atfork()")

python-paramiko:
  Installed: 1.7.6-5.1
  Candidate: 1.7.6-5.1
  Version table:
 *** 1.7.6-5.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/main amd64 Packages
        100 /var/lib/dpkg/status

Changed in paramiko:
status: New → Confirmed
Changed in paramiko (Ubuntu):
status: New → Confirmed
Thierry Carrez (ttx) wrote :

Refreshing patch, since original reference seems dead

tags: added: patch
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers