Skip to content

fix(dev): stream docker save without buffering in kind image load#464

Merged
pallakatos merged 2 commits into
mainfrom
fix/dev-docker-save-maxbuffer
Jun 26, 2026
Merged

fix(dev): stream docker save without buffering in kind image load#464
pallakatos merged 2 commits into
mainfrom
fix/dev-docker-save-maxbuffer

Conversation

@pallakatos

Copy link
Copy Markdown
Collaborator

Problem

kars dev (and kars dev --release) fails at step "Loading kars images into the kind cluster" with:

local-k8s dev failed: Command's stdout was larger than 100000000 characters:
/opt/homebrew/bin/docker save 'karsacr.azurecr.io/openclaw-sandbox:latest'
maxBuffer exceeded

Root cause

loadImageIntoKind() in cli/src/commands/dev/local-k8s.ts pipes docker save <image> straight into the kind node's ctr import:

const save = execa(runtime, ["save", image]);
const importProc = execa(runtime, ["exec", "-i", node, "ctr", "-n=k8s.io", "images", "import", "-"], );
save.stdout.pipe(importProc.stdin);

Even though the stream is piped, execa still accumulates the subprocess stdout into its result, capped at maxBuffer (default 100 MB). The openclaw-sandbox image exceeds 100 MB, so execa throws maxBuffer exceeded and aborts the entire bring-up.

Fix

Pass { buffer: false } to the docker save subprocess. The tarball is never needed in memory — it streams directly to ctr import — so buffering is pure overhead and the source of the failure. One-line change plus an explanatory comment.

Testing

  • Reproduced: kars dev --release aborts at "Loading kars images" on a host where the sandbox image is > 100 MB.
  • With the fix, docker save | ctr import streams to completion and the kind load proceeds.

Scope

Isolated, standalone CLI bugfix; no behavioral change beyond no longer aborting on large images.

`kars dev` (and `--release`) failed at "Loading kars images into the kind
cluster" with:

    Command's stdout was larger than 100000000 characters:
    docker save 'karsacr.azurecr.io/openclaw-sandbox:latest'

`loadImageIntoKind` pipes `docker save <image>` into the kind node's
`ctr import`, but execa still accumulates the subprocess stdout into its
result — capped at `maxBuffer` (default 100 MB) — *even when the stream is
also piped*. The openclaw-sandbox image exceeds 100 MB, so execa throws and
aborts the whole bring-up.

Pass `buffer: false` to the `docker save` subprocess: the tarball is never
needed in memory (it streams straight to `ctr import`), so buffering is pure
overhead and the source of the failure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pallakatos pallakatos merged commit d418cae into main Jun 26, 2026
35 checks passed
pallakatos pushed a commit that referenced this pull request Jun 26, 2026
…on + dev kind-load fixes)

- #467 fix(memory): consolidate Foundry Memory Store on the router; thin
  OpenClaw/Hermes clients; idempotent project-MI RBAC heal on `kars upgrade`.
- #464 fix(dev): stream `docker save` without buffering in kind image load.
- #465 fix(dev): load local-dev `:dev` image names into kind, not ACR `:latest`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant