Repository navigation
Keep airflowctl dags pause/unpause/drain output parseable - #76133
Merged
Merged
Conversation
The "Dag <operation> successful" and "Further Dag details:" status lines, and the error message on failure, were printed to stdout ahead of the --output data. That made `airflowctl dags pause <dag_id> -o json` produce output that is not valid JSON, so piping it to jq or json.loads failed. Status and error text belong on stderr, matching how the CLI already reports the ambiguous-write warning, so stdout carries only the requested output format.
Shawnsuun
requested review from
bugraoz93,
dheerajturaga,
henry3260 and
potiuk
as code owners
October 31, 2026 11:00
Contributor
Backport failed to create: airflow-ctl/v0-1-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 956d8cd airflow-ctl/v0-1-testThis should apply the commit to the airflow-ctl/v0-1-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
Merged
1 task done
shahar1
added a commit
that referenced
this pull request
Oct 31, 2026
…ut parseable (#76133) (#76172) The "Dag <operation> successful" and "Further Dag details:" status lines, and the error message on failure, were printed to stdout ahead of the --output data. That made `airflowctl dags pause <dag_id> -o json` produce output that is not valid JSON, so piping it to jq or json.loads failed. Status and error text belong on stderr, matching how the CLI already reports the ambiguous-write warning, so stdout carries only the requested output format. Backport note: this branch has no `dags drain`, so the drain cases of the new tests were dropped; the source change is identical to main. (cherry picked from commit 956d8cd) Co-authored-by: Shawn Sun <[email protected]>
1 task done
shahar1
pushed a commit
that referenced
this pull request
Nov 3, 2026
…76347) The API client logs "Server error" and the tenacity retry warning through structlog, which prints to stdout when nothing configures it. A single retried 5xx then puts two log lines in front of the `-o json` output, while the command still exits 0. The shared error handler also printed its messages to stdout. #76133 and #76134 moved the messages of a few commands to stderr, but these two paths are shared by every command.
shahar1
pushed a commit
that referenced
this pull request
Nov 3, 2026
…st is retried or fails (#76347) (#76380) The API client logs "Server error" and the tenacity retry warning through structlog, which prints to stdout when nothing configures it. A single retried 5xx then puts two log lines in front of the `-o json` output, while the command still exits 0. The shared error handler also printed its messages to stdout. #76133 and #76134 moved the messages of a few commands to stderr, but these two paths are shared by every command. (cherry picked from commit 6f7cb34) Co-authored-by: Andrew Chang <[email protected]>
shahar1
pushed a commit
to shahar1/airflow
that referenced
this pull request
Nov 4, 2026
…st is retried or fails (apache#76347) (apache#76380) The API client logs "Server error" and the tenacity retry warning through structlog, which prints to stdout when nothing configures it. A single retried 5xx then puts two log lines in front of the `-o json` output, while the command still exits 0. The shared error handler also printed its messages to stdout. apache#76133 and apache#76134 moved the messages of a few commands to stderr, but these two paths are shared by every command. (cherry picked from commit 6f7cb34) Co-authored-by: Andrew Chang <[email protected]>
shahar1
added a commit
that referenced
this pull request
Nov 19, 2026
…ut parseable (#76133) (#76172) The "Dag <operation> successful" and "Further Dag details:" status lines, and the error message on failure, were printed to stdout ahead of the --output data. That made `airflowctl dags pause <dag_id> -o json` produce output that is not valid JSON, so piping it to jq or json.loads failed. Status and error text belong on stderr, matching how the CLI already reports the ambiguous-write warning, so stdout carries only the requested output format. Backport note: this branch has no `dags drain`, so the drain cases of the new tests were dropped; the source change is identical to main. (cherry picked from commit 956d8cd) Co-authored-by: Shawn Sun <[email protected]>
28 of 67 tasks
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.
airflowctl dags pause|unpause|drainprintedDag <operation> successful <dag_id>andFurther Dag details:to stdout before the--outputdata, soairflowctl dags pause my_dag -o json | jq .failed: stdout was not valid JSON. The errormessage on failure (
Error while trying to <operation> Dag ...) also went to stdout.These status and error lines now go to stderr, the same way airflowctl already reports the
"request may already have been applied" warning. Stdout carries only the requested output
format. In a terminal, the visible output does not change. The status lines still show for
every output format, but on stderr.
Tests: parametrized over pause/unpause/drain, they check that
-o jsonstdout parses as JSONwhile the status lines are on stderr, and that the failure message is on stderr and not on
stdout. The airflow-ctl-tests integration runner merges stderr into stdout, so the
dags pause/unpause/drain example_bash_operatorintegration commands are unaffected.Note: on an API error, the client's generic
Server errorwarning is still logged through thedefault structlog configuration, which writes to stdout. That affects every command, not just
these three, and is left for a separate change.
related: #66139
Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot (Claude Opus 5.5) following the guidelines
{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.