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

Configuration documentation is misleading to the uninitiated

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.10.0
    • Component/s: documentation
    • Labels:
      None

      Description

      The documentation on this page on the configuration page https://airflow.apache.org/configuration.html is slightly misleading 

      It reads

      2. Generate fernet_key, using this code snippet below. fernet_key must be a base64-encoded 32-byte key.

      from cryptography.fernet import Fernet fernet_key= Fernet.generate_key() print(fernet_key) # your fernet_key, keep it in secured place!

      3. Replace airflow.cfg fernet_key value with the one from step 2.

      The value returned in step one is something like  b'K_8Yv52REP1qsa7OPupKYJe_CzngMI_KqwfM-2qAyVs='

      which lead me to believe the config was suppose to be

      fernet_key = b'K_8Yv52REP1qsa7OPupKYJe_CzngMI_KqwfM-2qAyVs='

      When in fact it should be 

      fernet_key = K_8Yv52REP1qsa7OPupKYJe_CzngMI_KqwfM-2qAyVs=

      I assumed the config parse needed to know it was a byte string and would handle the value correctly. After wasting 30mins I was able to figure out the solution, and probably could have arrived at it sooner had I been more familiar with python.

      But I recommend changing the docs as below to avoid confusion for other new users.

       
      from cryptography.fernet import Fernet fernet_key= Fernet.generate_key() print(fernet_key.decode()) # your fernet_key, keep it in secured place!
       

       

      I'll submit a pr for this shortly.

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mthorley Matthew Thorley
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: