airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tiantian Gao (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AIRFLOW-1543) Improve logging when `fernet_key` format is incorrect
Date Tue, 29 Aug 2017 15:06:00 GMT

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

Tiantian Gao updated AIRFLOW-1543:
----------------------------------
    Description: 
Using the default airflow.cfg, and modify "fernet_key" to some thing like "sdfsdfsfsdf", which
incorrect format.

then run "airflow initdb", raise below 

{code}
[2017-08-29 23:01:20,197] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2017-08-29 23:01:20,231] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
[2017-08-29 23:01:20,436] {__init__.py:45} INFO - Using executor SequentialExecutor
DB: sqlite:////home/ubuntu/airflow/airflow.db
[2017-08-29 23:01:20,618] {db.py:311} INFO - Creating tables
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/cffi/model.py:525:
UserWarning: 'point_conversion_form_t' has no values explicitly defined; guessing that it
is equivalent to 'unsigned int'
  % self._get_c_name())
Traceback (most recent call last):
  File "/home/ubuntu/src/incubator-airflow/.venv/bin/airflow", line 10, in <module>
    execfile(__file__)
  File "/home/ubuntu/src/incubator-airflow/airflow/bin/airflow", line 28, in <module>
    args.func(args)
  File "/home/ubuntu/src/incubator-airflow/airflow/bin/cli.py", line 894, in initdb
    db_utils.initdb()
  File "/home/ubuntu/src/incubator-airflow/airflow/utils/db.py", line 112, in initdb
    schema='airflow_ci'))
  File "<string>", line 4, in __init__
  File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/state.py",
line 414, in _initialize_instance
    manager.dispatch.init_failure(self, args, kwargs)
  File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py",
line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/state.py",
line 411, in _initialize_instance
    return manager.original_init(*mixed[1:], **kwargs)
  File "/home/ubuntu/src/incubator-airflow/airflow/models.py", line 585, in __init__
    self.extra = extra
  File "<string>", line 1, in __set__
  File "/home/ubuntu/src/incubator-airflow/airflow/models.py", line 646, in set_extra
    fernet = get_fernet()
  File "/home/ubuntu/src/incubator-airflow/airflow/models.py", line 105, in get_fernet
    return Fernet(configuration.get('core', 'FERNET_KEY').encode('utf-8'))
  File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/cryptography/fernet.py",
line 34, in __init__
    key = base64.urlsafe_b64decode(key)
  File "/usr/lib/python2.7/base64.py", line 112, in urlsafe_b64decode
    return b64decode(s, '-_')
  File "/usr/lib/python2.7/base64.py", line 76, in b64decode
    raise TypeError(msg)
TypeError: Incorrect padding
{code}


  was:
Using the default airflow.cfg, and modify "fernet_key" to some thing like "sdfsdfsfsdf", which
incorrect format.

then run "airflow initdb", raise below 

{code:python}
[2017-08-29 23:01:20,197] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2017-08-29 23:01:20,231] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
[2017-08-29 23:01:20,436] {__init__.py:45} INFO - Using executor SequentialExecutor
DB: sqlite:////home/ubuntu/airflow/airflow.db
[2017-08-29 23:01:20,618] {db.py:311} INFO - Creating tables
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/cffi/model.py:525:
UserWarning: 'point_conversion_form_t' has no values explicitly defined; guessing that it
is equivalent to 'unsigned int'
  % self._get_c_name())
Traceback (most recent call last):
  File "/home/ubuntu/src/incubator-airflow/.venv/bin/airflow", line 10, in <module>
    execfile(__file__)
  File "/home/ubuntu/src/incubator-airflow/airflow/bin/airflow", line 28, in <module>
    args.func(args)
  File "/home/ubuntu/src/incubator-airflow/airflow/bin/cli.py", line 894, in initdb
    db_utils.initdb()
  File "/home/ubuntu/src/incubator-airflow/airflow/utils/db.py", line 112, in initdb
    schema='airflow_ci'))
  File "<string>", line 4, in __init__
  File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/state.py",
line 414, in _initialize_instance
    manager.dispatch.init_failure(self, args, kwargs)
  File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py",
