Skip to content

Gate raw Dag deserialization error detail behind api.expose_stacktrace and log it server-side#68388

Open
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:gate-dag-deserialization-error-detail-on-expose-stacktrace
Open

Gate raw Dag deserialization error detail behind api.expose_stacktrace and log it server-side#68388
potiuk wants to merge 1 commit into
apache:mainfrom
potiuk:gate-dag-deserialization-error-detail-on-expose-stacktrace

Conversation

@potiuk

@potiuk potiuk commented Jun 11, 2026

Copy link
Copy Markdown
Member

DagErrorHandler interpolated the raw str(exc) of a DeserializationError directly into the HTTP 500 detail, ignoring the api.expose_stacktrace setting that its sibling _UniqueConstraintErrorHandler already honors. This makes the two handlers consistent: the raw exception text is returned only when expose_stacktrace is enabled; otherwise the response carries a generic message plus a correlation id, and the full error is logged server-side (previously it was not logged at all).

  • Gate the raw deserialization-error text behind api.expose_stacktrace, mirroring _UniqueConstraintErrorHandler.
  • Log the error server-side with a correlation id so detail is not lost when not exposed.
  • Tests: existing raw-detail cases now run under expose_stacktrace=True; a new case asserts the detail is withheld + an id is returned + the error is logged when off.
Was generative AI tooling used to co-author this PR?
  • Yes — Claude Opus 4.8 (1M context)

Generated-by: Claude Opus 4.8 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant