PID check failed. RNG must be re-initialized after fork(). Hint: Try Random.atfork()
See original GitHub issuePID check failed. RNG must be re-initialized after fork(). Hint: Try Random.atfork()
gsutil exits with this message when I’m trying to copy a lot of large files to google storage:
gsutil -m cp -r /mnt/some/src gs://some/dest
It’s around 5000 files which vary in size. Their total size is around 100GB. Transfer sometimes succeeds and sometimes fails with the message above.
Issue Analytics
- State:
- Created 7 years ago
- Comments:18 (6 by maintainers)
Top Results From Across the Web
PyCrypto : AssertionError("PID check failed. RNG must be ...
You need to call Crypto.Random.atfork() after os.fork(). I just put the __init__() in the security module before the other ones.
Read more >PID check failed. RNG must be re-initialized after fork()
I use paramiko on top of the multiprocessing library, using queues to feed tasks to threads. Each thread or worker imports the paramiko...
Read more >Run Crypto.Random.atfork() when new worker process is ...
[1] "AssertionError: PID check failed. RNG must be re-initialized after fork(). Hint: Try Random.atfork()". -- You received this message because you are ...
Read more >PID check failed. RNG must be re-initialized after fork().
Hint : Try Random.atfork(). 2018-05-02 17:47:11,524 - main_check ...
Read more >Python Random.atfork Examples
... 'PID check failed. RNG must be re-initialized after fork(). Hint: Try Random.atfork()': Random.atfork() return Random.get_random_bytes(size). Example #4.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So, I think most folks don’t see this because it happens under a subset of runtime circumstances. We use oauth2client, which has mechanisms in place to fall back to “pure Python crypto” in the absence of pyOpenSSL – additionally, I believe this only happens when using service account credentials. Fun.
From the PyCrypto docs, I think the fix here is to call
Crypto
’sRandom.atfork()
method (ifCrypto
is installed and can be imported) in the parent and child every time we spawn a new process, whether that be withos.fork()
,multiprocessing.Process()
, etc.:I got the error as follows.
Failed RNG.