Skip to content
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

[bitnami/airflow] Airflow container errors out if AIRFLOW_FERNET_KEY or AIRFLOW_SECRET_KEY start with a dash #65197

Closed
zanecodes opened this issue Apr 16, 2024 · 2 comments · Fixed by #66535
Assignees
Labels
airflow solved stale 15 days without activity tech-issues The user has a technical issue about an application

Comments

@zanecodes
Copy link
Contributor

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 the AIRFLOW_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 to ini-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:

Values starting with dashes are not valid for most of these anyway, but are valid for AIRFLOW_FERNET_KEY and AIRFLOW_SECRET_KEY, and are indeed somewhat likely to occur since these are both URL-safe base64 encoded random byte sequences.

@zanecodes zanecodes added the tech-issues The user has a technical issue about an application label Apr 16, 2024
@github-actions github-actions bot added the triage Triage is needed label Apr 16, 2024
@javsalgar javsalgar changed the title Airflow container errors out if AIRFLOW_FERNET_KEY or AIRFLOW_SECRET_KEY start with a dash [bitnami/airflow] Airflow container errors out if AIRFLOW_FERNET_KEY or AIRFLOW_SECRET_KEY start with a dash Apr 18, 2024
@github-actions github-actions bot removed the triage Triage is needed label Apr 18, 2024
@github-actions github-actions bot assigned jotamartos and unassigned carrodher Apr 18, 2024
@jotamartos
Copy link
Contributor

jotamartos commented Apr 23, 2024

Hi @zanecodes,

Thank you for taking the time to create this ticket. If you have tried the change you proposed, would you like to contribute? You can follow our contributing guidelines and the whole community will benefit from your change.

Thanks

Copy link

github-actions bot commented May 9, 2024

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
airflow solved stale 15 days without activity tech-issues The user has a technical issue about an application
Projects
None yet
4 participants