Skip to content

Heroku and block_type='MODE_CBC' causes errors #41

@snoepkast

Description

@snoepkast

As per the recommendation in the source code we switched to block_type='MODE_CBC' for our encrypted fields, only to get the following error:

AssertionError
PID check failed. RNG must be re-initialized after fork(). Hint: Try Random.atfork()

Which is thrown by the Crypto library. After some googling around it seems this problem occurs when that library is used in combination with threading. So for example Celery and Heroku.

It is quite easy to fix, just call the Random.atfork() function before using Random in BaseEncryptedField (fields.py line 55 & 111).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions