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

Matthew Thorley updated AIRFLOW-2710:
-------------------------------------
    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.

 

 

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

It say

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.

 

 


> Configuration documentation is misleading to the uninitiated
> ------------------------------------------------------------
>
>                 Key: AIRFLOW-2710
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2710
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: Documentation
>            Reporter: Matthew Thorley
>            Priority: Major
>
> 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.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to