airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trevor Edwards (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (AIRFLOW-1687) Models.py Connection failing from base64 TypeError when encryption is not used.
Date Thu, 05 Oct 2017 21:25:00 GMT

     [ https://issues.apache.org/jira/browse/AIRFLOW-1687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Trevor Edwards reassigned AIRFLOW-1687:
---------------------------------------

    Assignee: Trevor Edwards

> Models.py Connection failing from base64 TypeError when encryption is not used.
> -------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-1687
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1687
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Trevor Edwards
>            Assignee: Trevor Edwards
>
> This issue appears to be related to AIRFLOW-1516 and was noticed when testing 1.9.0alpha0
from 1.8.2.
> If the user has configured the fernet key to be "cryptography_not_found_storing_passwords_in_plain_text",
airflow/models.py's Connection class fails when attempting to call set_extra. The error raised
is:
> {code:none}
> File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 574, in __init__
> self.extra = extra
> File "<string>", line 1, in __set__
> File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 635, in set_extra
> fernet = get_fernet()
> File "/usr/local/lib/python2.7/site-packages/airflow/models.py", line 102, in get_fernet
> return Fernet(configuration.get('core', 'FERNET_KEY').encode('utf-8'))
> File "/usr/local/lib/python2.7/site-packages/cryptography/fernet.py", line 34, in __init__
> key = base64.urlsafe_b64decode(key)
> File "/usr/local/lib/python2.7/base64.py", line 119, in urlsafe_b64decode
> return b64decode(s.translate(_urlsafe_decode_translation))
> File "/usr/local/lib/python2.7/base64.py", line 78, in b64decode
> raise TypeError(msg)
> TypeError: Incorrect padding
> {code}
> It appears that 1.8 would catch any error as a flag to disable encryption:
> https://github.com/apache/incubator-airflow/blob/v1-8-stable/airflow/models.py#L94
> Whereas 1.9 only catches ValueError, allowing a TypeError to pass through:
> https://github.com/apache/incubator-airflow/blob/v1-9-test/airflow/models.py#L103
> A possible solution is to also catch TypeError here, or revert to catching any error.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message