line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/state.py",
line 411, in _initialize_instance
    return manager.original_init(*mixed[1:], **kwargs)
  File "/home/ubuntu/src/incubator-airflow/airflow/models.py", line 585, in __init__
    self.extra = extra
  File "<string>", line 1, in __set__
  File "/home/ubuntu/src/incubator-airflow/airflow/models.py", line 646, in set_extra
    fernet = get_fernet()
  File "/home/ubuntu/src/incubator-airflow/airflow/models.py", line 105, in get_fernet
    return Fernet(configuration.get('core', 'FERNET_KEY').encode('utf-8'))
  File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/cryptography/fernet.py",
line 34, in __init__
    key = base64.urlsafe_b64decode(key)
  File "/usr/lib/python2.7/base64.py", line 112, in urlsafe_b64decode
    return b64decode(s, '-_')
  File "/usr/lib/python2.7/base64.py", line 76, in b64decode
    raise TypeError(msg)
TypeError: Incorrect padding
{code}



> Improve logging when `fernet_key` format is incorrect
> -----------------------------------------------------
>
>                 Key: AIRFLOW-1543
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1543
>             Project: Apache Airflow
>          Issue Type: Bug
>    Affects Versions: 1.9.0
>            Reporter: Tiantian Gao
>            Priority: Minor
>              Labels: newbie
>
> Using the default airflow.cfg, and modify "fernet_key" to some thing like "sdfsdfsfsdf",
which incorrect format.
> then run "airflow initdb", raise below 
> {code}
> [2017-08-29 23:01:20,197] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
> [2017-08-29 23:01:20,231] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
> [2017-08-29 23:01:20,436] {__init__.py:45} INFO - Using executor SequentialExecutor
> DB: sqlite:////home/ubuntu/airflow/airflow.db
> [2017-08-29 23:01:20,618] {db.py:311} INFO - Creating tables
> INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
> INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
> /home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/cffi/model.py:525:
UserWarning: 'point_conversion_form_t' has no values explicitly defined; guessing that it
is equivalent to 'unsigned int'
>   % self._get_c_name())
> Traceback (most recent call last):
>   File "/home/ubuntu/src/incubator-airflow/.venv/bin/airflow", line 10, in <module>
>     execfile(__file__)
>   File "/home/ubuntu/src/incubator-airflow/airflow/bin/airflow", line 28, in <module>
>     args.func(args)
>   File "/home/ubuntu/src/incubator-airflow/airflow/bin/cli.py", line 894, in initdb
>     db_utils.initdb()
>   File "/home/ubuntu/src/incubator-airflow/airflow/utils/db.py", line 112, in initdb
>     schema='airflow_ci'))
>   File "<string>", line 4, in __init__
>   File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/state.py",
line 414, in _initialize_instance
>     manager.dispatch.init_failure(self, args, kwargs)
>   File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py",
line 66, in __exit__
>     compat.reraise(exc_type, exc_value, exc_tb)
>   File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/state.py",
line 411, in _initialize_instance
>     return manager.original_init(*mixed[1:], **kwargs)
>   File "/home/ubuntu/src/incubator-airflow/airflow/models.py", line 585, in __init__
>     self.extra = extra
>   File "<string>", line 1, in __set__
>   File "/home/ubuntu/src/incubator-airflow/airflow/models.py", line 646, in set_extra
>     fernet = get_fernet()
>   File "/home/ubuntu/src/incubator-airflow/airflow/models.py", line 105, in get_fernet
>     return Fernet(configuration.get('core', 'FERNET_KEY').encode('utf-8'))
>   File "/home/ubuntu/src/incubator-airflow/.venv/local/lib/python2.7/site-packages/cryptography/fernet.py",
line 34, in __init__
>     key = base64.urlsafe_b64decode(key)
>   File "/usr/lib/python2.7/base64.py", line 112, in urlsafe_b64decode
>     return b64decode(s, '-_')
>   File "/usr/lib/python2.7/base64.py", line 76, in b64decode
>     raise TypeError(msg)
> TypeError: Incorrect padding
> {code}



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

Mime
View raw message