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

Errors in code not displayed on the page #1408

daker opened this Issue Dec 12, 2016 · 0 comments


None yet
1 participant

daker commented Dec 12, 2016

Starting from this commit 03a944d gunicorn doesn't serve errors in code(ex SyntaxError or IndentationError), with traceback.format_tb, tb_string is an array while make_fail_app is expecting a string so if you have an error somewhere, you get this printed in the console instead showing the real error on the webpage

[2016-11-29 19:23:47 +0000] [8872] [ERROR] Error handling request
Traceback (most recent call last):
  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/workers/", line 182, in handle_request
  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/http/", line 344, in write
    raise TypeError('%r is not a byte' % arg)
TypeError: ['  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/workers/", line 143, in load_wsgi\n    self.wsgi =\n', '  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/app/", line 67, in wsgi\n    self.callable = self.load()\n', '  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/app/", line 65, in load\n    return self.load_wsgiapp()\n', '  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/app/", line 52, in load_wsgiapp\n    return util.import_app(self.app_uri)\n', '  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/", line 378, in import_app\n    __import__(module)\n'] is not a byte

You only get the real error on the console when gunicorn starts but if you hit the webpage you get nothing(ERR_CONTENT_LENGTH_MISMATCH) and the not a byte error is displayed on the console

[2016-11-29 19:20:53 +0000] [8867] [INFO] Starting gunicorn 19.6.0
[2016-11-29 19:20:53 +0000] [8867] [INFO] Listening at: (8867)
[2016-11-29 19:20:53 +0000] [8867] [INFO] Using worker: sync
[2016-11-29 19:20:53 +0000] [8872] [INFO] Booting worker with pid: 8872
[2016-11-29 19:20:53 +0000] [8872] [ERROR] unexpected indent (, line 7)
Traceback (most recent call last):
  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/workers/", line 143, in load_wsgi
    self.wsgi =
  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/app/", line 67, in wsgi
    self.callable = self.load()
  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/app/", line 65, in load
    return self.load_wsgiapp()
  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/app/", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/daker/Projets/guni/env/local/lib/python2.7/site-packages/gunicorn/", line 378, in import_app
  File "/home/daker/Projets/guni/", line 7
    start_response(status, response_headers)
IndentationError: unexpected indent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment