{"id":"1dbd2af4bfbe7935","repo":"docker/cli","slug":"failed-to-sign-s-s-w-1dbd2a","errorCode":null,"errorMessage":"failed to sign %s:%s: %w","messagePattern":"failed to sign (.+?):(.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/docker-trust/trust/sign.go","lineNumber":129,"sourceCode":"\t\t}\n\t}\n\treturn signAndPublishToTarget(dockerCLI.Out(), imgRefAndAuth, notaryRepo, target)\n}\n\nfunc signAndPublishToTarget(out io.Writer, imgRefAndAuth trust.ImageRefAndAuth, notaryRepo notaryclient.Repository, target notaryclient.Target) error {\n\ttag := imgRefAndAuth.Tag()\n\t_, _ = fmt.Fprintln(out, \"Signing and pushing trust metadata for\", imgRefAndAuth.Name())\n\texistingSigInfo, err := getExistingSignatureInfoForReleasedTag(notaryRepo, tag)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = trust.AddToAllSignableRoles(notaryRepo, &target)\n\tif err == nil {\n\t\tprettyPrintExistingSignatureInfo(out, existingSigInfo)\n\t\terr = notaryRepo.Publish()\n\t}\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to sign %s:%s: %w\", imgRefAndAuth.RepoInfo().Name.Name(), tag, err)\n\t}\n\t_, _ = fmt.Fprintf(out, \"Successfully signed %s:%s\\n\", imgRefAndAuth.RepoInfo().Name.Name(), tag)\n\treturn nil\n}\n\nfunc validateTag(imgRefAndAuth trust.ImageRefAndAuth) error {\n\ttag := imgRefAndAuth.Tag()\n\tif tag == \"\" {\n\t\tif imgRefAndAuth.Digest() != \"\" {\n\t\t\treturn errors.New(\"cannot use a digest reference for IMAGE:TAG\")\n\t\t}\n\t\treturn fmt.Errorf(\"no tag specified for %s\", imgRefAndAuth.Name())\n\t}\n\treturn nil\n}\n\nfunc checkLocalImageExistence(ctx context.Context, apiClient client.APIClient, imageName string) error {\n\t_, err := apiClient.ImageInspect(ctx, imageName)","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cmd/docker-trust/trust/sign.go#L111-L147","documentation":"Error \"failed to sign %s:%s: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cmd/docker-trust/trust/sign.go:129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}