George Sirois created AIRFLOW-1600:
--------------------------------------

             Summary: 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


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)

Reply via email to