Airflow Exception: "raise InvalidToken cryptography.fernet.InvalidToken"
Author: Omid Vahdaty 5.4.2021
If you get this error of invalid token, it is because Airflow is using Fernet. Airflow encrypt all the passwords for its connections in the backend database.
Somehow Airflow backend is using previous fernet key and you have generated a key which you have created in a new connection.
My recommendation is to do the following first:
This will help in deleting all the existing records in your backend db. NOTICE – this will delete all your Airflow connections and variables you inputted manually:
This will initialize backend db like a fresh install db. Airflow may shout about missing variables.
Start Airflow and enter missing variables one by one.
Then start airflow web server and scheduler.
I put a lot of thoughts into these blogs, so I could share the information in a clear and useful way.
If you have any comments, thoughts, questions, or you need someone to consult with,
feel free to contact me via LinkedIn: