azure: don't let console-log capture mask deployment errors#4498
azure: don't let console-log capture mask deployment errors#4498LiliDeng wants to merge 1 commit into
Conversation
_save_console_log_and_check_panic is a best-effort diagnostic helper. When the boot diagnostics API returns a transient failure (e.g. 'Service Unavailable'), the HttpResponseError used to escape and either replace the original deployment timeout error or trigger an AssertionError in the outer 'except HttpResponseError' handler (where 'e.error' is None for body-less responses). Wrap the helper so any failure is logged and swallowed.
There was a problem hiding this comment.
Pull request overview
This PR makes Azure console-log collection during deployment failures best-effort so transient boot diagnostics failures do not hide the original deployment error.
Changes:
- Wraps serial console capture in exception handling.
- Logs console-log capture failures per VM and at the resource-group level.
- Preserves deployment flow when diagnostic capture fails.
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
Test case details
|
| saved_path.mkdir(parents=True, exist_ok=True) | ||
| for vm in vms: | ||
| try: | ||
| log_response_content = save_console_log( |
There was a problem hiding this comment.
We should enhance exception handling in save_console_log() in common.py
except Exception as e: # Broad except: boot diagnostics can fail transiently with # HttpResponseError (e.g. ARM 503), ResourceNotFoundError, etc. # Any such failure must not mask the caller's original deployment # exception when this is invoked from a failure-handling path. log.debug(f"fail to get serial console log. {e}") return b""
_save_console_log_and_check_panic is a best-effort diagnostic helper. When the boot diagnostics API returns a transient failure (e.g. 'Service Unavailable'), the HttpResponseError used to escape and either replace the original deployment timeout error or trigger an AssertionError in the outer 'except HttpResponseError' handler (where 'e.error' is None for body-less responses). Wrap the helper so any failure is logged and swallowed.
Description
Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
Test Results