[
https://issues.apache.org/jira/browse/AIRFLOW-3565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16969052#comment-16969052
]
jack commented on AIRFLOW-3565:
-------------------------------
Is this still an issue? We are 6 releases after 1.10.0
> 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
> Priority: Minor
> Labels: easyfix, newbie
> Original Estimate: 0.25h
> Remaining Estimate: 0.25h
>
> 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
(v8.3.4#803005)