From commits-return-26242-archive-asf-public=cust-asf.ponee.io@airflow.incubator.apache.org Fri Oct 26 15:27:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id F315D180647 for ; Fri, 26 Oct 2018 15:27:04 +0200 (CEST) Received: (qmail 19485 invoked by uid 500); 26 Oct 2018 13:27:04 -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 19475 invoked by uid 99); 26 Oct 2018 13:27:04 -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; Fri, 26 Oct 2018 13:27:04 +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 A44AAC6B40 for ; Fri, 26 Oct 2018 13:27:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.5 X-Spam-Level: X-Spam-Status: No, score=-109.5 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_SPF_WL=-7.5, 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 aoFrdLZfXm3G for ; Fri, 26 Oct 2018 13:27:01 +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 7669B5F5E0 for ; Fri, 26 Oct 2018 13:27:01 +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 0280DE25B0 for ; Fri, 26 Oct 2018 13:27:01 +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 7D6372669E for ; Fri, 26 Oct 2018 13:27:00 +0000 (UTC) Date: Fri, 26 Oct 2018 13:27:00 +0000 (UTC) From: "Ash Berlin-Taylor (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AIRFLOW-1970) Database cannot be initialized if an invalid fernet key is provided MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AIRFLOW-1970?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ash Berlin-Taylor updated AIRFLOW-1970: --------------------------------------- Fix Version/s: 1.10.1 > Database cannot be initialized if an invalid fernet key is provided > ------------------------------------------------------------------- > > Key: AIRFLOW-1970 > URL: https://issues.apache.org/jira/browse/AIRFLOW-1970 > Project: Apache Airflow > Issue Type: Bug > Components: configuration > Affects Versions: 1.9.0 > Environment: Python 2.7.12 > PostgreSQL 9.6.3 > Reporter: Michael Backes > Assignee: Jaros=C5=82aw =C5=9Amietanka > Priority: Major > Fix For: 2.0.0, 1.10.1 > > > If I use an invalid fernet key in my config file, I'm not able to run "ai= rflow initdb" successfully. > For example if I have the following in my config: > {panel:title=3Dairflow.cfg} > ... > \\# Secret key to save connection passwords in the db > fernet_key =3D xxx > ... > {panel} > I will get the following error when running "airflow initdb": > {panel:title=3Dlog} > [2018-01-05 16:43:00,525] {__init__.py:45} INFO - Using executor LocalExe= cutor > DB: postgresql+psycopg2://airflow_user:secret_pw@some.address:5432/airflo= w > [2018-01-05 16:43:00,624] {db.py:312} INFO - Creating tables > INFO [alembic.runtime.migration] Context impl PostgresqlImpl. > INFO [alembic.runtime.migration] Will assume transactional DDL. > Traceback (most recent call last): > File "/usr/local/bin/airflow", line 27, in > args.func(args) > File "/usr/local/lib/python2.7/site-packages/airflow/bin/cli.py", line = 897, in initdb > db_utils.initdb() > File "/usr/local/lib/python2.7/site-packages/airflow/utils/db.py", line= 114, in initdb > schema=3D'airflow_ci')) > File "", line 4, in __init__ > File "/usr/local/lib64/python2.7/site-packages/sqlalchemy/orm/state.py"= , line 414, in _initialize_instance > manager.dispatch.init_failure(self, args, kwargs) > File "/usr/local/lib64/python2.7/site-packages/sqlalchemy/util/langhelp= ers.py", line 66, in __exit__ > compat.reraise(exc_type, exc_value, exc_tb) > File "/usr/local/lib64/python2.7/site-packages/sqlalchemy/orm/state.py"= , line 411, in _initialize_instance > return manager.original_init(*mixed[1:], **kwargs) > File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 5= 78, in __init__ > self.extra =3D extra > File "", line 1, in __set__ > File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 6= 39, in set_extra > fernet =3D get_fernet() > File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 1= 05, in get_fernet > return Fernet(configuration.get('core', 'FERNET_KEY').encode('utf-8')= ) > File "/usr/local/lib64/python2.7/site-packages/cryptography/fernet.py",= line 34, in __init__ > key =3D base64.urlsafe_b64decode(key) > File "/usr/lib64/python2.7/base64.py", line 119, in urlsafe_b64decode > return b64decode(s.translate(_urlsafe_decode_translation)) > File "/usr/lib64/python2.7/base64.py", line 78, in b64decode > raise TypeError(msg) > TypeError: Incorrect padding > {panel} > I also got an error when I try to add extras to a connection, if fernet_k= ey is empty in the config file. The error message was "Incorrect padding". = Once I provided a valid key generated with the instructions given [here|htt= p://airflow.readthedocs.io/en/latest/configuration.html?highlight=3Dfernet#= connections] and restarted all of the airflow services it worked without an= y issues. -- This message was sent by Atlassian JIRA (v7.6.3#76005)