abiosoft/colima · error

failed to create bundle directory: %w

Error message

failed to create bundle directory: %w

What it means

findGGUFPath creates the bundle parent with guest.RunQuiet("docker","exec","docker-model-runner","mkdir","-p","/models/bundles/sha256/<hash>/model"). The exec returned non-zero: the container filesystem/volume backing /models is read-only or full, the container exited mid-command, or the /models volume is not mounted in this runner container.

Source

Thrown at model/docker.go:87

	// Find the GGUF layer (mediaType contains "gguf")
	var blobPath string
	for _, layer := range manifest.Layers {
		if strings.Contains(layer.MediaType, "gguf") {
			if blobHash, ok := strings.CutPrefix(layer.Digest, "sha256:"); ok {
				blobPath = fmt.Sprintf("/models/blobs/sha256/%s", blobHash)
				break
			}
		}
	}

	if blobPath == "" {
		return "", fmt.Errorf("no GGUF layer found in model manifest")
	}

	// Create bundle directory and hard-link the blob (same approach as Docker Model Runner)
	bundleDir := fmt.Sprintf("/models/bundles/sha256/%s/model", modelHash)
	if err := guest.RunQuiet("docker", "exec", "docker-model-runner", "mkdir", "-p", bundleDir); err != nil {
		return "", fmt.Errorf("failed to create bundle directory: %w", err)
	}

	if err := guest.RunQuiet("docker", "exec", "docker-model-runner", "ln", blobPath, bundlePath); err != nil {
		return "", fmt.Errorf("failed to link model file: %w", err)
	}

	return bundlePath, nil
}

// InspectDockerModel returns information about a Docker model.
func InspectDockerModel(modelName string) (*DockerModelInfo, error) {
	guest := lima.New(host.New())
	output, err := guest.RunOutput("docker", "model", "inspect", modelName)
	if err != nil {
		return nil, fmt.Errorf("error inspecting model %q: %w", modelName, err)
	}

	var info DockerModelInfo

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Free space in the VM (docker system prune, remove unused models, or colima stop + disk resize) and retry
  2. Check the volume: docker inspect docker-model-runner --format '{{json .Mounts}}' — /models must be present and writable
  3. Restart the runner (docker model start-runner) and retry serve
  4. If the runner layout is broken, run SetupOrUpdateDocker (reinstall-runner) to rebuild it
Defensive patterns

Strategy: try-catch

Validate before calling

// Before serve: ensure the runner container is Running, not just inspectable.
func runnerRunning(guest environment.VM) bool {
    return guest.RunQuiet("docker", "inspect", "-f", "{{.State.Running}}",
        "docker-model-runner") == nil
}

Try / catch

if err := guest.RunQuiet("docker", "exec", "docker-model-runner", "mkdir", "-p", bundleDir); err != nil {
    return "", fmt.Errorf("failed to create bundle directory: %w — check runner container state and VM disk space", err)
}

Prevention

When it happens

Trigger: VM disk exhausted (colima default disk full from images/models); runner container stopped between the manifest read and the mkdir; /models not present because the runner container was recreated with a different volume layout.

Common situations: Large models filling the 60-100GB default disk; mixing docker model commands with pruned volumes; runner recreated by reinstall-runner without its data volume.

Related errors


AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15). Data as JSON: /api/errors/2ac02cc9d42d4627. Report an issue: GitHub.