{"record":{"id":"8b21b64fcbc8e8e9","repo":"phacility/phabricator","slug":"keyring-configuration-is-not-valid-value-must-be","errorCode":null,"errorMessage":"Keyring configuration is not valid: value must be a list of encryption keys.","messagePattern":"Keyring configuration is not valid: value must be a list of encryption keys\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/files/keyring/PhabricatorKeyringConfigOptionType.php","lineNumber":8,"sourceCode":"<?php\n\nfinal class PhabricatorKeyringConfigOptionType\n  extends PhabricatorConfigJSONOptionType {\n\n  public function validateOption(PhabricatorConfigOption $option, $value) {\n    if (!is_array($value)) {\n      throw new Exception(\n        pht(\n          'Keyring configuration is not valid: value must be a '.\n          'list of encryption keys.'));\n    }\n\n    foreach ($value as $index => $spec) {\n      if (!is_array($spec)) {\n        throw new Exception(\n          pht(\n            'Keyring configuration is not valid: each entry in the list must '.\n            'be a dictionary describing an encryption key, but the value '.\n            'with index \"%s\" is not a dictionary.',\n            $index));\n      }\n    }\n\n\n    $map = array();","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/keyring/PhabricatorKeyringConfigOptionType.php#L1-L26","documentation":"The 'keyring' config option is validated by PhabricatorKeyringConfigOptionType::validateOption(), which requires the JSON value to decode to a PHP array — a list of encryption key dictionaries. This variant is thrown when the top-level value is not an array at all (a JSON scalar such as a string or number). Validation runs when saving the option via the config application or bin/config.","triggerScenarios":"`./bin/config set keyring '\"my-key-material\"'` (bare scalar); pasting only the base64 key string as the option value; any non-JSON-array value submitted for the option.","commonSituations":"First-time keyring setup where the admin pastes just the generated base64 key instead of the documented list-of-dicts structure.","solutions":["Set the option to a JSON list of key dictionaries (see example) using ./bin/config set keyring '...'","Use the web Config UI to save the value, which runs the same validator and shows the error inline before it is stored"],"exampleFix":"# before\n./bin/config set keyring '\"dGhpc2lzMzJieXRlc29ma2V5bWF0ZXJpYWw=\"'\n\n# after\n./bin/config set keyring '[{\"name\":\"prod-2024\",\"type\":\"aes-256-cbc\",\"material.base64\":\"dGhpc2lzMzJieXRlc29ma2V5bWF0ZXJpYWw=\",\"default\":true}]'","handlingStrategy":"validation","validationCode":"// Validate JSON shape locally before saving the option:\n$value = phutil_json_decode($json_string);\nif (!is_array($value)) {\n  // The keyring must be a JSON list of key dictionaries; fix the payload\n  // before ./bin/config set keyring.\n}","typeGuard":"function isKeyringList($value) {\n  return is_array($value);\n}","tryCatchPattern":null,"preventionTips":["Start from the documented list-of-dicts template rather than pasting raw key material","Save keyring config through the web Config UI, which runs validateOption() before persisting"],"tags":["config","json","keyring","validation","phabricator"],"backgroundTag":"config-validation-failed","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}