{"record":{"id":"1857d0630e72f355","repo":"slimtoolkit/slim","slug":"dockerimage-loadpackage-missing-manifest-object-f","errorCode":null,"errorMessage":"dockerimage.LoadPackage: missing manifest object for image ID=%s / archive='%s' / files=%+v","messagePattern":"dockerimage\\.LoadPackage: missing manifest object for image ID=(.+?) / archive='(.+?)' / files=%\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"pkg/docker/dockerimage/dockerimage.go","lineNumber":1124,"sourceCode":"\t\t\t\t\t\tlog.Errorf(\"dockerimage.LoadPackage: error reading oci layer from archive(%s/%s) - %v\", archivePath, hdr.Name, err)\n\t\t\t\t\t\treturn nil, err\n\t\t\t\t\t}\n\t\t\t\t\tlayers[layerID] = layer\n\t\t\t\t\tlog.Debugf(\"dockerimage.LoadPackage: saved layer '%s' from archive - %s\",\n\t\t\t\t\t\tlayerID, archivePath)\n\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)\",","sourceCodeStart":1106,"sourceCodeEnd":1142,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/docker/dockerimage/dockerimage.go#L1106-L1142","documentation":"dockerimage.LoadPackage validates that, for non-OCI (docker save style) packages, the Docker manifest object was loaded. A nil pkg.Manifest means the archive did not contain a usable manifest.json for the imageID, so loading aborts with the image ID, archive path, and file list to aid diagnosis.","triggerScenarios":"Calling LoadPackage on a docker-save format archive whose manifest.json is missing, unreadable, empty, or does not reference the requested imageID — e.g. legacy format archives, truncated tarballs, or OCI archives misclassified as docker format.","commonSituations":"Older `docker save` outputs or hand-assembled tars lacking manifest.json; archives created by piping (curl | tar) that were cut short; mixing OCI blobs into a package detected as FormatDocker.","solutions":["Re-run `docker save -o image.tar image:tag` on the source image to regenerate a complete archive with manifest.json.","Verify the archive contains manifest.json (`tar -tf image.tar | grep manifest.json`) and that its RepoTags/Digests reference the target imageID.","Check whether the archive is actually OCI layout and ensure the loader detects FormatOCI so the OCI manifest path is used instead."],"exampleFix":"// before: tar built without manifest.json\n$ tar -cf image.tar layers/ config.json\n// after\n$ docker save -o image.tar myimage:1.0","handlingStrategy":"validation","validationCode":"func hasManifestJSON(archivePath string) error {\n\tf, err := os.Open(archivePath)\n\tif err != nil { return err }\n\tdefer f.Close()\n\ttr := tar.NewReader(f)\n\tfor {\n\t\th, err := tr.Next()\n\t\tif err == io.EOF { return errors.New(\"manifest.json not found in archive\") }\n\t\tif err != nil { return err }\n\t\tif h.Name == \"manifest.json\" { return nil }\n\t}\n}","typeGuard":"func isDockerArchive(p *dockerimage.Package) bool { return p != nil && p.Format != dockerimage.FormatOCI }","tryCatchPattern":"pkg, err := dockerimage.LoadPackage(...)\nif err != nil && strings.Contains(err.Error(), \"missing manifest object\") {\n\t// regenerate archive with docker save or detect OCI format instead\n}","preventionTips":["Always create docker archives with `docker save -o`, never by hand-assembling tars","Check tar completion when piping downloads (set -o pipefail)","Confirm format detection matches the archive type before loading"],"tags":["docker","manifest","archive","docker-save"],"backgroundTag":"missing-image-manifest","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}