You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/09/16 15:26:02 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16168949#comment-16168949 ]
ASF subversion and git services commented on AIRFLOW-1600:
----------------------------------------------------------
Commit 8c8acba9fbb741ac5f1381320660422b40e355a9 in incubator-airflow's branch refs/heads/master from [~GeorgeSirois]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=8c8acba ]
[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
> 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)