{"record":{"id":"f2eb41b5cda0fab9","repo":"phacility/phabricator","slug":"no-key-type-s-exists","errorCode":null,"errorMessage":"No key type \"%s\" exists.","messagePattern":"No key type \"(.+?)\" exists\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/files/management/PhabricatorFilesManagementGenerateKeyWorkflow.php","lineNumber":31,"sourceCode":"          array(\n            'name' => 'type',\n            'param' => 'keytype',\n            'help' => pht('Select the type of key to generate.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $type = $args->getArg('type');\n    if (!strlen($type)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify the type of key to generate with --type.'));\n    }\n\n    $format = PhabricatorFileStorageFormat::getFormat($type);\n    if (!$format) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'No key type \"%s\" exists.',\n          $type));\n    }\n\n    if (!$format->canGenerateNewKeyMaterial()) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Storage format \"%s\" can not generate keys.',\n          $format->getStorageFormatName()));\n    }\n\n    $material = $format->generateNewKeyMaterial();\n\n    $structure = array(\n      'name' => 'generated-key-'.Filesystem::readRandomCharacters(12),\n      'type' => $type,\n      'material.base64' => $material,","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/management/PhabricatorFilesManagementGenerateKeyWorkflow.php#L13-L49","documentation":"Lookup guard in the generate-key workflow: PhabricatorFileStorageFormat::getFormat($type) returned null, so the requested --type does not correspond to any registered storage format/key type. The value passed on the command line is not a known format name.","triggerScenarios":"Thrown at src/applications/files/management/PhabricatorFilesManagementGenerateKeyWorkflow.php:31 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List available format names and use one of them for --type","Check for typos in the key type argument"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","contentChangedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}