phacility/phabricator · error · PhutilArgumentUsageException

Too many arguments: expected one key.

Error message

Too many arguments: expected one key.

What it means

Usage guard in the config delete CLI workflow: fires when more than one positional argument was passed. Only a single configuration key may be deleted per invocation, so the first argument is taken as the key and any extras abort the run.

Solutions

  1. Run the command once per key with a single argument
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php:38 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/cc6ba64fab9f6c5f. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php:38

            'name'      => 'args',
            'wildcard'  => true,
          ),
        ));
  }

  public function execute(PhutilArgumentParser $args) {
    $console = PhutilConsole::getConsole();

    $argv = $args->getArg('args');
    if (count($argv) == 0) {
      throw new PhutilArgumentUsageException(
        pht('Specify a configuration key to delete.'));
    }

    $key = $argv[0];

    if (count($argv) > 1) {
      throw new PhutilArgumentUsageException(
        pht('Too many arguments: expected one key.'));
    }


    $use_database = $args->getArg('database');
    if ($use_database) {
      $config = new PhabricatorConfigDatabaseSource('default');
      $config_type = 'database';
    } else {
      $config = new PhabricatorConfigLocalSource();
      $config_type = 'local';
    }
    $values = $config->getKeys(array($key));
    if (!$values) {
      throw new PhutilArgumentUsageException(
        pht(
          "Configuration key '%s' is not set in %s configuration!",
          $key,

View on GitHub (pinned to 5720a38cfe)