You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Nimrod Morag (JIRA)" <ji...@apache.org> on 2018/12/25 11:28:00 UTC

[jira] [Created] (AIRFLOW-3565) 404 response is unreachable

Nimrod Morag created AIRFLOW-3565:
-------------------------------------

             Summary: 404 response is unreachable
                 Key: AIRFLOW-3565
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3565
             Project: Apache Airflow
          Issue Type: Bug
          Components: webserver
    Affects Versions: 1.10.0
            Reporter: Nimrod Morag


when making a bad request (e.g. non existent URL), you get this error:

webserver_1 | [2018-12-25 11:13:53 +0000] [667] [ERROR] Error handling request /health
webserver_1 | Traceback (most recent call last):
webserver_1 | File "/usr/local/lib/python3.5/site-packages/gunicorn/workers/sync.py", line 135, in handle
webserver_1 | self.handle_request(listener, req, client, addr)
webserver_1 | File "/usr/local/lib/python3.5/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
webserver_1 | respiter = self.wsgi(environ, resp.start_response)
webserver_1 | File "/usr/local/lib/python3.5/site-packages/werkzeug/wsgi.py", line 826, in __call__
webserver_1 | return app(environ, start_response)
webserver_1 | File "/usr/local/lib/python3.5/site-packages/airflow/www/app.py", line 173, in root_app
webserver_1 | resp(b'404 Not Found', [(b'Content-Type', b'text/plain')])
webserver_1 | File "/usr/local/lib/python3.5/site-packages/gunicorn/http/wsgi.py", line 253, in start_response
webserver_1 | self.process_headers(headers)
webserver_1 | File "/usr/local/lib/python3.5/site-packages/gunicorn/http/wsgi.py", line 260, in process_headers
webserver_1 | raise TypeError('%r is not a string' % name)
webserver_1 | TypeError: b'Content-Type' is not a string

 

which raises a 500 Internal Server Error in the browser and not showing the hard-coded 404 response, because Gunicorn expects string in headers and Airflow sends bytes

 

site-packages/airflow/www/app.py lines 172-174

def root_app(env, resp):
    resp(b'404 Not Found', [(b'Content-Type', b'text/plain')])
    return [b'Apache Airflow is not at this location']



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)