You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Bolke de Bruin (JIRA)" <ji...@apache.org> on 2017/09/16 15:26:03 UTC

[jira] [Resolved] (AIRFLOW-1600) Uncaught exceptions in get_fernet if cryptography package not installed.

     [ https://issues.apache.org/jira/browse/AIRFLOW-1600?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bolke de Bruin resolved AIRFLOW-1600.
-------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.9.0

Issue resolved by pull request #2600
[https://github.com/apache/incubator-airflow/pull/2600]

> Uncaught exceptions in get_fernet if cryptography package not installed.
> ------------------------------------------------------------------------
>
>                 Key: AIRFLOW-1600
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1600
>             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 https://github.com/apache/incubator-airflow/pull/2527 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/models.py", line 646, in set_extra
>     fernet = get_fernet()
>   File "/workspace/incubator-airflow/airflow/models.py", 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 properly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)