Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django application 504 error after saving model

I have a Django website running Django 1.8 with Python 3.4 and hosted on AWS via ElasticBeanstalk.

Recently, I've been having some issues with the Django admin area and 504 errors. The problem is very difficult to reproduce, it seems to happen randomly.

When I save an instance of a model, sometimes the website hangs and returns a 504 error (and doesn't save). Afterwhich elasticbeanstalk restarts the server and everything works fine again.

In my logs I get the following errors.

End of script output before headers: wsgi.py

extern "Python": function Cryptography_rand_bytes() called, but @ffi.def_extern() was not called in the current subinterpreter.  Returning 0.

These two errors are repeated multiple times. Can anyone help me figure out how I can debug this?

Thank you!

like image 497
arbz101 Avatar asked Feb 22 '16 05:02

arbz101


1 Answers

It is probably due to this bug https://github.com/pyca/cryptography/issues/2299

How to fix discussed here https://github.com/pyca/cryptography/issues/2473

Which seems to say uninstall python Cryptography library and then pip install version 1.1 of it

like image 56
Vorsprung Avatar answered Oct 04 '22 14:10

Vorsprung