{"record":{"id":"87ce13395cef6f71","repo":"wagoodman/dive","slug":"cannot-load-image-w","errorCode":null,"errorMessage":"cannot load image: %w","messagePattern":"cannot load image: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"cmd/dive/cli/internal/command/root.go","lineNumber":55,"sourceCode":"\t\t\t}\n\t\t\topts.Analysis.Image = args[0]\n\t\t\treturn nil\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, _ []string) error {\n\t\t\tif err := setUI(app, opts.Application); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to set UI: %w\", err)\n\t\t\t}\n\n\t\t\tresolver, err := dive.GetImageResolver(opts.Analysis.Source)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"cannot determine image provider to fetch from: %w\", err)\n\t\t\t}\n\n\t\t\tctx := cmd.Context()\n\n\t\t\timg, err := adapter.ImageResolver(resolver).Fetch(ctx, opts.Analysis.Image)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"cannot load image: %w\", err)\n\t\t\t}\n\n\t\t\treturn run(ctx, opts.Application, img, resolver)\n\t\t},\n\t}, opts)\n}\n\nfunc setUI(app clio.Application, opts options.Application) error {\n\ttype Stater interface {\n\t\tState() *clio.State\n\t}\n\n\tstate := app.(Stater).State()\n\n\tux := ui.NewV1UI(opts.V1Preferences(), os.Stdout, state.Config.Log.Quiet, state.Config.Log.Verbosity)\n\treturn state.UI.Replace(ux)\n}\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/command/root.go#L37-L73","documentation":"Returned by `dive <image>` when the resolved provider fails to fetch the image reference into an analyzable form (adapter.ImageResolver(...).Fetch). It wraps the engine-level error: image not found locally/remote, registry auth failures, network errors, or unsupported image formats/manifests the resolver cannot process.","triggerScenarios":"dive nonexistent-image (not local, not pullable); private registry image without docker login; registry unreachable behind a proxy; local image saved in a format the resolver cannot read (e.g. OCI layout quirks or containerd-shuffled storage); typo'd tag.","commonSituations":"CI without registry credentials pulling a private base image; air-gapped environments where the implicit pull fails; images built by a different engine than the selected --source (image exists in podman but --source docker).","solutions":["Read the wrapped error — it distinguishes not-found, auth, and network causes","docker pull / podman pull the image manually to verify it exists and credentials work","Ensure --source matches the engine that actually holds the image","docker login (or podman login) for private registries; check proxy/DNS in restricted networks"],"exampleFix":"# before (image lives in podman, source defaults elsewhere)\ndive localhost/myapp:latest\n\n# after\ndive localhost/myapp:latest --source podman","handlingStrategy":"retry","validationCode":"# make the image locally available before analyzing\n docker image inspect \"$IMG\" >/dev/null 2>&1 || docker pull \"$IMG\" || exit 1\ndive \"$IMG\"","typeGuard":null,"tryCatchPattern":"img, err := adapter.ImageResolver(resolver).Fetch(ctx, ref)\nif err != nil {\n    if isTransient(err) { // network/registry timeouts: backoff and retry once\n        time.Sleep(2 * time.Second)\n        img, err = adapter.ImageResolver(resolver).Fetch(ctx, ref)\n    }\n    if err != nil { return fmt.Errorf(\"cannot load image: %w\", err) }\n}","preventionTips":["Pre-pull private images with proper registry login before dive runs","Match --source to the engine that actually holds the image","Distinguish auth/network/not-found from the wrapped error before retrying — only retry transient causes"],"tags":["fetch","registry","auth","network","docker","podman"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}