-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fernet InvalidToken #18127
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
In case you do not set the fernet key, Airflow will generate a new key, which means that if you restart the container, you may lose access to the key. You should explicitly define the key in docker-compose.yaml. You can also set an empty string to disable encryption.
|
In my entrypoint.sh file i have this line of code to generate the fernet key
Are you saying that i should not generate it in the entrypoint.sh but instead just provide it in the docker-compose file?? This worked like this in 1.10.8. We're upgrading to 2.1.3. |
I don't understand why it worked in Airflow 1.10, but generating a new key every time the container is started will definitely not allow the data to be decrypted. You must use the same key for encryption and decryption. You may not have had Fernet at all in Airflow 1.10 as it requires the installation of the crypto package. In Airflow 2.0, the fernet is turned on by default and you can turn it off if you want. |
I actually have the crypto package installed in my airflow 1.10.8 docker container. here is the pip freeze:
|
Apache Airflow version
2.1.3 (latest released)
Operating System
Linux
Versions of Apache Airflow Providers
apache-airflow-providers-apache-hive==2.0.2
apache-airflow-providers-ftp==2.0.0
apache-airflow-providers-http==2.0.0
apache-airflow-providers-imap==2.0.0
apache-airflow-providers-jdbc==2.0.0
apache-airflow-providers-postgres==2.0.0
apache-airflow-providers-slack==4.0.0
apache-airflow-providers-snowflake==2.1.0
apache-airflow-providers-sqlite==2.0.0
apache-airflow-providers-ssh==2.1.0
Deployment
Docker-Compose
Deployment details
version: "2.1"
services:
postgres:
image: postgres:13.4
container_name: "airflow_postgres_qa"
environment:
- POSTGRES_HOST=postgres
- POSTGRES_PORT:5432
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
webserver:
image: airflow_docker
container_name: "airflow_webserver_qa"
entrypoint: "/entrypoint.sh"
command: "webserver"
restart: always
depends_on:
- postgres
ports:
- "9003:9003"
# - "2222:2222"
# - "8080:80"
environment:
EXECUTOR: "Local"
AIRFLOW__WEBSERVER__BASE_URL: "http://localhost:9003"
volumes:
- ../../keys:/usr/local/airflow/keys
- ../pipes:/usr/local/airflow/configs/snowpipe
- ../../support_files:/usr/local/airflow/support_files
- ../../dags:/usr/local/airflow/dags
- ../../sql:/usr/local/airflow/sql
- ../access_control.json:/usr/local/airflow/configs/access_control/access_control.json
healthcheck:
test: ["CMD-SHELL", "[ -f /usr/local/airflow/airflow-webserver.pid ]"]
interval: 30s
timeout: 30s
retries: 3
What happened
Adding or deleting connections using CLI in entrypoint.sh file throws error:
What you expected to happen
Expected the connections to be deleted and readded again.
How to reproduce
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: