Skip to content

Conversation

@kaxil
Copy link
Member

@kaxil kaxil commented Apr 24, 2025

The execution API server URL is now more flexible and configurable:

  • Remove hardcoded default URL "http://localhost:8080/execution/"
  • Add fallback mechanism to construct URL from base_url config
  • Default is now "{BASE_URL}/execution/" where BASE_URL comes from api.base_url config

Note: The code duplication here is intentional since I am touching different providers: Celery, Edge. So, keeping the logic in a central location has a big disadvantage, as that provider won't work until that Airflow version is released!

related: #49725


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@kaxil kaxil added this to the Airflow 3.0.1 milestone Apr 24, 2025
@boring-cyborg boring-cyborg bot added area:Executors-core LocalExecutor & SequentialExecutor area:providers area:task-sdk provider:celery provider:edge Edge Executor / Worker (AIP-69) / edge3 labels Apr 24, 2025
The execution API server URL is now more flexible and configurable:

- Remove hardcoded default URL "http://localhost:8080/execution/"
- Add fallback mechanism to construct URL from base_url config
- Default is now `"{BASE_URL}/execution/"` where BASE_URL comes from `api.base_url` config
@kaxil kaxil force-pushed the handle-exec-api branch from 5fb3cfe to 92b0f3d Compare April 24, 2025 19:10
Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kaxil kaxil merged commit ae7b3c6 into apache:main Apr 24, 2025
66 of 67 checks passed
@kaxil kaxil deleted the handle-exec-api branch April 24, 2025 20:11
kaxil added a commit that referenced this pull request Apr 24, 2025
The execution API server URL is now more flexible and configurable:

- Remove hardcoded default URL "http://localhost:8080/execution/"
- Add fallback mechanism to construct URL from base_url config
- Default is now `"{BASE_URL}/execution/"` where BASE_URL comes from `api.base_url` config

(cherry picked from commit ae7b3c6)
prabhusneha pushed a commit to astronomer/airflow that referenced this pull request Apr 25, 2025
…#49747)

The execution API server URL is now more flexible and configurable:

- Remove hardcoded default URL "http://localhost:8080/execution/"
- Add fallback mechanism to construct URL from base_url config
- Default is now `"{BASE_URL}/execution/"` where BASE_URL comes from `api.base_url` config
kaxil added a commit to astronomer/airflow that referenced this pull request Apr 25, 2025
Follow-up of apache#49747 which broke some workflows including `breeze start-airflow`, requiring apache#49753.

When base_url is a relative path (starts with '/'), default to using
http://localhost:8080 as the base URL. This maintains backward compatibility
with the previous default behavior while still allowing custom absolute URLs
through either `base_url` or `execution_api_server_url` configuration.

