when i use the web ui admin/avariables set a key and value ,but i cannot get the values in my code ,anybody has this problem,thanks.
Hi,
Just had this issue in our environment. This cause because of using different Fernet key on ui/scheduler/workers, so workers couldn't decrypt the variables.
Pass same fernet key to all docker containers as env var (see last paragraph under usage)
I'm facing the same issue when I use https://github.com/BrechtDeVlieger/airflow-kube-helm helm chart.
Need help here
@sunilkamat2018
Make sure you pass same FERNET key to all the services:
For encrypted connection passwords (in Local or Celery Executor), you must have the same fernet_key. By default docker-airflow generates the fernet_key at startup, you have to set an environment variable in the docker-compose (ie: docker-compose-LocalExecutor.yml) file to set the same key accross containers. To generate a fernet_key :
docker run puckel/docker-airflow python -c "from cryptography.fernet import Fernet; FERNET_KEY = Fernet.generate_key().decode(); print(FERNET_KEY)"
I've done this with SequentialExecutor but I am still getting the error.
steps i ran:
docker build --rm -t puckel/docker-airflow .docker run puckel/docker-airflow python -c "from cryptography.fernet import Fernet; FERNET_KEY = Fernet.generate_key().decode(); print(FERNET_KEY)"docker run -d -p 8080:8080 puckel/docker-airflow webserverairflow variables -e var.json// Fix
docker build --rm -t puckel/docker-airflow .docker run puckel/docker-airflow python -c "from cryptography.fernet import Fernet; FERNET_KEY = Fernet.generate_key().decode(); print(FERNET_KEY)"docker run -d -p 8080:8080 -e FERNET_KEY="FERNET_KEY" puckel/docker-airflow webserverGenerated FERNET_KEY must be passed as environment variable, as you did in the fix (and as written in documentation) 馃槂
Most helpful comment
Generated FERNET_KEY must be passed as environment variable, as you did in the fix (and as written in documentation) 馃槂