Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PanicException: Python API call failed for Cryptography package

I am running Python unit tests in Jenkins with moto for mocking SSM parameters. They worked just fine, until today I did upgrade Python version (3.9.8 -> 3.9.15) and got an error in Jenkins when collecting items for test session:

    from cryptography.hazmat.binding._rust import exceptions as rust_exceptions
    pyo3_runtime.PanicException: Python API call failed

The build works just fine locally, but crashes in Jenkins. I have rolled back to previous package versions, but it persists. I compared it with a last successful build and Moto, Cryptography, Boto versions are identical. At this point I am really running out of possible options, as it seems there are virtually no differences between the version that currently fails in Jenkins and that succeeded yesterday. Thanks for any help!

like image 809
ignacywawa Avatar asked Mar 06 '26 18:03

ignacywawa


1 Answers

Install cffi:

pip install cffi --upgrade
like image 101
DanielM Avatar answered Mar 08 '26 14:03

DanielM