{"record":{"id":"12bd6318519670fe","repo":"dagger/dagger","slug":"select-latest-image-tag-for-q-w","errorCode":null,"errorMessage":"select latest image tag for %q: %w","messagePattern":"select latest image tag for %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/schema/container.go","lineNumber":1316,"sourceCode":"\t\t\tdefer detach()\n\n\t\t\tlistCtx, span := core.Tracer(ctx).Start(\n\t\t\t\tctx,\n\t\t\t\tfmt.Sprintf(\"select latest release for %s\", refName.String()),\n\t\t\t\ttelemetry.Internal(),\n\t\t\t\ttelemetry.Encapsulate(),\n\t\t\t)\n\t\t\ttags, err := rslvr.ListImageTags(listCtx, refName.String(), serverresolver.ListImageTagsOpts{\n\t\t\t\tNetwork:           network,\n\t\t\t\tRegistryTransport: registryTransport,\n\t\t\t})\n\t\t\ttelemetry.EndWithCause(span, &err)\n\t\t\tif err != nil {\n\t\t\t\treturn inst, fmt.Errorf(\"failed to list image tags for %q: %w\", refName.String(), err)\n\t\t\t}\n\t\t\tselectedTag, err = core.SelectLatestContainerTag(tags)\n\t\t\tif err != nil {\n\t\t\t\treturn inst, fmt.Errorf(\"select latest image tag for %q: %w\", refName.String(), err)\n\t\t\t}\n\t\t\tif latestResolution.ShouldWrite && lookupLock != nil {\n\t\t\t\tif err := lookupLock.SetLookup(\n\t\t\t\t\tworkspace.CoreLockNamespace,\n\t\t\t\t\tworkspace.LockOperationOCILatest,\n\t\t\t\t\tlatestInputs,\n\t\t\t\t\tselectedTag,\n\t\t\t\t); err != nil {\n\t\t\t\t\treturn inst, fmt.Errorf(\"set lock entry for %s: %w\", workspace.LockOperationOCILatest, err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\trefName, err = reference.WithTag(refName, selectedTag)\n\t\tif err != nil {\n\t\t\treturn inst, fmt.Errorf(\"apply selected image tag %q: %w\", selectedTag, err)\n\t\t}\n\t}\n","sourceCodeStart":1298,"sourceCodeEnd":1334,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/schema/container.go#L1298-L1334","documentation":"Raised when Dagger resolves a floating image reference (e.g. 'alpine:latest' or a bare image name) in Container.from and core.SelectLatestContainerTag fails to pick a tag from the list returned by the registry. This wrapping error indicates the registry returned tags but none could be selected as the latest, typically because the tag list was empty or unparseable. It preserves the underlying cause (e.g. 'no tags found') via %w.","triggerScenarios":"Calling Container.from with a tag-less or 'latest'-style reference whose lock file has no pin, where ListImageTags returns a set of tags from which SelectLatestContainerTag cannot determine a latest tag (empty list, or no tags matching semver/version heuristics).","commonSituations":"Referencing a private or obscure image repository that exists but publishes no listing of tags (some registries restrict tag listing); referencing a repository that has been emptied of tags; mistyping a repository name so an empty mirror repo is queried.","solutions":["Verify the image repository actually has published tags by checking it in the registry UI or with `crane ls <repo>`","Pin the image to an explicit tag (e.g. 'alpine:3.20') so the latest-tag selection path is skipped entirely","Check dagger.lock for a stale/empty oci.latest entry and remove it to force re-resolution","If the registry forbids tag listing APIs, use an explicit tag or digest reference instead"],"exampleFix":"// before\nctr := dag.Container().From(\"myrepo/myapp\")\n// after\nctr := dag.Container().From(\"myrepo/myapp:v1.2.3\")","handlingStrategy":"validation","validationCode":"// Prefer explicit tags; check the repo has tags before using a floating ref\ntags, err := crane.ListTags(\"myrepo/myapp\") // or inspect registry UI\nif err != nil || len(tags) == 0 {\n    return fmt.Errorf(\"repo has no tags; pin an explicit tag\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use explicit version tags in production pipelines","Commit dagger.lock so latest-tag resolution rarely re-runs","Check tag listing works on private registries before relying on 'latest'"],"tags":["container","image-resolution","registry","lockfile"],"backgroundTag":"image-tag-resolution-failed","analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}