Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-2931

Make Quick Start work when user doesn't have `cryptography` installed

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.0
    • Fix Version/s: 1.10.0
    • Component/s: None
    • Labels:
      None

      Description

      Following the Quick Start guide I ran into the following error when running airflow initdb:

      [2018-08-21 21:31:38,602] {__init__.py:45} INFO - Using executor SequentialExecutor DB: sqlite:////Users/mitch/projects/airflow/airflow.db [2018-08-21 21:31:38,716] {db.py:312} INFO - Creating tables INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. [2018-08-21 21:31:38,792] {models.py:643} ERROR - Failed to load fernet while encrypting value, using non-encrypted value. Traceback (most recent call last): File "/Users/mitch/.pyenv/versions/3.6.6/lib/python3.6/site-packages/airflow/models.py", line 105, in get_fernet return Fernet(configuration.get('core', 'FERNET_KEY').encode('utf-8')) File "/Users/mitch/.pyenv/versions/3.6.6/lib/python3.6/site-packages/cryptography/fernet.py", line 34, in __init__ key = base64.urlsafe_b64decode(key) File "/Users/mitch/.pyenv/versions/3.6.6/lib/python3.6/base64.py", line 133, in urlsafe_b64decode return b64decode(s) File "/Users/mitch/.pyenv/versions/3.6.6/lib/python3.6/base64.py", line 87, in b64decode return binascii.a2b_base64(s) binascii.Error: Incorrect padding

       My airflow.cfg file contained

      # Secret key to save connection passwords in the db fernet_key = cryptography_not_found_storing_passwords_in_plain_text

      Kevin Campbell Helped me on gitter and directed me to this link which resolved my issue.

      It seems that the quick start instructions should be updated to include this fernet key generation information or perhaps there is a way to ensure that cryptography is installed when apache-airflow is installed and automatically generate a key.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mitchlloyd Mitchell Lloyd
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: