Skip to content

fix(providers/alibaba): pass relative path to oss_write in OSSRemoteLogIO.upload - #63246

Merged
eladkal merged 1 commit into
apache:mainfrom
YoannAbriel:fix/issue-63242
Mar 24, 2026
Merged

fix(providers/alibaba): pass relative path to oss_write in OSSRemoteLogIO.upload#63246
eladkal merged 1 commit into
apache:mainfrom
YoannAbriel:fix/issue-63242

Conversation

@YoannAbriel

Copy link
Copy Markdown
Contributor

Problem

OSSRemoteLogIO.upload() passes a full OSS URI to oss_write(), which internally prepends base_folder again. This produces malformed keys like prefix/logs/oss://bucket/prefix/logs/dag_id=.../attempt=1.log, making logs unreadable from the Airflow UI.

Root Cause

upload() joins self.remote_base (the full oss://bucket/prefix URI) with the relative path, then passes the result to oss_write(). But oss_write() already prepends self.base_folder (extracted from remote_base), so the prefix gets doubled.

Fix

Pass only the relative path (relative to base_log_folder) to oss_write() instead of the full OSS URI. Added a test to verify both absolute and relative input paths produce the correct relative argument to oss_write().

Closes: #63242


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code

Generated-by: Claude Code following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@potiuk

potiuk commented Mar 10, 2026

Copy link
Copy Markdown
Member

Have you actually tested it with the actual service?

@YoannAbriel

Copy link
Copy Markdown
Contributor Author

No — unit tests only, no access to the Alibaba Cloud OSS service for integration testing. Happy to close this if someone with actual access can verify and take it over.

@potiuk

potiuk commented Mar 10, 2026

Copy link
Copy Markdown
Member

Maybve you can look at history of changes and ping someone who can verify it ?

@YoannAbriel

Copy link
Copy Markdown
Contributor Author

Checked git history — @Tushar4432 has contributed to the Alibaba provider. Could you verify this fix against a live OSS environment?

@potiuk

potiuk commented Mar 11, 2026

Copy link
Copy Markdown
Member

Yeah. Would be good to verify @Tushar4432

@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Mar 12, 2026
@YoannAbriel
YoannAbriel force-pushed the fix/issue-63242 branch 4 times, most recently from 7396eda to 5116066 Compare March 14, 2026 13:07
@eladkal

eladkal commented Mar 15, 2026

Copy link
Copy Markdown
Contributor

@alifaz31 as the issue reporter - can you check the fix and confirm if it's resolve the problem?

@YoannAbriel
YoannAbriel force-pushed the fix/issue-63242 branch 2 times, most recently from ea63c29 to 63d5311 Compare March 23, 2026 13:09
…ogIO.upload

upload() was passing the full OSS URI (built with remote_base prefix) to
oss_write(), which prepends base_folder internally, producing a doubled
path like oss://bucket/prefix/oss://bucket/prefix/dag_id=.../attempt=1.log.

Pass only the relative path so oss_write() constructs the correct key.

Closes: apache#63242
@eladkal
eladkal merged commit 821a4ad into apache:main Mar 24, 2026
90 checks passed
@YoannAbriel
YoannAbriel deleted the fix/issue-63242 branch March 24, 2026 07:05
vatsrahul1001 pushed a commit that referenced this pull request Mar 25, 2026
…ogIO.upload (#63246)

upload() was passing the full OSS URI (built with remote_base prefix) to
oss_write(), which prepends base_folder internally, producing a doubled
path like oss://bucket/prefix/oss://bucket/prefix/dag_id=.../attempt=1.log.

Pass only the relative path so oss_write() constructs the correct key.

Closes: #63242
aaron-y-chen pushed a commit to aaron-y-chen/airflow that referenced this pull request Mar 30, 2026
…ogIO.upload (apache#63246)

upload() was passing the full OSS URI (built with remote_base prefix) to
oss_write(), which prepends base_folder internally, producing a doubled
path like oss://bucket/prefix/oss://bucket/prefix/dag_id=.../attempt=1.log.

Pass only the relative path so oss_write() constructs the correct key.

Closes: apache#63242
Suraj-kumar00 pushed a commit to Suraj-kumar00/airflow that referenced this pull request Apr 7, 2026
…ogIO.upload (apache#63246)

upload() was passing the full OSS URI (built with remote_base prefix) to
oss_write(), which prepends base_folder internally, producing a doubled
path like oss://bucket/prefix/oss://bucket/prefix/dag_id=.../attempt=1.log.

Pass only the relative path so oss_write() constructs the correct key.

Closes: apache#63242
abhijeets25012-tech pushed a commit to abhijeets25012-tech/airflow that referenced this pull request Apr 9, 2026
…ogIO.upload (apache#63246)

upload() was passing the full OSS URI (built with remote_base prefix) to
oss_write(), which prepends base_folder internally, producing a doubled
path like oss://bucket/prefix/oss://bucket/prefix/dag_id=.../attempt=1.log.

Pass only the relative path so oss_write() constructs the correct key.

Closes: apache#63242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] OSSRemoteLogIO.upload() passes full OSS URI to oss_write() causing malformed log paths (apache-airflow-providers-alibaba 3.3.2+)

3 participants