{"record":{"id":"19ae119e6927938c","repo":"getsops/sops","slug":"could-not-read-passphrase-for-q-v","errorCode":null,"errorMessage":"could not read passphrase for %q: %v","messagePattern":"could not read passphrase for %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"age/ssh_parse.go","lineNumber":70,"sourceCode":"\t}\n\tdefer keyFile.Close()\n\tcontents, err := io.ReadAll(keyFile)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read file: %w\", err)\n\t}\n\tid, err := agessh.ParseIdentity(contents)\n\tif sshErr, ok := err.(*ssh.PassphraseMissingError); ok {\n\t\tpubKey := sshErr.PublicKey\n\t\tif pubKey == nil {\n\t\t\tpubKey, err = readPublicKeyFile(keyPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tpassphrasePrompt := func() ([]byte, error) {\n\t\t\tpass, err := pluginTerminalUI.RequestValue(\"\", fmt.Sprintf(\"Enter passphrase for %q:\", keyPath), true)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"could not read passphrase for %q: %v\", keyPath, err)\n\t\t\t}\n\t\t\treturn []byte(pass), nil\n\t\t}\n\t\ti, err := agessh.NewEncryptedSSHIdentity(pubKey, contents, passphrasePrompt)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not create encrypted SSH identity: %w\", err)\n\t\t}\n\t\treturn i, nil\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"malformed SSH identity in %q: %w\", keyPath, err)\n\t}\n\treturn id, nil\n}\n","sourceCodeStart":52,"sourceCodeEnd":85,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/age/ssh_parse.go#L52-L85","documentation":"Error \"could not read passphrase for %q: %v\" thrown in getsops/sops.","triggerScenarios":"Thrown at age/ssh_parse.go:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"13442bb98183887d7a9ac09ec8ab0564673a59d8","analyzedAt":"2026-09-01T03:53:00.447Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}