airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (AIRFLOW-2938) Invalid 'extra' field in connection can raise an AttributeError when attempting to edit
Date Thu, 23 Aug 2018 22:45:00 GMT


ASF GitHub Bot commented on AIRFLOW-2938:

feng-tao closed pull request #3785: [AIRFLOW-2938] Handle improperly formatted extra field
in connection …

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/hooks/ b/airflow/hooks/
index c449fe0c15..caa89d3142 100644
--- a/airflow/hooks/
+++ b/airflow/hooks/
@@ -70,7 +70,11 @@ def get_conn(self, headers=None):
         if conn.login:
             session.auth = (conn.login, conn.password)
         if conn.extra:
-            session.headers.update(conn.extra_dejson)
+            try:
+                session.headers.update(conn.extra_dejson)
+            except TypeError:
+                self.log.warn('Connection to {} has invalid extra field.'.format(
         if headers:
diff --git a/airflow/www_rbac/ b/airflow/www_rbac/
index 3ab872d5b1..d011724cc6 100644
--- a/airflow/www_rbac/
+++ b/airflow/www_rbac/
@@ -1922,6 +1922,11 @@ def prefill_form(self, form, pk):
         except Exception:
             d = {}
+        if not hasattr(d, 'get'):
+            logging.warning('extra field for {} is not iterable'.format(
+      'conn_id', '<unknown>')))
+            return
         for field in self.extra_fields:
             value = d.get(field, '')
             if value:


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> Invalid 'extra' field in connection can raise an AttributeError when attempting to edit
> ---------------------------------------------------------------------------------------
>                 Key: AIRFLOW-2938
>                 URL:
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: William Pursell
>            Assignee: William Pursell
>            Priority: Minor
> When the extra field of a connection is not an iterable json object, attempting to edit
the connection can lead to a stack trace "Ooops": 
> AttributeError: 'NoneType' object has no attribute 'get'

This message was sent by Atlassian JIRA

View raw message