Skip to content

Comments

Print debug mode warning to stderr to avoid polluting stdout JSON output#61302

Merged
dheerajturaga merged 1 commit intoapache:mainfrom
dheerajturaga:bugfix/debugmsg-in-stderr
Feb 2, 2026
Merged

Print debug mode warning to stderr to avoid polluting stdout JSON output#61302
dheerajturaga merged 1 commit intoapache:mainfrom
dheerajturaga:bugfix/debugmsg-in-stderr

Conversation

@dheerajturaga
Copy link
Member

The debug mode warning was previously printed to stdout, which broke piping of JSON responses to tools like jq. Moving it to stderr keeps stdout clean for machine-readable output.

  The debug mode warning was previously printed to stdout, which broke piping of JSON responses to tools like jq. Moving it to stderr keeps stdout
  clean for machine-readable output.
Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

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

Changes looks good but why do we need to make this error. This is purely created for integration tests and never ever should be used in any production. We should always use keyring in production. This could break integration tests because as this is warning to also users not an error

@dheerajturaga
Copy link
Member Author

dheerajturaga commented Feb 1, 2026

Changes looks good but why do we need to make this error. This is purely created for integration tests and never ever should be used in any production. We should always use keyring in production. This could break integration tests because as this is warning to also users not an error

@bugraoz93, we must allow airflowctl dags list | jq ...<args> style workflows for automation in custom scripting. Given we support json/yaml outputs, writing debug messages to stdout will break such usecases. Users maybe in a dev env when building such automations and could be using debug mode hence the need for this.

Also we aren't making this an error, we are just printing the output to stderr instead of stdout.

@bugraoz93 bugraoz93 added the full tests needed We need to run full set of tests for this PR to merge label Feb 1, 2026
@bugraoz93 bugraoz93 closed this Feb 1, 2026
@bugraoz93 bugraoz93 reopened this Feb 1, 2026
@bugraoz93
Copy link
Contributor

Changes looks good but why do we need to make this error. This is purely created for integration tests and never ever should be used in any production. We should always use keyring in production. This could break integration tests because as this is warning to also users not an error

@bugraoz93, we must allow airflowctl dags list | jq ...<args> style workflows for automation in custom scripting. Given we support json/yaml outputs, writing debug messages to stdout will break such usecases. Users maybe in a dev env when building such automations and could be using debug mode hence the need for this.

Also we aren't making this an error, we are just printing the output to stderr instead of stdout.

I understood that it prevents some actions. Where are those actions needed? In the case we don't use debug mode this won't be printed right? So other than integration tests, I see no further usage of insecurely saving token to a file 🤔

@bugraoz93
Copy link
Contributor

Thanks for explaining! I think as long as integration tests are not impacted and we haven't changed the warning should be good

@dheerajturaga dheerajturaga merged commit 74af16f into apache:main Feb 2, 2026
207 checks passed
@dheerajturaga dheerajturaga deleted the bugfix/debugmsg-in-stderr branch February 2, 2026 19:20
jason810496 pushed a commit to abhijeets25012-tech/airflow that referenced this pull request Feb 3, 2026
Alok-kumar-priyadarshi pushed a commit to Alok-kumar-priyadarshi/airflow that referenced this pull request Feb 5, 2026
jhgoebbert pushed a commit to jhgoebbert/airflow_Owen-CH-Leung that referenced this pull request Feb 8, 2026
Ratasa143 pushed a commit to Ratasa143/airflow that referenced this pull request Feb 15, 2026
choo121600 pushed a commit to choo121600/airflow that referenced this pull request Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:airflow-ctl full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants