{"record":{"id":"f626fd38e06d8a08","repo":"FiloSottile/age","slug":"recipient-encodings-not-supported","errorCode":null,"errorMessage":"recipient encodings not supported","messagePattern":"recipient encodings not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/plugin.go","lineNumber":252,"sourceCode":"\n\tif len(recipientStrings)+len(identityStrings) == 0 {\n\t\treturn p.fatalf(\"no recipients or identities provided\")\n\t}\n\tif len(fileKeys) == 0 {\n\t\treturn p.fatalf(\"no file keys provided\")\n\t}\n\n\tvar recipients, identities []age.Recipient\n\tfor i, s := range recipientStrings {\n\t\tname, data, err := ParseRecipient(s)\n\t\tif err != nil {\n\t\t\treturn p.recipientError(i, err)\n\t\t}\n\t\tif name != p.name {\n\t\t\treturn p.recipientError(i, fmt.Errorf(\"unsupported plugin name: %q\", name))\n\t\t}\n\t\tif p.recipient == nil {\n\t\t\treturn p.recipientError(i, fmt.Errorf(\"recipient encodings not supported\"))\n\t\t}\n\t\tr, err := p.recipient(data)\n\t\tif err != nil {\n\t\t\treturn p.recipientError(i, err)\n\t\t}\n\t\trecipients = append(recipients, r)\n\t}\n\tfor i, s := range identityStrings {\n\t\tname, data, err := ParseIdentity(s)\n\t\tif err != nil {\n\t\t\treturn p.identityError(i, err)\n\t\t}\n\t\tif name != p.name {\n\t\t\treturn p.identityError(i, fmt.Errorf(\"unsupported plugin name: %q\", name))\n\t\t}\n\t\tif p.idAsRecipient == nil {\n\t\t\treturn p.identityError(i, fmt.Errorf(\"identity encodings not supported\"))\n\t\t}","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/FiloSottile/age/blob/b74dce4cdbe35b5e5f66c06d9612b72f89028758/plugin/plugin.go#L234-L270","documentation":"RecipientV1 returns this when the plugin's Recipient field is nil, meaning the plugin binary does not implement a recipient-v1 encoding at all. The client sent recipient stanza(s), but this plugin was only built for identities (or nothing). The library cannot wrap the file key, so it fails fast with a per-recipient error naming the offending recipient index.","triggerScenarios":"Running the plugin binary in RecipientV1 mode while the Plugin was constructed without setting Plugin.Recipient; e.g. an age-plugin binary compiled from a main that only registers Identity and calls RecipientV1 as part of generic dispatch.","commonSituations":"A plugin supporting only identity decryption (e.g. a hardware-token plugin) is passed as a -r recipient argument; a plugin refactor renamed the callback and left Recipient nil; wiring the wrong constructor so Recipient was never assigned.","solutions":["Set the Plugin.Recipient callback in the plugin's main before calling RecipientV1","Make the plugin's flag handling reject recipient mode when no Recipient encoding is implemented, with a clear usage message","Update the plugin to a version that supports recipient encodings"],"exampleFix":"// before\np := plugin.New(name, nil, nil)\nos.Exit(p.RecipientV1(os.Stdin, os.Stdout, os.Args...))\n// after\np := plugin.New(name, func(data []byte) (age.Recipient, error) { return parseRecipient(data) }, nil)\nos.Exit(p.RecipientV1(os.Stdin, os.Stdout, os.Args...))","handlingStrategy":"validation","validationCode":"// In the plugin's main, before RecipientV1:\nif p == nil || p.Recipient == nil {\n    fmt.Fprintf(os.Stderr, \"usage: %s does not support recipient encodings\\n\", os.Args[0])\n    os.Exit(1)\n}\n// In the age client/integration, before invoking:\n// out, _ := exec.Command(pluginPath, \"--age-plugin=plugin-v1\").Output(); strings.Contains(string(out), \"recipient-v1\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always wire Plugin.Recipient when building a recipient-capable plugin","Probe the plugin binary with --age-plugin=plugin-v1 to see which modes it supports","Test plugin main flags before shipping"],"tags":["age","plugin","configuration","recipient"],"backgroundTag":"plugin-encoding-not-supported","analyzedSha":"b74dce4cdbe35b5e5f66c06d9612b72f89028758","analyzedAt":"2026-08-31T23:59:31.627Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}