Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-6345

ProxyFix fails on 1.10.7 due to TypeError

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.10.7
    • Fix Version/s: 1.10.8
    • Component/s: ui
    • Labels:
      None

      Description

      When enabling the Werkzeug ProxyFix middleware on Airflow 1.10.7, the following error is thrown by the webserver on every request:

      Traceback (most recent call last):
       File "/usr/local/lib/python3.6/dist-packages/gunicorn/workers/sync.py", line 135, in handle
       self.handle_request(listener, req, client, addr)
       File "/usr/local/lib/python3.6/dist-packages/gunicorn/workers/sync.py", line 176, in handle_request
       respiter = self.wsgi(environ, resp.start_response)
       File "/usr/local/lib/python3.6/dist-packages/werkzeug/middleware/dispatcher.py", line 66, in __call__
       return app(environ, start_response)
       File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 2463, in __call__
       return self.wsgi_app(environ, start_response)
       File "/usr/local/lib/python3.6/dist-packages/werkzeug/middleware/proxy_fix.py", line 200, in __call__
       self.x_proto, environ_get("HTTP_X_FORWARDED_PROTO")
       File "/usr/local/lib/python3.6/dist-packages/werkzeug/middleware/proxy_fix.py", line 166, in _get_trusted_comma
       if len(values) >= trusted:
      TypeError: '>=' not supported between instances of 'int' and 'str'
      

      It appears this regression was caused by AIRFLOW-6188, which made the ProxyFix parameters configurable, but now returns strings instead of the integers expected by Werkzeug, causing the TypeError above.

      I have a PR ready, which I will attach momentarily.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dacohen Daniel Cohen
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: