phacility/phabricator · error · PhutilArgumentUsageException

No key type " " exists.

Error message

No key type "%s" exists.

What it means

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.

Solutions

  1. List available format names and use one of them for --type
  2. Check for typos in the key type argument
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/files/management/PhabricatorFilesManagementGenerateKeyWorkflow.php:31 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/f2eb41b5cda0fab9. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/files/management/PhabricatorFilesManagementGenerateKeyWorkflow.php:31

          array(
            'name' => 'type',
            'param' => 'keytype',
            'help' => pht('Select the type of key to generate.'),
          ),
        ));
  }

  public function execute(PhutilArgumentParser $args) {
    $type = $args->getArg('type');
    if (!strlen($type)) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify the type of key to generate with --type.'));
    }

    $format = PhabricatorFileStorageFormat::getFormat($type);
    if (!$format) {
      throw new PhutilArgumentUsageException(
        pht(
          'No key type "%s" exists.',
          $type));
    }

    if (!$format->canGenerateNewKeyMaterial()) {
      throw new PhutilArgumentUsageException(
        pht(
          'Storage format "%s" can not generate keys.',
          $format->getStorageFormatName()));
    }

    $material = $format->generateNewKeyMaterial();

    $structure = array(
      'name' => 'generated-key-'.Filesystem::readRandomCharacters(12),
      'type' => $type,
      'material.base64' => $material,

View on GitHub (pinned to 5720a38cfe)