Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Airflow 1.9 install on debian 8 from GitHub

Tags:

airflow

I installed Apache airflow 1.9 from GitHub thanks to this command line on debian 9: pip install git+https://github.com/apache/incubator-airflow.git@v1-9-stable

However, I have an error during the airflow initdb caused by Fernet, do you know how to solve this issue?

   INFO  [alembic.runtime.migration] Running upgrade 947454bf1dff -> d2ae31099d61, Increase text size for MySQL (not relevant for other DBs' text types)
    [2017-12-27 17:19:24,586] {models.py:643} ERROR - Failed to load fernet while encrypting value, using non-encrypted value.
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/airflow/models.py", line 639, in set_extra
        fernet = get_fernet()
      File "/usr/local/lib/python2.7/dist-packages/airflow/models.py", line 103, in get_fernet
        raise AirflowException('Failed to import Fernet, it may not be installed')
    AirflowException: Failed to import Fernet, it may not be installed
    [2017-12-27 17:19:24,601] {models.py:643} ERROR - Failed to load fernet 

And how can I specify extrapackage like in pip install apache-airflow[gcp-api] from my previous pip command install with GitHub?

How to install the latest 1.9.0RC too? I have an assertionError.

like image 840
benji2092 Avatar asked Jun 26 '26 09:06

benji2092


2 Answers

The answer marked as good have a broken link, if you have landed here as me and it continues broken, these steps have worked for me:

  • pip install cryptography
  • python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
  • Add the generated key to the config file airflow.cfg, fernet_key = YOUR_GENERATED_KEY
like image 172
skozz Avatar answered Jun 30 '26 01:06

skozz


During install from source you have to replace fernet_key in airflow.cfg such as you can find in the docs here.

like image 36
benji2092 Avatar answered Jun 30 '26 02:06

benji2092