Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django email tracebacks are truncated (no stack trace) #214

Closed
cbay opened this issue Jun 1, 2011 · 13 comments
Closed

Django email tracebacks are truncated (no stack trace) #214

cbay opened this issue Jun 1, 2011 · 13 comments

Comments

@cbay
Copy link

cbay commented Jun 1, 2011

I migrated my application from Apache/mod_fcgid to gunicorn 0.12.2 with gevent as worker class. I'm using Django 1.2.5.

My email tracebacks are now received truncated, for instance:

DoesNotExist: Transaction matching query does not exist.


<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,

[...]

There's no stack trace, only the exception message. It used to work fine with Apache/mod_fcgid (I had a complete stack trace.)

I'll try to reproduce it with a minimal application. Everything else is working fine, by the way.

@davisp
Copy link
Collaborator

davisp commented Jun 2, 2011

@jasondavies ran into this today as well. He also noticed that Exception location in the debug=True report page didn't list the exception location. I could not reproduce this behaviour even grabbing his exact versions (except for maybe Gevent which is whatever is in PyPi as of about 10 minutes ago.

@jasondavies
Copy link

Okay, I've narrowed down the issue to being something to do with these lines in my worker config:

from psyco_gevent import make_psycopg_green
make_psycopg_green()
worker.log.info("Made Psycopg Green")

Removing them makes the DEBUG=True traceback work. So this could well be an issue with psyco_gevent rather than gunicorn.

@jasondavies
Copy link

You can get psyco_gevent from here.

@cbay
Copy link
Author

cbay commented Jun 2, 2011

I've got the exact same lines in my config.

@jasondavies
Copy link

I've managed to reproduce in a vanilla Django 1.3 project. The files are here: http://www.jasondavies.com/gunicorn-214/

@benoitc
Copy link
Owner

benoitc commented Aug 21, 2011

Can't reproduce on 325c5a8 with the test site above:

Traceback appears in console (This isn't displayed on the page by default)
Tracback appear on the page if Debug=True

Can you retry with lst trunk?

@benoitc
Copy link
Owner

benoitc commented Aug 22, 2011

Can't reproduce at all with different configurations. Im' closing this ticket then. Feel free to reopen one if needed. Thanks a lot for the feedback and tests anyway.

@benoitc benoitc closed this as completed Aug 22, 2011
@cbay
Copy link
Author

cbay commented Oct 19, 2011

The bug is still present. Jason's test project doesn't exhibit the bug because you have to connect to the database in the view, which will call psycopg_gevent's code. I've recreated a test project: http://share.alwaysdata.com/gunicorn_bug_214.tar.gz. Here is my full shell session, from creating the virtualenv to getting the bug (on my Ubuntu 11.04):

http://www.friendpaste.com/4tRW1ergfFWnUeKQXGSVRr

Note that you'll have to edit the settings.py to enter your PostgreSQL database settings. The database won't be touched at all (there are no models in the project).

@cbay
Copy link
Author

cbay commented Oct 20, 2011

It works fine with eventlet. So I guess I'll have to file a bug report at gevent.

@obeattie
Copy link

obeattie commented Sep 6, 2012

I'm encountering this issue now in production, which is extremely annoying. Does anyone know what happened with this (if anything?)

@denik
Copy link
Contributor

denik commented Sep 7, 2012

Here's some info on the issue: https://groups.google.com/forum/?fromgroups=#!topic/gevent/hdCT8cddnrw

@fdhenard
Copy link

From the previous comments, it appears that this was a bug in gevent. I'm using gunicorn 18 and pypi is showing that as the latest version. I don't have gevent in my pip requirements file, so I assume that gevent is a dependency for gunicorn and gunicorn resolves it (although I don't see that in setup.py). If that's the case, in order to call this fixed, wouldn't it make sense to change gunicorn so that the dependency on gevent is updated to the version where this issue is fixed, then bump the gunicorn version and publish that to pypi?

If I'm wrong about this, should I put an entry in my pip requirements file on the latest stable version of gevent in order to fix it?

Thanks!

@tilgovi
Copy link
Collaborator

tilgovi commented May 27, 2014

Gevent is not required for gunicorn. It is only required if you are using the gevent worker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants