rjgoyln opened a new pull request, #75493:
URL: https://github.com/apache/airflow/pull/75493

   Continues #70936, which was approved and then closed by the open PR limit.
   
   ## Summary
   
   Both API clients parse an error body only when `content-type` is exactly 
`application/json`. Behind a proxy that rewrites it to `application/json; 
charset=utf-8`, or one answering with `application/problem+json`:
   
   - `airflowctl` shows only the HTTP status line, not the server's error 
message.
   - The Task SDK raises a bare `HTTPStatusError` instead of 
`ServerResponseError`, so the status-specific handling in the supervisor and 
the client's operations (a 404 meaning a missing connection or variable, for 
example) stops matching.
   
   Airflow's own API server sends the bare media type, so this needs a proxy in 
between.
   
   ## Change
   
   - Match the media type case-insensitively, ignoring parameters and accepting 
`+json` suffixes, in both clients.
   - In `airflowctl`, treat an undecodable JSON body as a plain HTTP error, and 
log a non-object JSON body instead of crashing on it.
   
   Since the approval on #70936 the branch is rebased onto the Task SDK's 
`httpx2` migration (#73116), and the newsfragment covers only the Task SDK 
side, which is what ships in airflow-core.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to