e2b-dev / e2b-dev/runtime

Alpine template builds fail: glibc busybox in SyncChangesToDisk + missing /usr/bin/ionice and /usr/bin/nice

Open
#3,597 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.6k
Forks
438
PR merge metrics
No merged PRs in 30d

Description

Summary

Alpine-based template builds fail at the base layer with two distinct exit status 127 errors.

Bug 1 — SyncChangesToDisk uses glibc-linked busybox

File: packages/orchestrator/pkg/template/build/sandboxtools/command.go

SyncChangesToDisk invokes rootfs.SandboxBusyBoxPath + " sync", which resolves to /usr/bin/busybox sync. The /usr/bin/busybox binary is compiled against glibc and cannot be executed on Alpine (musl libc) — it fails with exit status 127.

Bug 2 — /usr/bin/ionice and /usr/bin/nice missing on Alpine

File: packages/orchestrator/pkg/template/build/phases/base/distro/init.go (InitOpenRC)

envd's OOM wrapper hard-codes /usr/bin/ionice and /usr/bin/nice (handler.go):

exec /usr/bin/ionice -c 2 -n 4 /usr/bin/nice -n N ...

On Alpine, util-linux-misc installs ionice to /bin/ionice (not /usr/bin/ionice), and nice lives only at /bin/nice (busybox symlink). Verified:

$ docker run --rm alpine:3.22 sh -c 'apk add --no-cache util-linux-misc >/dev/null 2>&1; ls /usr/bin/ionice /usr/bin/nice 2>&1'
ls: /usr/bin/ionice: No such file or directory
ls: /usr/bin/nice: No such file or directory

Without symlinks at /usr/bin/ionice and /usr/bin/nice, every command envd spawns during the build step layer exits 127.

Fix

See linked PR: add /usr/bin/{ionice,nice} symlinks in the Alpine InitOpenRC provisioning step, and replace the glibc busybox path in SyncChangesToDisk with plain sync + explicit PATH.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with packages/orchestrator/pkg/template/build/sandboxtools/command.go and packages/orchestrator/pkg/template/build/phases/base/distro/init.go, then inspect the OOM wrapper in handler.go. Reproduce the Alpine base-layer failures and verify that sync works with the intended PATH and that envd-spawned commands find ionice and nice. Done means Alpine template builds no longer exit with status 127 for these causes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
build-system, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.