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

   ## What does this PR do?
   
   When a secrets backend raises an exception during `get_connection()`, the 
exception is caught and logged at `DEBUG` without `exc_info`, making the actual 
error completely invisible — even with `DEBUG` logging enabled. Only the 
backend class name is logged, not the error itself.
   
   This PR adds `exc_info=True` to both the sync (`_get_connection`) and async 
(`_async_get_connection`) lookup loops in `context.py`.
   
   **Before:** only the backend name is visible at DEBUG:
   ```
   DEBUG - Unable to retrieve connection from secrets backend (VaultBackend). 
Checking subsequent secrets backend.
   ```
   
   **After:** the full traceback is included, so the actual cause (e.g. a 
`KeyError` during deserialization, an auth failure, a missing dependency) is 
visible when DEBUG logging is enabled.
   
   The exception stays at `DEBUG` to avoid log spam in normal multi-backend 
setups where fallthrough is expected. This brings `_get_connection` in line 
with `_get_variable`, which already uses `log.exception()`.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (claude-sonnet-4-6)
   
   Generated-by: Claude Code (claude-sonnet-4-6) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   Drafted-by: Claude Code (claude-sonnet-4-6); reviewed by @seanmuth before 
posting


-- 
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