Skip to content

Conversation

@dada-engineer
Copy link
Contributor

@dada-engineer dada-engineer commented Jul 29, 2025

related: #44337
closes: #54247

The log url generated assumed a trailing slash in the base_url config, all other places don't. I think it should be validated and updated to strip these away and append when needed in airflow.

@dada-engineer dada-engineer force-pushed the fix/strip-trailing-slash-off-base-url branch from 6656129 to 33398e3 Compare July 29, 2025 12:50
@dada-engineer
Copy link
Contributor Author

FYI I belive there is already a test with the base url specified with a trailing slash that loads the config so I did not add a separate one additionally.

@kaxil
Copy link
Member

kaxil commented Aug 13, 2025

@eladkal eladkal added this to the Airflow 3.0.7 milestone Aug 22, 2025
@eladkal eladkal added the type:bug-fix Changelog: Bug Fixes label Aug 22, 2025
@eladkal eladkal force-pushed the fix/strip-trailing-slash-off-base-url branch from 33398e3 to 97f9b53 Compare August 22, 2025 14:41
old_env_var = self._env_var_name("core", key)
os.environ.pop(old_env_var, None)

def _strip_trailing_slash_from_base_url(self):
Copy link
Member

Choose a reason for hiding this comment

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

Why do we want to strip it. Don't most places now need to ensure that it always exists? #54831 for example, and there were one or two more

Copy link
Contributor Author

@dada-engineer dada-engineer Aug 29, 2025

Choose a reason for hiding this comment

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

Yes, this is why I created this originally. So I checked several places and the only reference checking if it ends with / was in the api_server. So all the other places, like the property log_url of taskinstance model, just assume the base url is without a trailing slash. My reasoning then was ok lets just make this assumption hold true and not have this ugly if not base_url.endswith("/") check all over the places.

Edit: I am also fine with just closing this PR and using the other one, I just see this as source for error again.

self._update_env_var(section="api", name=key, new_value=new_base_url)
# if the old value is set via env var, we need to wipe it
# otherwise, it'll "win" over our adjusted value
old_env_var = self._env_var_name("core", key)
Copy link
Member

Choose a reason for hiding this comment

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

Why the core section? If the api section one is set that will always be used in preference to the core one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I didin't know this. Saw this code in another config modifying code and thought I need this. I'll remove this then 👍🏻

kaxil added a commit to astronomer/airflow that referenced this pull request Sep 15, 2025
The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
@kaxil kaxil closed this in #55699 Sep 15, 2025
kaxil added a commit that referenced this pull request Sep 15, 2025
The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes #54247
Closes #54248
Closes #53884

(cherry picked from commit 3e16382)
guttikondaV pushed a commit to guttikondaV/airflow that referenced this pull request Sep 15, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
kaxil added a commit that referenced this pull request Sep 15, 2025
The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes #54247
Closes #54248
Closes #53884

(cherry picked from commit 3e16382)
yash1thsa pushed a commit to yash1thsa/airflow that referenced this pull request Sep 16, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
suman-himanshu pushed a commit to suman-himanshu/airflow that referenced this pull request Sep 17, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Sep 30, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 1, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 2, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 3, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 4, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 5, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 7, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 8, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 9, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 10, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 11, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 12, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 14, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 15, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
…5699)

The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes apache#54247
Closes apache#54248
Closes apache#53884
@kaxil kaxil removed this from the Airflow 3.1.1 milestone Oct 21, 2025
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Oct 24, 2025
The `RuntimeTaskInstance.log_url` property
incorrectly concatenated base_url with the path, causing malformed URLs
when base_url didn't end with a slash.

Fixes #54247
Closes apache/airflow#54248
Closes apache/airflow#53884

(cherry picked from commit 3e1638250fb8f58a399ad8c5946dbb77a079f63d)

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

Labels

type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

context["ti"].log_url returns unuseable value

4 participants