{"record":{"id":"e92cdd4507fb105f","repo":"wagoodman/dive","slug":"unable-to-determine-image-source-from-q-v","errorCode":null,"errorMessage":"unable to determine image source from %q: %v\n","messagePattern":"unable to determine image source from %q: (.+?)\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/dive/cli/internal/options/analysis.go","lineNumber":61,"sourceCode":"\t\tfmt.Sprintf(\"The container engine to fetch the image from. Allowed values: %s\", strings.Join(c.AvailableContainerEngines, \", \")))\n\n\tflags.BoolVarP(&c.IgnoreErrors, \"ignore-errors\", \"i\", \"ignore image parsing errors and run the analysis anyway\")\n}\n\nfunc (c *Analysis) PostLoad() error {\n\tvalidEngines := strset.New(c.AvailableContainerEngines...)\n\tif !validEngines.Has(c.ContainerEngine) {\n\t\tlog.Warnf(\"invalid container engine: %s (valid options: %s), using default %q\", c.ContainerEngine, strings.Join(c.AvailableContainerEngines, \", \"), defaultContainerEngine)\n\t\tc.ContainerEngine = \"docker\"\n\t}\n\n\tif c.Image != \"\" {\n\t\tsourceType, imageStr := dive.DeriveImageSource(c.Image)\n\n\t\tif sourceType == dive.SourceUnknown {\n\t\t\tsourceType = dive.ParseImageSource(c.ContainerEngine)\n\t\t\tif sourceType == dive.SourceUnknown {\n\t\t\t\treturn fmt.Errorf(\"unable to determine image source from %q: %v\\n\", c.Image, c.ContainerEngine)\n\t\t\t}\n\n\t\t\t// use exactly what the user provided\n\t\t\timageStr = c.Image\n\t\t}\n\n\t\tc.Image = imageStr\n\t\tc.Source = sourceType\n\t} else {\n\t\tc.Source = dive.ParseImageSource(c.ContainerEngine)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":43,"sourceCodeEnd":76,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/options/analysis.go#L43-L76","documentation":"Thrown during options post-processing when dive cannot map the user-supplied image argument (and the configured container engine) to any known image source. dive.DeriveImageSource() on the image string returned SourceUnknown, and the fallback dive.ParseImageSource(engine) for the configured engine also returned SourceUnknown, so there is no way to fetch the image.","triggerScenarios":"Passing an image string that matches no supported source scheme (not a docker-archive: OCI tar, podman remote syntax, etc.) while the --engine flag is also set to an unrecognized value. Note the engine is validated against AvailableContainerEngines above and falls back to 'docker', so in practice this fires when the image string itself is malformed for the resolved engine.","commonSituations":"Typos in the image name or scheme prefix (e.g. dockerarchive:// instead of docker-archive://); using a source format only supported by a different engine version; passing a custom engine name not in AvailableContainerEngines combined with an ambiguous image string.","solutions":["Re-check the image argument spelling and scheme prefix; prefer plain 'docker.io/library/ubuntu:latest' style references or 'docker-archive://path/to.tar'.","Explicitly pass a supported --engine (docker, podman) matching where the image actually lives.","If using an engine alias, confirm it exactly matches one of AvailableContainerEngines, since unknown engines silently fall back to docker.","Upgrade dive if you rely on a newer source-scheme (e.g. OCI layout) supported only in later versions."],"exampleFix":"# before\ndive dockerarchive:///tmp/img.tar   # scheme typo -> unable to determine image source\n\n# after\ndive docker-archive:///tmp/img.tar","handlingStrategy":"validation","validationCode":"# validate before running dive\n[ -n \"$IMAGE\" ] || { echo \"image required\"; exit 1; }\ncase \"$IMAGE\" in\n  docker-archive://*|*.tar) ENGINE_FLAGS=\"\";;\n  *) ENGINE_FLAGS=\"--engine docker\";;\nesac\ndive $ENGINE_FLAGS \"$IMAGE\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use canonical image references (registry/repo:tag) or the documented docker-archive:// scheme.","Pin --engine explicitly instead of relying on the silent fallback to docker.","Script a preflight check on the image string format before invoking dive."],"tags":["dive","image-source","engine","configuration","cli"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}