phacility/phabricator · error · PhutilArgumentUsageException

Specify the type of key to generate with --type.

Error message

Specify the type of key to generate with --type.

What it means

Error "Specify the type of key to generate with --type." thrown in phacility/phabricator.

Source

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

  protected function didConstruct() {
    $this
      ->setName('generate-key')
      ->setSynopsis(
        pht('Generate an encryption key.'))
      ->setArguments(
        array(
          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()));
    }

View on GitHub (pinned to 5720a38cfe)

When it happens

Trigger: Thrown at src/applications/files/management/PhabricatorFilesManagementGenerateKeyWorkflow.php:24 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/c7ed7525cb19a6c4. Report an issue: GitHub.