{"record":{"id":"5480647e05ce79b5","repo":"slimtoolkit/slim","slug":"dockerimage-loadpackage-missing-image-config-obje","errorCode":null,"errorMessage":"dockerimage.LoadPackage: missing image config object for image ID=%s / archive='%s' / files=%+v","messagePattern":"dockerimage\\.LoadPackage: missing image config object for image ID=(.+?) / archive='(.+?)' / files=%\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"pkg/docker/dockerimage/dockerimage.go","lineNumber":1130,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif pkg.Format == FormatOCI {\n\t\tif pkg.ManifestOCI == nil {\n\t\t\treturn nil, fmt.Errorf(\"dockerimage.LoadPackage: missing OCI Image Manifest object for image ID=%s / archive='%s' / files=%+v\",\n\t\t\t\timageID, archivePath, archiveFiles)\n\t\t}\n\t} else {\n\t\tif pkg.Manifest == nil {\n\t\t\treturn nil, fmt.Errorf(\"dockerimage.LoadPackage: missing manifest object for image ID=%s / archive='%s' / files=%+v\",\n\t\t\t\timageID, archivePath, archiveFiles)\n\t\t}\n\t}\n\n\tif pkg.Config == nil {\n\t\treturn nil, fmt.Errorf(\"dockerimage.LoadPackage: missing image config object for image ID=%s / archive='%s' / files=%+v\",\n\t\t\timageID, archivePath, archiveFiles)\n\t}\n\n\tif len(layers) == 0 {\n\t\t//todo: display non-image layer metadata if there are any\n\t\t//todo: save non-image layer metadata/data\n\t\tlog.Debugf(\"dockerimage.LoadPackage: no image layers in archive - %s (%+v)\",\n\t\t\tarchivePath, layerFileNames)\n\t}\n\n\tif len(nonLayerFileNames) > 0 {\n\t\tlog.Debugf(\"dockerimage.LoadPackage: non-image layers in archive - %s (%s)\",\n\t\t\tarchivePath, jsonutil.ToString(nonLayerFileNames))\n\t}\n\n\tlog.Debugf(\"dockerimage.LoadPackage: layerLocationSource=%v layerSequence='%#v' - archive='%s'\",\n\t\tlayerLocationSource, layerSequence, archivePath)\n","sourceCodeStart":1112,"sourceCodeEnd":1148,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/docker/dockerimage/dockerimage.go#L1112-L1148","documentation":"dockerimage.LoadPackage requires the image config object (the JSON config blob holding history, rootfs diff_ids, architecture, etc.). A nil pkg.Config means the config blob referenced by the manifest was not found or failed to parse in the archive, so loading aborts with the image ID, archive path, and file list.","triggerScenarios":"Loading an image archive where the config blob (OCI `configs/` entry or docker `<digest>.json` config) is missing, truncated, or its digest doesn't match the manifest's config reference when calling LoadPackage.","commonSituations":"Archives stripped of config blobs by cleanup tooling; digest mismatches after re-tagging blobs; interrupted pulls that fetched layers but not the config; registries/proxies serving partial manifests.","solutions":["Re-export the archive from the registry/daemon so the full config blob is included.","Compare the manifest's config digest against the files list in the error and restore/rename the blob file to match the expected digest path.","Validate the archive with a tool (skopeo inspect / crane config) before ingestion to confirm the config resolves."],"exampleFix":"// before: config blob deleted during cleanup\n$ rm blobs/sha256/<config-digest>\n// after: keep full OCI layout intact\n$ crane pull --platform=linux/amd64 app:1.0 app.tar","handlingStrategy":"validation","validationCode":"// cross-check manifest config digest against archive files before LoadPackage\nfunc configBlobPresent(files []string, configDigest string) bool {\n\tfor _, f := range files {\n\t\tif strings.Contains(f, configDigest) { return true }\n\t}\n\treturn false\n}\n// sanity: crane config <archive-ref> should print the config JSON","typeGuard":"func configLoaded(p *dockerimage.Package) bool { return p != nil && p.Config != nil }","tryCatchPattern":"pkg, err := dockerimage.LoadPackage(...)\nif err != nil && strings.Contains(err.Error(), \"missing image config object\") {\n\t// re-export archive including the config blob\n}","preventionTips":["Never prune blobs from OCI layouts unless you re-derive the manifests","Pull complete images (layers + config) rather than selective blob fetches","Run skopeo inspect / crane config as a pre-flight check"],"tags":["oci","image-config","docker","archive"],"backgroundTag":"missing-image-config","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}