{"record":{"id":"91d7f2756ce575b3","repo":"wagoodman/dive","slug":"unable-to-resolve-image-q-v","errorCode":null,"errorMessage":"unable to resolve image %q: %+v","messagePattern":"unable to resolve image %q: %\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dive/image/podman/resolver.go","lineNumber":41,"sourceCode":"}\n\nfunc (r *resolver) Build(ctx context.Context, args []string) (*image.Image, error) {\n\tid, err := buildImageFromCli(args)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn r.Fetch(ctx, id)\n}\n\nfunc (r *resolver) Fetch(ctx context.Context, id string) (*image.Image, error) {\n\t// todo: add podman fetch attempt via varlink first...\n\n\timg, err := r.resolveFromDockerArchive(id)\n\tif err == nil {\n\t\treturn img, err\n\t}\n\n\treturn nil, fmt.Errorf(\"unable to resolve image %q: %+v\", id, err)\n}\n\nfunc (r *resolver) Extract(ctx context.Context, id string, l string, p string) error {\n\t// todo: add podman fetch attempt via varlink first...\n\n\terr, reader := streamPodmanCmd(\"image\", \"save\", id)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := docker.ExtractFromImage(io.NopCloser(reader), l, p); err == nil {\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"unable to extract from image %q: %+v\", id, err)\n}\n\nfunc (r *resolver) resolveFromDockerArchive(id string) (*image.Image, error) {","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/image/podman/resolver.go#L23-L59","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Confirm the image exists exactly as spelled: 'podman images' and copy the full ID/tag, then retry Fetch","Pull first: 'podman pull <image>' then run dive/Fetch again","Check rootful vs rootless: run the same command with/without sudo so dive sees the same podman store that has the image","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","For podman remote setups, ensure 'podman info' works non-interactively for the same user before diving"],"exampleFix":"# before\ndive --source podman alpine   # unable to resolve image \"alpine\": ... (not pulled / not found)\n\n# after\npodman pull docker.io/library/alpine:latest\ndive --source podman docker.io/library/alpine:latest","handlingStrategy":"try-catch","validationCode":"// Confirm the image exists in the podman store before calling Fetch.\nfunc podmanImageExists(id string) bool {\n    cmd := exec.Command(\"podman\", \"image\", \"inspect\", id)\n    return cmd.Run() == nil\n}\n\nif !podmanImageExists(id) {\n    if err := exec.Command(\"podman\", \"pull\", id).Run(); err != nil {\n        return fmt.Errorf(\"image %q not available locally and pull failed\", id)\n    }\n}","typeGuard":null,"tryCatchPattern":"img, err := res.Fetch(ctx, id)\nif err != nil {\n    wrapped := err.Error()\n    switch {\n    case strings.Contains(wrapped, \"cannot find podman client executable\"):\n        // install podman / fix PATH\n    case strings.Contains(wrapped, \"unmarshal manifest\"):\n        // archive format problem\n    default:\n        // most often: image not present — podman pull then retry once\n    }\n}","preventionTips":["Always 'podman pull' (or build) images on the same host/user before dive Fetch","Use fully-qualified image references (docker.io/library/alpine:3) to avoid ambiguity","Match rootful/rootless context: run dive with the same privileges used to pull the image"],"tags":["podman","image-resolution","fetch","dive"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}