{"record":{"id":"f478b7340d96ccf7","repo":"wagoodman/dive","slug":"cannot-determine-image-provider-to-fetch-from-w","errorCode":null,"errorMessage":"cannot determine image provider to fetch from: %w","messagePattern":"cannot determine image provider to fetch from: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/dive/cli/internal/command/root.go","lineNumber":48,"sourceCode":"\t\tUse:   \"dive [IMAGE]\",\n\t\tShort: \"Docker Image Visualizer & Explorer\",\n\t\tLong: `This tool provides a way to discover and explore the contents of a docker image. Additionally the tool estimates\nthe amount of wasted space and identifies the offending files from the image.`,\n\t\tArgs: func(cmd *cobra.Command, args []string) error {\n\t\t\tif len(args) != 1 {\n\t\t\t\treturn fmt.Errorf(\"exactly one argument is required\")\n\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}","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/command/root.go#L30-L66","documentation":"Returned by `dive <image>` when dive.GetImageResolver(opts.Analysis.Source) cannot map the configured --source to an image provider. The source selects which engine to fetch the image from; resolution fails for unknown/unsupported source values or when the provider is unusable on the host, before any fetch is attempted.","triggerScenarios":"dive image --source <bad-value>, or a default source that is not available in the current environment; GetImageResolver errors immediately and the fetch never runs.","commonSituations":"Misspelled --source; assuming dive defaults to podman on a docker-only host (or vice versa); stale config files carrying a source value from an older dive version with a different provider list.","solutions":["Check the wrapped message for the list of valid sources","Set --source explicitly to docker or podman as installed on the host","Confirm the engine works at all: docker version / podman version","Remove or update the source key in your dive config file"],"exampleFix":"# before\ndive alpine --source containerd   # unsupported\n\n# after\ndive alpine --source docker","handlingStrategy":"validation","validationCode":"# pin the source to a locally available engine\ncommand -v docker >/dev/null && SRC=docker || SRC=podman\ndive myimage:latest --source \"$SRC\"","typeGuard":null,"tryCatchPattern":"resolver, err := dive.GetImageResolver(opts.Analysis.Source)\nif err != nil {\n    // unknown/unavailable provider: probe engines and retry with an explicit source\n    return fmt.Errorf(\"cannot determine image provider to fetch from: %w\", err)\n}","preventionTips":["Always pass --source explicitly in automation","Confirm the engine is installed and reachable before running dive","Update stale source values in dive config after engine migrations"],"tags":["source","provider","docker","podman","configuration"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}