Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 36547200CE7 for ; Sat, 16 Sep 2017 17:26:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 34AC81609D6; Sat, 16 Sep 2017 15:26:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7A8E91609D4 for ; Sat, 16 Sep 2017 17:26:08 +0200 (CEST) Received: (qmail 66836 invoked by uid 500); 16 Sep 2017 15:26:07 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 66827 invoked by uid 99); 16 Sep 2017 15:26:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Sep 2017 15:26:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 203EDC1379 for ; Sat, 16 Sep 2017 15:26:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id wmcFfLV1_KZ8 for ; Sat, 16 Sep 2017 15:26:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 32FF45FC8A for ; Sat, 16 Sep 2017 15:26:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 72C47E0F03 for ; Sat, 16 Sep 2017 15:26:05 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 04E2E25386 for ; Sat, 16 Sep 2017 15:26:03 +0000 (UTC) Date: Sat, 16 Sep 2017 15:26:03 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AIRFLOW-1600) Uncaught exceptions in get_fernet if cryptography package not installed. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 16 Sep 2017 15:26:09 -0000 [ 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 > 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 "", 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)