Skip to content

fix(orchestrator): remove 100-char truncation from envd error response bodies - #3481

Open
AdaAibaby wants to merge 1 commit into
e2b-dev:mainfrom
AdaAibaby:fix/envd-response-body-truncation
Open

fix(orchestrator): remove 100-char truncation from envd error response bodies#3481
AdaAibaby wants to merge 1 commit into
e2b-dev:mainfrom
AdaAibaby:fix/envd-response-body-truncation

Conversation

@AdaAibaby

Copy link
Copy Markdown
Contributor

Fixes #3480.

What

Remove utils.Truncate(string(body), 100) from the four error-path call sites in packages/orchestrator/pkg/sandbox/envd.go:

  • callEnvdCollapse — error returned on non-200
  • postEnvd — error returned on non-204 (covers /init, /pause, /resume, and other endpoints)
  • CallEnvdUpgrade — error returned on non-200/204
  • initEnvdresponse_body log field on non-204

Why

The truncated string is embedded directly in fmt.Errorf calls, 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:

failed to init new envd: /init returned 400: failed to mount "uuid": failed to chroot into "/data1/orchestrator/vo

After:

failed to init new envd: /init returned 400: failed to mount "uuid": failed to chroot into "/data1/orchestrator/volumes/team-f079…/vol-885b…": failed to bind mount "…": no such file or directory

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
  • Change is logging/error-message only; no behaviour is modified

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(orchestrator): envd error responses truncated to 100 chars, hiding root cause in logs and error chain

2 participants