Fixes `httpx.UnsupportedProtocol` error (as seen in apache#49753) that occurred when base_url was
a relative path without protocol.
kaxil added a commit to astronomer/airflow that referenced this pull request Apr 25, 2025
Follow-up of apache#49747 which broke some workflows including `breeze start-airflow`, requiring apache#49753.

When base_url is a relative path (starts with '/'), default to using
http://localhost:8080 as the base URL. This maintains backward compatibility
with the previous default behavior while still allowing custom absolute URLs
through either `base_url` or `execution_api_server_url` configuration.

Fixes `httpx.UnsupportedProtocol` error (as seen in apache#49753) that occurred when base_url was
a relative path without protocol.
kaxil added a commit to astronomer/airflow that referenced this pull request Apr 25, 2025
Follow-up of apache#49747 which broke some workflows including `breeze start-airflow`, requiring apache#49753.

When base_url is a relative path (starts with '/'), default to using
http://localhost:8080 as the base URL. This maintains backward compatibility
with the previous default behavior while still allowing custom absolute URLs
through either `base_url` or `execution_api_server_url` configuration.

Fixes `httpx.UnsupportedProtocol` error (as seen in apache#49753) that occurred when base_url was
a relative path without protocol.
kaxil added a commit to astronomer/airflow that referenced this pull request Apr 25, 2025
Follow-up of apache#49747 which broke some workflows including `breeze start-airflow`, requiring apache#49753.

When base_url is a relative path (starts with '/'), default to using
http://localhost:8080 as the base URL. This maintains backward compatibility
with the previous default behavior while still allowing custom absolute URLs
through either `base_url` or `execution_api_server_url` configuration.

Fixes `httpx.UnsupportedProtocol` error (as seen in apache#49753) that occurred when base_url was
a relative path without protocol.
kaxil added a commit that referenced this pull request Apr 25, 2025
Follow-up of #49747 which broke some workflows including `breeze start-airflow`, requiring #49753.

When base_url is a relative path (starts with '/'), default to using
http://localhost:8080 as the base URL. This maintains backward compatibility
with the previous default behavior while still allowing custom absolute URLs
through either `base_url` or `execution_api_server_url` configuration.

Fixes `httpx.UnsupportedProtocol` error (as seen in #49753) that occurred when base_url was
a relative path without protocol.
kaxil added a commit that referenced this pull request Apr 25, 2025
Follow-up of #49747 which broke some workflows including `breeze start-airflow`, requiring #49753.

When base_url is a relative path (starts with '/'), default to using
http://localhost:8080 as the base URL. This maintains backward compatibility
with the previous default behavior while still allowing custom absolute URLs
through either `base_url` or `execution_api_server_url` configuration.

Fixes `httpx.UnsupportedProtocol` error (as seen in #49753) that occurred when base_url was
a relative path without protocol.

(cherry picked from commit 3b9ae48)
jroachgolf84 pushed a commit to jroachgolf84/airflow that referenced this pull request Apr 30, 2025
…#49747)

The execution API server URL is now more flexible and configurable:

- Remove hardcoded default URL "http://localhost:8080/execution/"
- Add fallback mechanism to construct URL from base_url config
- Default is now `"{BASE_URL}/execution/"` where BASE_URL comes from `api.base_url` config
jroachgolf84 pushed a commit to jroachgolf84/airflow that referenced this pull request Apr 30, 2025
Follow-up of apache#49747 which broke some workflows including `breeze start-airflow`, requiring apache#49753.

When base_url is a relative path (starts with '/'), default to using
http://localhost:8080 as the base URL. This maintains backward compatibility
with the previous default behavior while still allowing custom absolute URLs
through either `base_url` or `execution_api_server_url` configuration.

Fixes `httpx.UnsupportedProtocol` error (as seen in apache#49753) that occurred when base_url was
a relative path without protocol.
@zachliu
Copy link
Contributor

zachliu commented May 12, 2025

as that provider won't work until that Airflow version is released!

should we expect new releases of the providers in a few days? for example the latest apache-airflow-providers-celery==3.10.6 doesn't have the fix yet

@potiuk
Copy link
Member

potiuk commented May 12, 2025

Yes new provider wave is coming - but if you want you can easily (now) build provider on your own from main and test it - or even install it via github URL:

pip install "apache-airflow-providers-celery @ git+https://github.com/apache/airflow/#subdirectory=providers/celery"

@zachliu
Copy link
Contributor

zachliu commented May 13, 2025

Yes new provider wave is coming - but if you want you can easily (now) build provider on your own from main and test it - or even install it via github URL:

pip install "apache-airflow-providers-celery @ git+https://github.com/apache/airflow/#subdirectory=providers/celery"

This journey from Airflow 2 to 3 has made me reluctant to be the first to "eat the crab" again. And I hate being proven right once more… after building and installing the latest Celery provider from main, I'm still getting bombarded with ConnectError: [Errno 111] Connection refused if I don't set the AIRFLOW__CORE__EXECUTION_API_SERVER_URL environment variable somewhere.

@potiuk
Copy link
Member

potiuk commented May 13, 2025

This journey from Airflow 2 to 3 has made me reluctant to be the first to "eat the crab" again. And I hate being proven right once more… after building and installing the latest Celery provider from main, I'm still getting bombarded with ConnectError: [Errno 111] Connection refused if I don't set the AIRFLOW__CORE__EXECUTION_API_SERVER_URL environment variable somewhere.

However, we greatly appreciate your efforts @zachliu -> yes, there are teething issues, and being an open-source project, it's almost a given that the first brave users who will start testing and using Airflow 3 will find things that we have not thoguht about and that's the only way we can actually get to know about those issues and fix them. There is no software without bugs, and no amount of "lab" tesitng is able to find all those - especially if you give your software for free and there is noone who will pay for that extra testing. So effectively this is the price you pay for using sotware that cost you 0 USD. And we consider it a great contribution from people like you who are brave enough and supportive enough and understand that there might be issues - what we offer instead is a close cooperation, trying to find mitigations and offer ways to try and tests main versions and RC candidates as soon as we have them.

I think - to be honest - it was great getting your initial feedback and issue reports and we will continue to diagnose and fix issues as they come. I think the power of Airlfow come from the power of the community that is both helpful and understands that there are some initial teething pains - and goes through those pains together with us.

@zachliu
Copy link
Contributor

zachliu commented May 13, 2025

@potiuk Thank you for the encouragement, Professor—I was just venting. I’ll probably never stop being the first to eat the crab 😂

As for the matter at hand, the issue seems to stem from a subtle difference between localhost and <hostname>. When specifying the execution API URL, it likes the <hostname>—such as the service name apiserver or webserver—like so:
http://webserver:<port>/execution. Should be fine in a production environment but not for local runs when my base_url = http://localhost:<port>/

kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 25, 2025
Follow-up of apache/airflow#49747 which broke some workflows including `breeze start-airflow`, requiring apache/airflow#49753.

When base_url is a relative path (starts with '/'), default to using
http://localhost:8080 as the base URL. This maintains backward compatibility
with the previous default behavior while still allowing custom absolute URLs
through either `base_url` or `execution_api_server_url` configuration.

Fixes `httpx.UnsupportedProtocol` error (as seen in apache/airflow#49753) that occurred when base_url was
a relative path without protocol.

(cherry picked from commit 3b9ae489a56cde7fe1cd663d7da88fabb831c664)

GitOrigin-RevId: 3eeb2533a425dd25ffeebd5e71306f048a12f38c
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Oct 22, 2025
Follow-up of apache/airflow#49747 which broke some workflows including `breeze start-airflow`, requiring apache/airflow#49753.

When base_url is a relative path (starts with '/'), default to using
http://localhost:8080 as the base URL. This maintains backward compatibility
with the previous default behavior while still allowing custom absolute URLs
through either `base_url` or `execution_api_server_url` configuration.

Fixes `httpx.UnsupportedProtocol` error (as seen in apache/airflow#49753) that occurred when base_url was
a relative path without protocol.

GitOrigin-RevId: 3b9ae489a56cde7fe1cd663d7da88fabb831c664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Executors-core LocalExecutor & SequentialExecutor area:providers area:task-sdk provider:celery provider:edge Edge Executor / Worker (AIP-69) / edge3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants