Uh oh!
There was an error while loading. Please reload this page.
Surface remote-log upload failures via structured warnings - #66571
Conversation
`upload_to_remote()` silently returned in three failure paths (handler load failure, log-path resolution exception, handler.upload exception) with no signal to the operator that logs were not reaching the remote system. The supervisor's `_upload_logs` already logs the outermost exception, but the inner paths inside `upload_to_remote()` were silent — so a misconfigured remote handler or a transient remote-system outage would degrade silently while local-only logs continued. Add a dedicated `airflow.logging.remote` structlog logger and emit a `log.warning` at each of the three failure paths with the TI id and the underlying error string. No behaviour change otherwise — failures still fall through softly so a bad remote handler doesn't abort the task lifecycle. Reported by the L3 ASVS sweep at apache/tooling-agents#24 (FINDING-004).
c33b0a4 to
313bc16Comparepotiuk
commented
May 17, 2026
I'd love to get this one merged — and would love it in 3.2.2 if it's not too late. cc @vatsrahul1001 (3.2.2 RM) Drafted-by: Claude Code (Opus 4.7); reviewed by @potiuk before posting |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vatsrahul1001
commented
May 18, 2026
@potiuk can you address comments? |
amoghrajesh
left a comment
There was a problem hiding this comment.
Can we also have a test pls?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Use ti.id directly (available since 3.0) instead of getattr fallback. - Pass exc_info=exc to structlog so the traceback is preserved on path-resolution and upload failures. - Trim past-tense from the docstring comment. - Add tests covering the three failure paths and the silent success / no-path cases.
potiuk
commented
May 19, 2026
Addressed in 9c39993:
Drafted-by: Claude Code (Opus 4.7); reviewed by @potiuk before posting |
Uh oh!
There was an error while loading. Please reload this page.
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
#66571) (#67172) * Surface remote-log upload failures via structured warnings `upload_to_remote()` silently returned in three failure paths (handler load failure, log-path resolution exception, handler.upload exception) with no signal to the operator that logs were not reaching the remote system. The supervisor's `_upload_logs` already logs the outermost exception, but the inner paths inside `upload_to_remote()` were silent — so a misconfigured remote handler or a transient remote-system outage would degrade silently while local-only logs continued. Add a dedicated `airflow.logging.remote` structlog logger and emit a `log.warning` at each of the three failure paths with the TI id and the underlying error string. No behaviour change otherwise — failures still fall through softly so a bad remote handler doesn't abort the task lifecycle. Reported by the L3 ASVS sweep at apache/tooling-agents#24 (FINDING-004). * Address review feedback on remote-log upload warnings - Use ti.id directly (available since 3.0) instead of getattr fallback. - Pass exc_info=exc to structlog so the traceback is preserved on path-resolution and upload failures. - Trim past-tense from the docstring comment. - Add tests covering the three failure paths and the silent success / no-path cases. (cherry picked from commit ef87426) Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
#66571) (#67172) * Surface remote-log upload failures via structured warnings `upload_to_remote()` silently returned in three failure paths (handler load failure, log-path resolution exception, handler.upload exception) with no signal to the operator that logs were not reaching the remote system. The supervisor's `_upload_logs` already logs the outermost exception, but the inner paths inside `upload_to_remote()` were silent — so a misconfigured remote handler or a transient remote-system outage would degrade silently while local-only logs continued. Add a dedicated `airflow.logging.remote` structlog logger and emit a `log.warning` at each of the three failure paths with the TI id and the underlying error string. No behaviour change otherwise — failures still fall through softly so a bad remote handler doesn't abort the task lifecycle. Reported by the L3 ASVS sweep at apache/tooling-agents#24 (FINDING-004). * Address review feedback on remote-log upload warnings - Use ti.id directly (available since 3.0) instead of getattr fallback. - Pass exc_info=exc to structlog so the traceback is preserved on path-resolution and upload failures. - Trim past-tense from the docstring comment. - Add tests covering the three failure paths and the silent success / no-path cases. (cherry picked from commit ef87426) Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
#66571) (#67172) * Surface remote-log upload failures via structured warnings `upload_to_remote()` silently returned in three failure paths (handler load failure, log-path resolution exception, handler.upload exception) with no signal to the operator that logs were not reaching the remote system. The supervisor's `_upload_logs` already logs the outermost exception, but the inner paths inside `upload_to_remote()` were silent — so a misconfigured remote handler or a transient remote-system outage would degrade silently while local-only logs continued. Add a dedicated `airflow.logging.remote` structlog logger and emit a `log.warning` at each of the three failure paths with the TI id and the underlying error string. No behaviour change otherwise — failures still fall through softly so a bad remote handler doesn't abort the task lifecycle. Reported by the L3 ASVS sweep at apache/tooling-agents#24 (FINDING-004). * Address review feedback on remote-log upload warnings - Use ti.id directly (available since 3.0) instead of getattr fallback. - Pass exc_info=exc to structlog so the traceback is preserved on path-resolution and upload failures. - Trim past-tense from the docstring comment. - Add tests covering the three failure paths and the silent success / no-path cases. (cherry picked from commit ef87426) Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
#66571) (#67172) * Surface remote-log upload failures via structured warnings `upload_to_remote()` silently returned in three failure paths (handler load failure, log-path resolution exception, handler.upload exception) with no signal to the operator that logs were not reaching the remote system. The supervisor's `_upload_logs` already logs the outermost exception, but the inner paths inside `upload_to_remote()` were silent — so a misconfigured remote handler or a transient remote-system outage would degrade silently while local-only logs continued. Add a dedicated `airflow.logging.remote` structlog logger and emit a `log.warning` at each of the three failure paths with the TI id and the underlying error string. No behaviour change otherwise — failures still fall through softly so a bad remote handler doesn't abort the task lifecycle. Reported by the L3 ASVS sweep at apache/tooling-agents#24 (FINDING-004). * Address review feedback on remote-log upload warnings - Use ti.id directly (available since 3.0) instead of getattr fallback. - Pass exc_info=exc to structlog so the traceback is preserved on path-resolution and upload failures. - Trim past-tense from the docstring comment. - Add tests covering the three failure paths and the silent success / no-path cases. (cherry picked from commit ef87426) Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
ashb
commented
Jun 4, 2026
Two issues: One: This happens for every task when remote logging is not configured. Two: this only appears in the worker logs, which isn't visible to 99% of Airflow users. Was that your intention with this log, or were you expecting it to be visible in task logs? |
ashb
commented
Jun 9, 2026
@potiuk ^^ |
potiuk
commented
Jun 11, 2026
@ashb you were right — sorry for the unnecessary noise. The warnings fired for every task on installs without remote logging (a missing handler is the default, not a failure) and only reached worker stdout, not the task logs operators actually read. I tried a more targeted fix — silencing the no-handler case and routing genuine upload failures through the task's own logger so they'd show up in task logs — but it added more complexity than the defense-in-depth was worth. Reverting the whole change is the best solution for now: #68371. We can revisit surfacing real remote-upload failures later with a design that doesn't trip on the common no-remote-logging case. Drafted-by: Claude Code (Opus 4.8); reviewed by @potiuk before posting |
…66571)" (#68371) This reverts commit ef87426. The remote-log upload warnings fired for every task on installs without remote logging configured (a missing handler is the default, not a failure) and were emitted through a dedicated "airflow.logging.remote" logger that only reaches worker stdout, not the task logs operators actually read. The whole change is withdrawn rather than patched.
…pache#66571)" (apache#68371) This reverts commit ef87426. The remote-log upload warnings fired for every task on installs without remote logging configured (a missing handler is the default, not a failure) and were emitted through a dedicated "airflow.logging.remote" logger that only reaches worker stdout, not the task logs operators actually read. The whole change is withdrawn rather than patched.
…pache#66571)" (apache#68371) This reverts commit ef87426. The remote-log upload warnings fired for every task on installs without remote logging configured (a missing handler is the default, not a failure) and were emitted through a dedicated "airflow.logging.remote" logger that only reaches worker stdout, not the task logs operators actually read. The whole change is withdrawn rather than patched.
Summary
upload_to_remote()silently returned in three failure paths (handler load failure, log-path resolution exception,handler.uploadexception) with no signal to the operator that logs were not reaching the remote system. The supervisor's_upload_logsalready logs the outermost exception, but the inner paths insideupload_to_remote()were silent — so a misconfigured remote handler or a transient remote-system outage would degrade silently while local-only logs continued.Fix
Add a dedicated
airflow.logging.remotestructlog logger and emit alog.warningat each of the three failure paths with the TI id and the underlying error string. No behaviour change otherwise — failures still fall through softly so a bad remote handler doesn't abort the task lifecycle.Reported by
L3 ASVS sweep — apache/tooling-agents#24 (FINDING-004).
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.7) following the guidelines