containerd/containerd · error

failed to get bootstrap params of sandbox %s: %w

Error message

failed to get bootstrap params of sandbox %s: %w

What it means

After locating the shim process, Start reads the bootstrap.json file persisted in the shim's bundle directory via restoreBootstrapParams(process.Bundle()). If that read/parse fails (missing or unreadable/corrupt file), the error is wrapped with the sandbox ID and returned.

Source

Thrown at core/runtime/v2/shim_manager.go:254

				}

				// The sandbox controller only returns connection details, not
				// what its shim advertised at startup. Recover that from the
				// shim instance containerd already has in memory for this
				// sandbox, so a container joining it is not treated as if the
				// shim advertised nothing.
				if process, err := m.Get(ctx, opts.SandboxID); err == nil {
					params.Extensions = sandboxShimExtensions(process)
				}
			} else {
				process, err := m.Get(ctx, opts.SandboxID)
				if err != nil {
					return nil, fmt.Errorf("can't find shim for sandbox %s: %w", opts.SandboxID, err)
				}

				p, err := restoreBootstrapParams(process.Bundle())
				if err != nil {
					return nil, fmt.Errorf("failed to get bootstrap "+
						"params of sandbox %s: %w", opts.SandboxID, err)
				}
				params = p
			}
		}
	}
	// Even though one shim can be able to group multiple containers,
	// it doesn't mean it supports sandbox API. The old shim implementation
	// still requires containerd to invoke `shim delete` to cleanup
	// container's resource when each container exits. So, if the
	// shim version is not higher than 3, we should fallback to invoke
	// shim binary.
	//
	// NOTE: The shim version indicates that the shim supports streaming I/O.
	// It's rolled out together with the sandbox API and can be used
	// to determine whether we should invoke the shim binary.
	const supportSandboxAPIVersion = 3
	if params.Version < supportSandboxAPIVersion {

View on GitHub (pinned to 4246446a2b)

Solutions

  1. Restore/rewrite bootstrap.json in the bundle directory or stop and re-create the container
  2. Verify the bundle path exists and is readable by the containerd process
  3. Check disk/filesystem health for corrupted files
  4. Restart the shim and task so bootstrap.json is regenerated

Example fix

# before: file missing
ls /run/containerd/io.containerd.runtime.v2.task/moby/<id>/bootstrap.json  # No such file
# after: recreate by stopping and re-creating the task
ctr tasks kill <id>; ctr run ... <id>
Defensive patterns

Strategy: validation

Validate before calling

func bootstrapExists(bundle string) error {
    f := filepath.Join(bundle, "bootstrap.json")
    if _, err := os.Stat(f); err != nil { return fmt.Errorf("bootstrap.json missing: %w", err) }
    return nil
}

Try / catch

if err != nil {
    if strings.Contains(err.Error(), "bootstrap params") {
        // recreate the task or restore bootstrap.json from bundle backup
    }
}

Prevention

When it happens

Trigger: The bundle directory of a running shim lacks bootstrap.json, was deleted while the shim ran, or contains corrupt/empty JSON produced by a failed earlier writeBootstrapParams.

Common situations: Bundles on tmpfs wiped on reboot while shim socket still registered; disk cleanup scripts removing bundle dirs; interrupted containerd write leaving truncated bootstrap.json.

Related errors


AI-assisted analysis of containerd/containerd@4246446a2b (2026-09-02). Data as JSON: /api/errors/ed632f2f4d9dbfd4. Report an issue: GitHub.