{"record":{"id":"f1dd26a49dcd6313","repo":"slimtoolkit/slim","slug":"index-reference-metadata-get-error-s-v","errorCode":null,"errorMessage":"index reference metadata get error - %s (%v)","messagePattern":"index reference metadata get error - (.+?) \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/app/master/command/registry/handler_image_index.go","lineNumber":179,"sourceCode":"\t\t\t\tovars{\n\t\t\t\t\t\"message\": \"need to authenticate\",\n\t\t\t\t})\n\n\t\t\texitCode := -111\n\t\t\txc.Out.State(\"exited\",\n\t\t\t\tovars{\n\t\t\t\t\t\"exit.code\": exitCode,\n\t\t\t\t\t\"version\":   v.Current(),\n\t\t\t\t})\n\t\t\txc.Exit(exitCode)\n\t\t} else {\n\t\t\txc.FailOn(fmt.Errorf(\"saving image index error - %s (%v)\", cparams.ImageIndexName, err))\n\t\t}\n\t}\n\n\tindexMeta, err := remote.Index(imageIndexRef, remoteOpts...)\n\tif err != nil {\n\t\txc.FailOn(fmt.Errorf(\"index reference metadata get error - %s (%v)\", cparams.ImageIndexName, err))\n\t}\n\n\tindexMediaType, err := indexMeta.MediaType()\n\txc.FailOn(err)\n\n\tif !indexMediaType.IsIndex() {\n\t\txc.FailOn(fmt.Errorf(\"unexpected media type for index\"))\n\t}\n\n\tindexDigest, err := indexMeta.Digest()\n\txc.FailOn(err)\n\n\tindexManifest, err := indexMeta.IndexManifest()\n\txc.FailOn(err)\n\txc.Out.Info(\"index.info\",\n\t\tovars{\n\t\t\t\"reference\":                imageIndexRef,\n\t\t\t\"digest\":                   indexDigest.String(),","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/slimtoolkit/slim/blob/81940d17fa112cc678e32209214bcb2355cb3004/pkg/app/master/command/registry/handler_image_index.go#L161-L197","documentation":"After saving, the handler re-reads the index with remote.Index(imageIndexRef) to verify it; this fetch failed. The wrapped error names the index reference and the underlying cause.","triggerScenarios":"remote.Index fails right after a (possibly reported-as-failed or skipped) save: eventual-consistency lag on the registry, auth mismatch between write and read, or network errors.","commonSituations":"Mirroring/proxy registries (e.g. pull-through caches) that don't immediately serve freshly pushed manifests; reading anonymously right after an authenticated push; transient network blips.","solutions":["Retry the verification fetch after a short delay","Use the same auth options for read as were used for the write","Verify the manifest actually landed: 'docker manifest inspect <index-ref>'","If the registry is a cache/mirror, query the upstream registry directly"],"exampleFix":"// before\nindexMeta, err := remote.Index(imageIndexRef, remoteOpts...)\n// after\nindexMeta, err := remote.Index(imageIndexRef, append(remoteOpts,\n  remote.WithAuthFromKeychain(authn.DefaultKeychain))...)","handlingStrategy":"retry","validationCode":"// verify with a small retry loop after push\nvar indexMeta *remote.Descriptor\nfor i := 0; i < 3; i++ {\n    if indexMeta, err = remote.Index(imageIndexRef, remoteOpts...); err == nil {\n        break\n    }\n    time.Sleep(2 * time.Second)\n}","typeGuard":null,"tryCatchPattern":"indexMeta, err := remote.Index(imageIndexRef, remoteOpts...)\nif err != nil {\n    if isTransient(err) {\n        // retry with backoff before failing\n    }\n    return fmt.Errorf(\"index verify failed for %s: %w\", imageIndexRef.Name(), err)\n}","preventionTips":["Read back with the same credentials used for the push","Allow for eventual consistency on mirrored/proxy registries","Confirm the push reported success before verifying"],"tags":["network","registry","verification"],"backgroundTag":"registry-manifest-fetch-failed","analyzedSha":"81940d17fa112cc678e32209214bcb2355cb3004","analyzedAt":"2026-08-31T23:06:12.682Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}