{"record":{"id":"5360048beaf65446","repo":"docker/cli","slug":"error-mounting-s-to-s","errorCode":null,"errorMessage":"error mounting %s to %s","messagePattern":"error mounting (.+?) to (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/manifest/push.go","lineNumber":284,"sourceCode":"func pushReferences(ctx context.Context, out io.Writer, client registryclient.RegistryClient, mounts []mountRequest) error {\n\tfor _, mount := range mounts {\n\t\tnewDigest, err := client.PutManifest(ctx, mount.ref, mount.manifest)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, _ = fmt.Fprintf(out, \"Pushed ref %s with digest: %s\\n\", mount.ref, newDigest)\n\t}\n\treturn nil\n}\n\nfunc mountBlobs(ctx context.Context, client registryclient.RegistryClient, ref reference.Named, blobs []manifestBlob) error {\n\tfor _, blob := range blobs {\n\t\terr := client.MountBlob(ctx, blob.canonical, ref)\n\t\tswitch err.(type) {\n\t\tcase nil:\n\t\tcase registryclient.ErrBlobCreated:\n\t\t\tif blob.os != \"windows\" {\n\t\t\t\treturn fmt.Errorf(\"error mounting %s to %s\", blob.canonical, ref)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":266,"sourceCodeEnd":292,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/command/manifest/push.go#L266-L292","documentation":"Returned by `mountBlobs` (push.go:278-285) when a cross-repo blob mount returns `registryclient.ErrBlobCreated` for a blob whose platform OS is NOT windows. ErrBlobCreated means the blob wasn't already present and had to be created/mounted; for non-windows blobs this is treated as a push failure because the blob should have been pre-pushed to the target repo. Windows is excepted because foreign-layer cross-mounting is expected.","triggerScenarios":"Pushing a manifest list that references cross-repo source images where the underlying layers are not yet present in the target repository on a non-windows platform, and the registry creates the blob mount rather than finding it.","commonSituations":"Cross-repo manifest-list push where the source images' layers were never pushed to the target repo, or an registry that doesn't support blob-by-mount and reports ErrBlobCreated.","solutions":["Pre-push the source images (or their layers) to the target repository first.","Re-run the push after the layers exist in the target repo.","Confirm the target registry supports cross-repo blob mounting.","If genuinely a Windows target, ensure the platform OS is set to windows so the exception applies."],"exampleFix":"# before\ndocker manifest create reg.io/mylist reg.io/source:tag\ndocker manifest push reg.io/mylist   # non-windows layer mount failed\n# after\ndocker push reg.io/source:tag        # ensure layers exist in repo\ndocker manifest push reg.io/mylist","handlingStrategy":"validation","validationCode":"// ensure target repo already has the layers before manifest-list push\nfor _, blob := range requiredBlobs {\n    exists, err := registryClient.BlobExists(ctx, targetRepo, blob.digest)\n    if err != nil || !exists {\n        return fmt.Errorf(\"layer %s not in target repo; push the source image first\", blob.digest)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := runPush(ctx, cli, opts); err != nil {\n    if strings.Contains(err.Error(), \"error mounting\") {\n        // pre-push source layers, then retry\n        return pushSourceLayersThenRetry(manifests, targetRef)\n    }\n    return err\n}","preventionTips":["Pre-push source images into the target repo before manifest-list push.","Confirm the registry supports cross-repo blob mount.","For Windows-only lists, set platform OS to windows to use the exception."],"tags":["manifest","push","blob-mount","cross-repo","registry","docker-cli"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}