Repository navigation
Fix airflowctl showing a traceback instead of the server error on 5xx - #70841
Merged
henry3260 merged 2 commits intoAug 1, 2026
Merged
Conversation
httpx runs response event hooks before it reads the response body, so any hook that parses the body has to read it first. The 5xx path did not, so a JSON server error surfaced as a raw ResponseNotRead traceback rather than the message the API server sent. That exception is also not an HTTPStatusError, so the retry layer never classified it as retryable and 5xx responses were never retried.
rjgoyln
marked this pull request as ready for review
August 1, 2026 12:38
rjgoyln
requested review from
bugraoz93,
dheerajturaga,
henry3260 and
potiuk
as code owners
August 1, 2026 12:38
The lower bound of the 4xx check was already guaranteed by the early return above it, and both branches built the same exception differing only in the word Client or Server.
henry3260
approved these changes
Aug 1, 2026
Contributor
Backport successfully created: airflow-ctl/v0-1-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
henry3260
pushed a commit
that referenced
this pull request
Aug 2, 2026
… the server error on 5xx (#70841) (#70910) (cherry picked from commit eef1b97) Co-authored-by: rjgoyln <[email protected]>
shahar1
pushed a commit
that referenced
this pull request
Nov 19, 2026
… the server error on 5xx (#70841) (#70910) (cherry picked from commit eef1b97) Co-authored-by: rjgoyln <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ServerResponseError.from_response()parsed JSON from5xxresponses before reading the body, causinghttpx.ResponseNotReadin response hooks.This prevented the intended
ServerResponseErrorfrom being raised and broke retries for server errors.Changes
4xx/5xxresponses.5xxJSON errors consistently with4xx.5xxerror parsing and retry behavior.Notes
The JSON
5xxpath previously had no test coverage because existing tests usedtext=responses. The new tests fail onmainwithhttpx.ResponseNotRead.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5)
{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.