{"record":{"id":"7c5253e156fbce4d","repo":"wagoodman/dive","slug":"could-not-find-image-config","errorCode":null,"errorMessage":"could not find image config","messagePattern":"could not find image config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dive/image/docker/image_archive.go","lineNumber":192,"sourceCode":"\t\t\t}\n\t\t}\n\t\tif len(configPath) == 0 {\n\t\t\treturn img, fmt.Errorf(\"could not find image manifest\")\n\t\t}\n\n\t\tvar layerPaths []string\n\t\tfor k := range img.layerMap {\n\t\t\tlayerPaths = append(layerPaths, k)\n\t\t}\n\t\timg.manifest = manifest{\n\t\t\tConfigPath:    configPath,\n\t\t\tLayerTarPaths: layerPaths,\n\t\t}\n\t}\n\n\tconfigContent, exists := jsonFiles[img.manifest.ConfigPath]\n\tif !exists {\n\t\treturn img, fmt.Errorf(\"could not find image config\")\n\t}\n\n\timg.config = newConfig(configContent)\n\n\treturn img, nil\n}\n\nfunc processLayerTar(name string, reader *tar.Reader) (*filetree.FileTree, error) {\n\ttree := filetree.NewFileTree()\n\ttree.Name = name\n\n\tfileInfos, err := getFileList(reader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, element := range fileInfos {\n\t\ttree.FileSize += uint64(element.Size)","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/dive/image/docker/image_archive.go#L174-L210","documentation":"Returned by the docker-archive loader (dive/image/docker/image_archive.go:192) when a manifest/config path was resolved (from manifest.json's Config entry or the OCI fallback) but that key is absent from the map of JSON files actually found in the tar. I.e. the metadata points at a config blob that is not present in the archive.","triggerScenarios":"manifest.json referencing <digest>.json when the tar's copy of that blob was renamed or omitted; archives assembled by concatenation or by hand where the config file was dropped; OCI fallback path where isConfig matched one blob but the layerMap/manifest wiring points elsewhere; partial or restarted docker save.","commonSituations":"Artifacts modified/repacked between save and analysis (strip, rename, re-compress), registry-proxy caches that rewrite config blob names, and interrupted transfers.","solutions":["Verify the referenced config exists: extract manifest.json (jq .[0].Config), then tar -tf app.tar | grep <that-name>","Re-pull and re-save from the source of truth: docker pull app:tag && docker save -o app.tar app:tag","Stop post-processing the tar (renaming, recompressing, stripping files) between save and dive","If the config blob name is legitimate but renamed, repack so manifest.json's Config matches the actual filename"],"exampleFix":"# before (repacked archive with renamed blobs)\ndive docker-archive://app-repacked.tar  # could not find image config\n\n# after (pristine save)\ndocker pull app:tag\ndocker save -o app.tar app:tag\ndive docker-archive://app.tar","handlingStrategy":"validation","validationCode":"// verify every manifest-referenced config exists in the tar\nfunc manifestConfigPresent(tarPath string) error {\n    names := tarEntries(tarPath) // map[string]bool of entry names\n    mf, ok := names[\"manifest.json\"]\n    if !ok {\n        return nil // handled by the OCI-fallback path\n    }\n    _ = mf\n    raw := readTarEntry(tarPath, \"manifest.json\")\n    var m []struct{ Config string }\n    if err := json.Unmarshal(raw, &m); err != nil || len(m) == 0 {\n        return fmt.Errorf(\"unparseable manifest.json\")\n    }\n    if !names[m[0].Config] {\n        return fmt.Errorf(\"config %s referenced but absent\", m[0].Config)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"img, err := resolver.Fetch(ctx, \"docker-archive://\"+p)\nif err != nil && strings.Contains(err.Error(), \"could not find image config\") {\n    // archive integrity problem: regenerate from source rather than patching\n    return fmt.Errorf(\"archive %s is incomplete (config blob missing); re-save with docker save\", p)\n}","preventionTips":["Never rename/repack entries inside docker archives","Treat this error as corruption: re-pull and docker save again","Verify archives with docker load before deeper tooling"],"tags":["docker-archive","manifest","config","corruption"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}