datamade / war-chest

API for Chicago Aldermen's Campaign Funds
http://chicagoelections.datamade.us/war-chest/
1 stars 0 forks source link

error on production #33

Open derekeder opened 10 years ago

derekeder commented 10 years ago

http://chicagoelections.datamade.us/war-chest is throwing an error.

Dug in to the nginx error logs and found this:

2014/04/16 19:40:12 [error] 25091#0: *3 upstream prematurely closed connection while reading response header from upstream, client: 50.200.5.115, server: chicagoelections.datamade.us, request: "GET /war-chest/ HTTP/1.1", upstream: "http://127.0.0.1:7777/war-chest/", host: "chicagoelections.datamade.us"

Though that doesn't mean anything to me. Is there a better place to see python level error messages?

evz commented 10 years ago

It probably means the flask app is taking too long to respond. This is likely because that database is way huger now (since I scraped all the committees).

Two things you can do to fix this: increase the gunicorn timeout and increase the nginx timeout. The gunicorn process is being managed by upstart so the conf file for that is /etc/init/war-chest.conf . In that file you'll see a line that starts the gunicorn process. To increase the timeout, you can pass a -t flag and give it a timeout in seconds. The restart the app with sudo restart war-chest. For nginx, you'll need to set

proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600;

if it's not already set. Actually, 600 seconds is probably to generous but you get the idea.

Hope that helps,

Eric

On Wednesday, April 16, 2014, Derek Eder notifications@github.com wrote:

http://chicagoelections.datamade.us/war-chest is throwing an error.

Dug in to the nginx error logs and found this:

2014/04/16 19:40:12 [error] 25091#0: *3 upstream prematurely closed connection while reading response header from upstream, client: 50.200.5.115, server: chicagoelections.datamade.us, request: "GET /war-chest/ HTTP/1.1", upstream: "http://127.0.0.1:7777/war-chest/", host: "chicagoelections.datamade.us"

Though that doesn't mean anything to me. Is there a better place to see python level error messages?

— Reply to this email directly or view it on GitHubhttps://github.com/datamade/war-chest/issues/33 .

derekeder commented 10 years ago

@evz thanks - not a critical thing to fix right now. we can wait till you get back.

I think we should look in to fixing the query that takes so long instead of increasing the timout for the site.

On Wed, Apr 16, 2014 at 5:12 PM, Eric van Zanten notifications@github.comwrote:

It probably means the flask app is taking too long to respond. This is likely because that database is way huger now (since I scraped all the committees).

Two things you can do to fix this: increase the gunicorn timeout and increase the nginx timeout. The gunicorn process is being managed by upstart so the conf file for that is /etc/init/war-chest.conf . In that file you'll see a line that starts the gunicorn process. To increase the timeout, you can pass a -t flag and give it a timeout in seconds. The restart the app with sudo restart war-chest. For nginx, you'll need to set

proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600;

if it's not already set. Actually, 600 seconds is probably to generous but you get the idea.

Hope that helps,

Eric

On Wednesday, April 16, 2014, Derek Eder notifications@github.com wrote:

http://chicagoelections.datamade.us/war-chest is throwing an error.

Dug in to the nginx error logs and found this:

2014/04/16 19:40:12 [error] 25091#0: *3 upstream prematurely closed connection while reading response header from upstream, client: 50.200.5.115, server: chicagoelections.datamade.us, request: "GET /war-chest/ HTTP/1.1", upstream: "http://127.0.0.1:7777/war-chest/", host: "chicagoelections.datamade.us"

Though that doesn't mean anything to me. Is there a better place to see python level error messages?

— Reply to this email directly or view it on GitHub< https://github.com/datamade/war-chest/issues/33> .

— Reply to this email directly or view it on GitHubhttps://github.com/datamade/war-chest/issues/33#issuecomment-40659039 .

Derek Eder @derekeder https://twitter.com/#!/derekeder derekeder.com derek.eder@gmail.com