fix(orchestrator): remove 100-char truncation from envd error response bodies - #3481
Open
AdaAibaby wants to merge 1 commit into
Open
fix(orchestrator): remove 100-char truncation from envd error response bodies#3481AdaAibaby wants to merge 1 commit into
AdaAibaby wants to merge 1 commit into
Conversation
…e bodies envd error response bodies were truncated to 100 characters before being embedded in error messages and log fields. For NFS mount failures the full error string is ~300 chars, so the truncation point falls in the middle of a path, losing the root cause entirely (e.g. "no such file or directory"). Remove the truncation from the four error-path call sites in envd.go. Error response bodies from envd are short diagnostic strings, not arbitrary user data, so there is no log-explosion risk. Signed-off-by: shaolila <shaolila@buaa.edu.cn>
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.
Fixes #3480.
What
Remove
utils.Truncate(string(body), 100)from the four error-path call sites inpackages/orchestrator/pkg/sandbox/envd.go:callEnvdCollapse— error returned on non-200postEnvd— error returned on non-204 (covers/init,/pause,/resume, and other endpoints)CallEnvdUpgrade— error returned on non-200/204initEnvd—response_bodylog field on non-204Why
The truncated string is embedded directly in
fmt.Errorfcalls, so it propagates through the full error chain and is visible to callers. For NFS volume mount failures the full error body is ~300 chars; the 100-char cutpoint falls mid-path, stripping the actual cause (no such file or directory, permission denied, etc.).Before:
After:
envd error response bodies are short server-generated diagnostic strings, not arbitrary user data, so removing the cap carries no log-explosion risk.
Not a duplicate
No existing open PR addresses this truncation. The related volume-locality issue is tracked separately in #3195 / #3196.
Testing
go build ./packages/orchestrator/...— passes