Skip to content

Scheduler crash when API server returns 301 or redirection through proxy #49099

Closed as not planned

Description

@tirkarthi

Apache Airflow version

main (development)

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

No response

What happened?

get_json_error checks for status to be of the series 4xx or 5xx and if not returns None. In case of redirections like 301 through corporate proxy it returns 3xx status code. Thus get_json_error returns None and response.raise_for_status raises HTTPStatusError which is not pickleable and scheduler crashes similar to #47873

def raise_on_4xx_5xx_with_note(response: httpx.Response):
try:
return get_json_error(response) or response.raise_for_status()
except httpx.HTTPStatusError as e:
if TYPE_CHECKING:
assert hasattr(e, "add_note")
e.add_note(
f"Correlation-id={response.headers.get('correlation-id', None) or response.request.headers.get('correlation-id', 'no-correlation-id')}"
)
raise

What you think should happen instead?

No response

How to reproduce

  1. Run scheduler in a proxy environment where 3xx might be returned.
  2. Create a dagrun.
  3. Scheduler crashes with HTTPStatusError which is not pickleable

Operating System

Ubuntu 20.04

Versions of Apache Airflow Providers

No response

Deployment

Virtualenv installation

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
    affected_version:main_branch
    kind:bug
    priority:low
    on Apr 11, 2025
  2. tirkarthi commented on Apr 11, 2025

    @tirkarthi
    ContributorAuthor

    I marked it as low priority since 3xx is not expected but thought to file an issue since I came across this while running scheduler in my work laptop by mistake under a proxy that tried to resolve the localhost to some other value. This can be closed if invalid.

    cc: @kaxil

  3. vatsrahul1001 commented on Aug 28, 2025

    @vatsrahul1001
    Contributor

    @tirkarthi is this still happening on main?

  4. github-actions commented on Aug 29, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.

  5. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    This issue has been closed because it has not received response from the issue author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stale Bug Reportaffected_version:3.0affected_version:main_brancharea:corearea:schedulerkind:bugpriority:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions