[bitnami/airflow] Airflow container errors out if AIRFLOW_FERNET_KEY
or AIRFLOW_SECRET_KEY
start with a dash
#65197
Labels
airflow
solved
stale
15 days without activity
tech-issues
The user has a technical issue about an application
Name and Version
bitnami/airflow:latest (currently 2.9.0-debian-12-r1)
What architecture are you using?
amd64
What steps will reproduce the bug?
Run
docker run -e 'AIRFLOW_SECRET_KEY=--PjzohgYFtiYCQjlyDNdeQdAIhXWgIAsE7Z-cMt7mg=' bitnami/airflow:2.7.3-debian-11-r2
What is the expected behavior?
The container should correctly populate the
secret_key
configuration key under the[webserver]
section in/opt/bitnami/airflow/airflow.cfg
with the value provided in theAIRFLOW_SECRET_KEY
environment variable.What do you see instead?
The container setup script throws the error
expected argument for flag '-v, --value', but got option '--PjzohgYFtiYCQjlyDNdeQdAIhXWgIAsE7Z-cMt7mg='
while creating the default configuration file.Additional information
This happens because the
airflow_conf_set
function in/opt/bitnami/scripts/libairflow.sh
passes the configuration value toini-file
as a separate argument.The issue can be fixed by changing the above-linked line to
ini-file set "--section=$section" "--key=$key" "--value=$value" -- "$file"
.This affects all configuration values that are written using
airflow_conf_set
, namely:AIRFLOW_HOSTNAME_CALLABLE
AIRFLOW_WEBSERVER_PORT_NUMBER
AIRFLOW_FERNET_KEY
AIRFLOW_SECRET_KEY
AIRFLOW_EXECUTOR
AIRFLOW_BASE_URL
Values starting with dashes are not valid for most of these anyway, but are valid for
AIRFLOW_FERNET_KEY
andAIRFLOW_SECRET_KEY
, and are indeed somewhat likely to occur since these are both URL-safe base64 encoded random byte sequences.The text was updated successfully, but these errors were encountered: