Skip to content

Fix DeprecationWarning: The secret_key option in [webserver] has been moved to the secret_key option in [api] #1991

@infused-kim

Description

@infused-kim

Describe the bug

I am upgrading my deployment from airflow 2 to airflow 3 and ran into the following warning:

astro@f86673788526:/usr/local/airflow$ airflow info
/usr/local/lib/python3.12/site-packages/airflow/configuration.py:877 DeprecationWarning: The secret_key option in [webserver] has been moved to the secret_key option in [api] - the old setting has been used, but please update your config.

It seemed like it was a configuration issue on my side, but then I found that astro cli sets this env variable in its docker-compose template:

x-common-env-vars: &common-env-vars
  # [...]
  AIRFLOW__WEBSERVER__SECRET_KEY: "{{ .ProjectName }}"
  AIRFLOW__WEBSERVER__RBAC: "True"
  AIRFLOW__WEBSERVER__EXPOSE_CONFIG: "True"
  ASTRONOMER_ENVIRONMENT: local

It seems the solution to this is to rename the variables with the AIRFLOW__API__ prefix for airflow 3.

What CLI Version did you experience this bug?

Astro CLI Version: 1.38.1

This CLI bug is related to which Astronomer Platform?

  • Astro
  • Software
  • None/Unknown

What Operating System is the above CLI installed on?

macOS 15.7.1 (24G231)

🪜 Steps To Reproduce

❯ astro dev  bash                                                                                                                                          at 17:34:46
Execing into the scheduler container

astro@f86673788526:/usr/local/airflow$ airflow info
/usr/local/lib/python3.12/site-packages/airflow/configuration.py:877 DeprecationWarning: The secret_key option in [webserver] has been moved to the secret_key option in [api] - the old setting has been used, but please update your config.
2025-12-17T23:34:53.648059Z [warning  ] Astro managed secrets backend is disabled [astronomer.runtime.plugin.AstronomerRuntimePlugin] loc=plugin.py:125

Apache Airflow
version                | 3.1.5+astro.1
executor               | LocalExecutor
task_logging_handler   | airflow.utils.log.file_task_handler.FileTaskHandler
sql_alchemy_conn       | postgresql://postgres:postgres@postgres:5432
dags_folder            | /usr/local/airflow/dags
plugins_folder         | /usr/local/airflow/plugins
base_log_folder        | /usr/local/airflow/logs
remote_base_log_folder |


System info
OS              | Linux
architecture    | arm
uname           | uname_result(system='Linux', node='f86673788526', release='6.10.14-linuxkit', version='#1 SMP Thu Mar 20 16:32:56 UTC 2025', machine='aarch64')
locale          | ('C', 'UTF-8')
python_version  | 3.12.12 (main, Dec  8 2025, 23:47:37) [GCC 12.2.0]
python_location | /usr/local/bin/python


Tools info
git             | git version 2.39.5
ssh             | OpenSSH_9.2p1 Debian-2+deb12u7, OpenSSL 3.0.17 1 Jul 2025
kubectl         | NOT AVAILABLE
gcloud          | NOT AVAILABLE
cloud_sql_proxy | NOT AVAILABLE
mysql           | NOT AVAILABLE
sqlite3         | NOT AVAILABLE
psql            | psql (PostgreSQL) 15.14 (Debian 15.14-0+deb12u1)


Paths info
airflow_home    | /usr/local/airflow
system_path     | /home/astro/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/astro/.local/bin
python_path     | /usr/local/bin:/usr/local/airflow:/usr/local/lib/python312.zip:/usr/local/lib/python3.12:/usr/local/lib/python3.12/lib-dynload:/usr/local/lib/python
                | 3.12/site-packages:/usr/local/airflow/config:/usr/local/airflow/plugins
airflow_on_path | True


Providers info
apache-airflow-providers-celery          | 3.14.0
apache-airflow-providers-common-compat   | 1.10.1
apache-airflow-providers-common-io       | 1.7.0
apache-airflow-providers-common-sql      | 1.30.0
apache-airflow-providers-discord         | 3.11.1
apache-airflow-providers-elasticsearch   | 6.4.0
apache-airflow-providers-http            | 5.6.1
apache-airflow-providers-microsoft-azure | 12.10.0
apache-airflow-providers-openlineage     | 2.9.0
apache-airflow-providers-smtp            | 2.4.0
apache-airflow-providers-standard        | 1.10.0
astronomer-providers-logging             | 1.6.4

astro@f86673788526:/usr/local/airflow$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions