airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <>
Subject [jira] [Commented] (AIRFLOW-1600) Uncaught exceptions in get_fernet if cryptography package not installed.
Date Sat, 16 Sep 2017 15:26:03 GMT


ASF subversion and git services commented on AIRFLOW-1600:

Commit ad963e7044b1a512681e2272d459aa0b59589c77 in incubator-airflow's branch refs/heads/v1-9-test
from [~GeorgeSirois]
[;h=ad963e7 ]

[AIRFLOW-1600] Fix exception handling in get_fernet

Also adds LoggingMixin to Connection so it can use

Closes #2600 from GeorgeSirois/fix-fernet-no-

(cherry picked from commit 8c8acba9fbb741ac5f1381320660422b40e355a9)
Signed-off-by: Bolke de Bruin <>

> Uncaught exceptions in get_fernet if cryptography package not installed.
> ------------------------------------------------------------------------
>                 Key: AIRFLOW-1600
>                 URL:
>             Project: Apache Airflow
>          Issue Type: Bug
>    Affects Versions: 1.9.0
>            Reporter: George Sirois
>            Assignee: George Sirois
>            Priority: Minor
>             Fix For: 1.9.0
> The change from has a small flaw
that causes issues when attempting to write extras when the cryptography package is not installed.
> Because {{ImportError}} is redefined as a model later in the file, it prevents proper
handling of the exception.
> Running {{airflow initdb}} (or editing settings later in a running system) will result
in errors like the following:
> {code}
>   File "<string>", line 1, in __set__
>   File "/workspace/incubator-airflow/airflow/", line 646, in set_extra
>     fernet = get_fernet()
>   File "/workspace/incubator-airflow/airflow/", line 101, in get_fernet
>     from cryptography.fernet import Fernet
> ImportError: No module named cryptography.fernet
> {code}
> The solution is to explicitly include the module for the {{ImportError}} exception +
add the LoggingMixin to the classes that catch the error so that they can log the warnings

This message was sent by Atlassian JIRA

View raw message