{"record":{"id":"bd78f3dd53ad223b","repo":"phacility/phabricator","slug":"storage-format-s-can-not-generate-keys","errorCode":null,"errorMessage":"Storage format \"%s\" can not generate keys.","messagePattern":"Storage format \"(.+?)\" can not generate keys\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/files/management/PhabricatorFilesManagementGenerateKeyWorkflow.php","lineNumber":38,"sourceCode":"\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,\n    );\n\n    $json = id(new PhutilJSON())->encodeFormatted($structure);\n\n    echo tsprintf(\n      \"%s: %s\\n\\n%B\\n\",\n      pht('Key Material'),","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/management/PhabricatorFilesManagementGenerateKeyWorkflow.php#L20-L56","documentation":"Error \"Storage format \"%s\" can not generate keys.\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/files/management/PhabricatorFilesManagementGenerateKeyWorkflow.php:38 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":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}