feat: Propagate kubernetes launcher errors to API#137
Draft
morgan-wowk wants to merge 1 commit intomasterfrom
Draft
feat: Propagate kubernetes launcher errors to API#137morgan-wowk wants to merge 1 commit intomasterfrom
morgan-wowk wants to merge 1 commit intomasterfrom
Conversation
Ark-kun
reviewed
Mar 5, 2026
| bts.ContainerExecutionStatus.SYSTEM_ERROR | ||
| ) | ||
| record_system_error_exception(execution=execution, exception=ex) | ||
| if execution.extra_data is None: |
Contributor
There was a problem hiding this comment.
Hmm. Why do you want to put this information in the another field? The error message (brief, full) is already put in extra_data.
P.S. There is _record_orchestration_error_message function that does slightly more.
Ark-kun
reviewed
Mar 5, 2026
| except k8s_client_lib.ApiException as ex: | ||
| k8s_message = _extract_kubernetes_error_message(ex) | ||
| raise interfaces.LauncherError( | ||
| k8s_message or f"Failed to create pod: Kubernetes API error ({ex.status} {ex.reason})" |
Contributor
There was a problem hiding this comment.
Should we include the Pod that we were trying to create (as the current message does)? I think it's very important for debugging pod creation issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

TL;DR
Enhanced Kubernetes error handling to extract and display meaningful error messages from API exceptions instead of dumping raw pod/job specifications.
What changed?
Added specific handling for
k8s_client_lib.ApiExceptionin both pod and job creation methods within the Kubernetes launchers. The new error handling extracts human-readable messages from the Kubernetes API response body and stores orchestration error messages in execution extra data for better debugging visibility.How to test?
Why make this change?
Kubernetes API returns structured JSON error responses with actionable error messages (like admission webhook rejection reasons), but the previous implementation would dump the entire pod/job specification instead. This change provides much more useful debugging information by surfacing the actual root cause of failures.