views:

210

answers:

2

I have an app that uses Django with FCGI on nginx. I'm using the third-party apps like James Bennett's django-registration and django-messages from the Pinax Project. Both of these apps have forms that are submitted and save data into the database, then redirect on to a new URL.

My issue seems to be that the .save() method on any of the forms in these apps cause a 504 gateway time-out when the forms are submitted. All of the data is saved in the database as it should be, however neither seems to ever return anything to the app after the form is saved.

I've done some logging at various points in the code and there are no errors. It's as if the save() methods on the form or the models the forms are connected to simply never return anything--error or otherwise.

With this lack of detail, an answer might be a dream for me, but just a nudge in the right direction or a way to diagnose the issue more completely would be fantastic.

A: 

Typically 504's in nginx happen due to timeout between nginx and the fastcgi process. You may want to take a look at your nginx settings and up the fastcgi_read_timeout setting?

Your nginx error log will typically provide a bit more information as to why things are not working as well. If you're on a *nix distro it's typically in "/var/log/nginx/error.log"

Owen
I'll tweak that setting tonight and see what the difference is. It's strange that the work being done in the code where the timeouts occur is not all that serious or time-consuming. In some cases, it's saving a single modelform and then returning. Thanks for the pointer. I'll let you know the results.
aezell
A: 

Turns out the problem was completely unrelated to nginx, but was Django having a timeout when trying to send an email. Unfortunately, it doesn't drop an error message or any indication that it can't connect to the email server.

aezell