Skip to content

LocalExecutor url resolution makes bad decisions regarding defaults #53033

Closed

Description

@kcphila

Apache Airflow version

3.0.2

If "Other Airflow 2 version" selected, which one?

No response

What happened?

I'm testing a migration from Airflow 2.10.2 to 3.0.2 in a custom Dockerized environment using LocalExecutor. In this process, I generated a barebones airflow.cfg for 3.0.2 and added in customizations from there.

The scheduler was crashing on every execution, and after logging into the container and hacking around in code, I have identified why. I ended up setting an empty base_url, e.g. this line in the airflow.cfg:

[api]
base_url =

The following code is in local_executor.py:

from airflow.configuration import conf
...
base_url = conf.get("api", "base_url", fallback="/")
# If it's a relative URL, use localhost:8080 as the default
if base_url.startswith("/"):
    base_url = f"http://localhost:8080{base_url}"
default_execution_api_server = f"{base_url.rstrip('/')}/execution/"

HOWEVER, conf.get resolves base_url = in airflow.cfg to emptystring, and so at the end of this block, base_url == '' and not http://localhost:8080/, and default_execution_api_server == "/execution/"

What you think should happen instead?

I would generally think that an empty config value should be equivalent to a non-existent key, but maybe this there is some reason why conf.get works this way?

Regardless, it seems that if the LocalExecutor's execution_api_server_url ends up resolving to '/execution/' and sends that to airflow.sdk.execution_time.supervisor.supervise, it will always lead to a failure in the generation of a well formed URL, and this should throw a useful, readable error (thrown from either supervisor.py or local_executor.py)

How to reproduce

Set up a dockerized Airflow 3.0.2 runtime with LocalExecutor and set base_url = in airflow.cfg

Operating System

Linux / Docker image built from apache/airflow:3.0.2-python3.11

Versions of Apache Airflow Providers

No response

Deployment

Docker-Compose

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Jul 8, 2025
  2. added
    area:Executors-core
    on Jul 8, 2025
  3. amoghrajesh commented on Jul 9, 2025

    @amoghrajesh
    Contributor

    Thanks for reporting this! Let me look into it.

  4. self-assigned this
    on Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:Executors-corearea:corekind:bugneeds-triage

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions