Uh oh!
There was an error while loading. Please reload this page.
fix: EksPodOperator 401 with cross-account AssumeRole via aws_conn_id - #65335
Conversation
anmolxlight
commented
Apr 15, 2026
The "CI image checks / Static checks" failure is a pre-existing CI infrastructure issue unrelated to these changes — the workflow cannot extract uv/prek versions from uv.lock (those packages aren't declared in the lockfile at expected versions). All other jobs (MyPy, unit tests, build checks) passed. Please re-run or advise on next steps. |
vincbeck
commented
Apr 16, 2026
Static checks failure is very much related to this change |
ferruzzi
left a comment
There was a problem hiding this comment.
Nice catch. I'm not sure the fix is entirely right though, I've left a couple comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ferruzzi
left a comment
There was a problem hiding this comment.
My concerns were addressed. Thanks for fixing this!
Fixesapache#64657 - Redirect stderr to /dev/null instead of merging with stdout (2>&1) to prevent Python warnings/log output from contaminating stdout during bash token parsing. The token output must be the only thing on stdout. - Add token validation: exit with error if token extraction fails, rather than sending a malformed ExecCredential with empty token to the API server (which caused 401 with empty user identity in audit logs). - Remove EKS bearer token from error output printed to stderr when token validation fails (prevents token leakage into task logs). - Keep $output in non-zero exit diagnostics for troubleshooting. Co-Authored-By: Copilot <copilot@github.com>
6a31015 to
105d3f8Compareferruzzi
commented
May 21, 2026
@vincbeck - can you re-review when you get a minute? |
Uh oh!
There was an error while loading. Please reload this page.
- amazon: move S3 transfer-operators fix (apache#67378, vincbeck) and EcsRunTaskOperator log-level fix (apache#67180, jscheffl) from Features to Bug Fixes; beautify the EksPodOperator entry (apache#65335). - google: beautify the idle/auto-stop TTL entry (apache#65653) — drop conventional-commit prefix. - openlineage: beautify the ProcessPoolExecutor self-heal entry (apache#67400). - edge3: reword the 3.8.0 note — the provider still supports Airflow 3.0+, only the execute-callback feature (apache#67679) needs 3.3+ (jscheffl); move the Swagger API docs entry (apache#67390) to Doc-only; beautify the team_name clarification (apache#66718). - apache/drill: move the flit.sdist housekeeping entry (apache#65861) to the excluded block to match the kafka convention (jscheffl).
* Prepare provider documentation 2026-06-02 * Address review feedback on provider changelogs - amazon: move S3 transfer-operators fix (#67378, vincbeck) and EcsRunTaskOperator log-level fix (#67180, jscheffl) from Features to Bug Fixes; beautify the EksPodOperator entry (#65335). - google: beautify the idle/auto-stop TTL entry (#65653) — drop conventional-commit prefix. - openlineage: beautify the ProcessPoolExecutor self-heal entry (#67400). - edge3: reword the 3.8.0 note — the provider still supports Airflow 3.0+, only the execute-callback feature (#67679) needs 3.3+ (jscheffl); move the Swagger API docs entry (#67390) to Doc-only; beautify the team_name clarification (#66718). - apache/drill: move the flit.sdist housekeeping entry (#65861) to the excluded block to match the kafka convention (jscheffl). * Make apache/drill 3.3.3 a doc-only release The only non-excluded drill change in this wave was the flit.sdist housekeeping entry, which jscheffl asked to exclude — leaving an empty changelog. Promote the DAG-to-Dag wording change (#66153) into a Doc-only section so drill 3.3.3 ships as a legitimate doc-only release instead of an empty one. * Fold post-prep provider commits into changelogs Incremental-update pass for commits that landed on main after this wave was prepared: - amazon: Propogate verify/botocore_config in redshift cluster triggers (#67876) → Features (mirrors the batch-triggers entry #67508). - databricks: Lock in workflow depends_on parent-key behavior (#66681) → Bug Fixes. - edge3: Fix Edge worker fork mode reporting supervisor failures as success (#67887) → Bug Fixes. - google: Migrate Stackdriver logging config to RemoteLogIO pattern (#66513) → Misc.
Fix: EksPodOperator 401 with Cross-Account AssumeRole via aws_conn_id
Fixes#64657
Problem
When using
EksPodOperatorwithaws_conn_idpointing to a cross-account IAM role (viaAssumeRole),pods fail with
401 Unauthorized:Audit log shows empty user identity:
"user":{}.Root Cause
Two critical fragility points in the kubeconfig exec plugin
COMMANDtemplate inEksHook:stderr merged into stdout via
2>&1— Python warnings, deprecation notices, or log output fromeks_get_tokencontaminated stdout that bash token parsing relies on, causinglast_lineextraction to grab wrong line -> empty/invalid timestamp and token valuesNo token validation — If parsing failed, malformed
ExecCredentialJSON with empty token was sent to EKS API server -> 401 with empty user identityChanges
airflow/providers/amazon/aws/hooks/eks.py/dev/nullinstead of merging with stdout (2>&1) to ensure clean token output for bash parsingtests/unit/amazon/aws/hooks/test_eks.pytest_command_template_redirects_stderr: verifies stderr is redirected to/dev/nulland not merged with stdouttest_command_template_validates_token: verifies the token validation check and error exitReview Notes
This supersedes PR #64749. The following genuine review concerns have been addressed:
Copilot security flag: The empty-token error branch previously printed `` which includes the EKS bearer token. This has been removed to prevent credential leakage into task logs.
Copilot diagnostic regression: Non-zero exit now includes `` for troubleshooting (was lost in original PR).
o-nikolas concern: The
/dev/nullapproach is intentional and correct — the stderr output we discard (Python warnings, botocore debug messages) is not actionable for users. The non-zero exit diagnostics cover the actionable failures.Copilot test assertion tightening: Test assertions have been improved to check for absence of
2>&1(core correctness requirement) rather than just presence of/dev/null, and theexit 1assertion is now unambiguous.Testing