airflow-commits mailing list archives

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

    [ https://issues.apache.org/jira/browse/AIRFLOW-1600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16168950#comment-16168950
] 

ASF subversion and git services commented on AIRFLOW-1600:
----------------------------------------------------------

Commit ad963e7044b1a512681e2272d459aa0b59589c77 in incubator-airflow's branch refs/heads/v1-9-test
from [~GeorgeSirois]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=ad963e7 ]

[AIRFLOW-1600] Fix exception handling in get_fernet

Also adds LoggingMixin to Connection so it can use
self.logger.

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

(cherry picked from commit 8c8acba9fbb741ac5f1381320660422b40e355a9)
Signed-off-by: Bolke de Bruin <bolke@xs4all.nl>


> 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)

Mime
View raw message