{"record":{"id":"7c16bf0580ac273f","repo":"kubernetes/kops","slug":"failed-to-sign-data-w","errorCode":null,"errorMessage":"failed to sign data: %w","messagePattern":"failed to sign data: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/bootstrap/pkibootstrap/pkisigner.go","lineNumber":145,"sourceCode":"\t\tSignature: signature,\n\t}\n\n\tb, err := json.Marshal(token)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to marshal token: %w\", err)\n\t}\n\treturn AuthenticationTokenPrefix + base64.StdEncoding.EncodeToString(b), nil\n}\n\n// sign performs a TPM signature with the tpmKey, and sanity checks the result.\nfunc (a *pkiAuthenticator) sign(payload []byte) ([]byte, error) {\n\tbeforeSign := time.Now()\n\n\tdigest := sha256.Sum256(payload)\n\n\tsignature, err := a.signer.Sign(cryptorand.Reader, digest[:], crypto.SHA256)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to sign data: %w\", err)\n\t}\n\n\tklog.Infof(\"signing took %v\", time.Since(beforeSign))\n\n\treturn signature, nil\n}\n","sourceCodeStart":127,"sourceCodeEnd":152,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/bootstrap/pkibootstrap/pkisigner.go#L127-L152","documentation":"The low-level sign helper failed: the crypto.Signer returned an error signing the SHA-256 digest, typically a TPM signing failure (handle revoked, session expiry) or an entropy-source problem with the supplied cryptorand.Reader.","triggerScenarios":"Thrown at pkg/bootstrap/pkibootstrap/pkisigner.go:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify TPM/key-provider health and reload the key handle","Restart the process or node to reinitialize the signer","Inspect the wrapped error for provider-specific status codes"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}