wagoodman/dive · error

unable to resolve image %q: %+v

Error message

unable to resolve image %q: %+v

What it means

The podman resolver's Fetch tries resolveFromDockerArchive, which streams 'podman image save <id>' and parses it as a docker archive. Any failure anywhere in that chain — podman missing, image ID unknown to podman, the save command failing, or the archive parsing rejecting the stream — is aggregated into this single wrapped error, so the underlying %+v detail is the real diagnostic.

Source

Thrown at dive/image/podman/resolver.go:41

}

func (r *resolver) Build(ctx context.Context, args []string) (*image.Image, error) {
	id, err := buildImageFromCli(args)
	if err != nil {
		return nil, err
	}
	return r.Fetch(ctx, id)
}

func (r *resolver) Fetch(ctx context.Context, id string) (*image.Image, error) {
	// todo: add podman fetch attempt via varlink first...

	img, err := r.resolveFromDockerArchive(id)
	if err == nil {
		return img, err
	}

	return nil, fmt.Errorf("unable to resolve image %q: %+v", id, err)
}

func (r *resolver) Extract(ctx context.Context, id string, l string, p string) error {
	// todo: add podman fetch attempt via varlink first...

	err, reader := streamPodmanCmd("image", "save", id)
	if err != nil {
		return err
	}

	if err := docker.ExtractFromImage(io.NopCloser(reader), l, p); err == nil {
		return nil
	}

	return fmt.Errorf("unable to extract from image %q: %+v", id, err)
}

func (r *resolver) resolveFromDockerArchive(id string) (*image.Image, error) {

View on GitHub (pinned to d6c691947f)

Solutions

  1. Confirm the image exists exactly as spelled: 'podman images' and copy the full ID/tag, then retry Fetch
  2. Pull first: 'podman pull <image>' then run dive/Fetch again
  3. Check rootful vs rootless: run the same command with/without sudo so dive sees the same podman store that has the image
  4. Read the wrapped error text — if it says 'cannot find podman client executable' fix PATH; if it mentions tar/manifest, apply the archive-side fixes
  5. For podman remote setups, ensure 'podman info' works non-interactively for the same user before diving

Example fix

# before
dive --source podman alpine   # unable to resolve image "alpine": ... (not pulled / not found)

# after
podman pull docker.io/library/alpine:latest
dive --source podman docker.io/library/alpine:latest
Defensive patterns

Strategy: try-catch

Validate before calling

// Confirm the image exists in the podman store before calling Fetch.
func podmanImageExists(id string) bool {
    cmd := exec.Command("podman", "image", "inspect", id)
    return cmd.Run() == nil
}

if !podmanImageExists(id) {
    if err := exec.Command("podman", "pull", id).Run(); err != nil {
        return fmt.Errorf("image %q not available locally and pull failed", id)
    }
}

Try / catch

img, err := res.Fetch(ctx, id)
if err != nil {
    wrapped := err.Error()
    switch {
    case strings.Contains(wrapped, "cannot find podman client executable"):
        // install podman / fix PATH
    case strings.Contains(wrapped, "unmarshal manifest"):
        // archive format problem
    default:
        // most often: image not present — podman pull then retry once
    }
}

Prevention

When it happens

Trigger: Calling resolver.Fetch(ctx, id) with an image ID/tag that podman cannot save (not present locally, ambiguous short ID, registry-qualified tag not pulled), with podman unavailable, or when the saved stream is not parseable (tar/manifest issues as in the archive errors).

Common situations: Running 'dive --source podman <image>' before pulling the image; using a short image ID that matches nothing in 'podman images'; podman store mismatch (rootful vs rootless, different user store); podman remote without a connection configured.

Related errors


AI-assisted analysis of wagoodman/dive@d6c691947f (2026-08-15). Data as JSON: /api/errors/91d7f2756ce575b3. Report an issue: GitHub.