{"record":{"id":"a142d29fda25f9d5","repo":"getsops/sops","slug":"an-scrypt-recipient-must-be-the-only-one","errorCode":null,"errorMessage":"an scrypt recipient must be the only one","messagePattern":"an scrypt recipient must be the only one","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"age/encrypted_keys.go","lineNumber":91,"sourceCode":"\t\treturn fmt.Errorf(\"failed to decrypt identity file: %v\", err)\n\t}\n\ti.identities, err = age.ParseIdentities(d)\n\treturn err\n}\n\n// LazyScryptIdentity is an age.Identity that requests a passphrase only if it\n// encounters an scrypt stanza. After obtaining a passphrase, it delegates to\n// ScryptIdentity.\ntype LazyScryptIdentity struct {\n\tPassphrase func() (string, error)\n}\n\nvar _ age.Identity = &LazyScryptIdentity{}\n\nfunc (i *LazyScryptIdentity) Unwrap(stanzas []*age.Stanza) (fileKey []byte, err error) {\n\tfor _, s := range stanzas {\n\t\tif s.Type == \"scrypt\" && len(stanzas) != 1 {\n\t\t\treturn nil, errors.New(\"an scrypt recipient must be the only one\")\n\t\t}\n\t}\n\tif len(stanzas) != 1 || stanzas[0].Type != \"scrypt\" {\n\t\treturn nil, age.ErrIncorrectIdentity\n\t}\n\tpass, err := i.Passphrase()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not read passphrase: %v\", err)\n\t}\n\tii, err := age.NewScryptIdentity(pass)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfileKey, err = ii.Unwrap(stanzas)\n\treturn fileKey, err\n}\n\nfunc unwrapIdentities(location string, reader io.Reader, allowMultipleKeysPerLine bool) (ParsedIdentities, error) {","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/age/encrypted_keys.go#L73-L109","documentation":"Error \"an scrypt recipient must be the only one\" thrown in getsops/sops.","triggerScenarios":"Thrown at age/encrypted_keys.go:91 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"}