phacility/phabricator · warning · PhutilArgumentUsageException

Specify one or more objects to destroy.

Error message

Specify one or more objects to destroy.

What it means

PhabricatorSystemRemoveDestroyWorkflow (bin/remove destroy) takes one or more object names as wildcard positional arguments. execute() throws PhutilArgumentUsageException when the objects argument list is empty; no query or destruction is attempted.

Source

Thrown at src/applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php:29

      ->setArguments(
        array(
          array(
            'name' => 'force',
            'help' => pht('Destroy objects without prompting.'),
          ),
          array(
            'name' => 'objects',
            'wildcard' => true,
          ),
        ));
  }

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

    $object_names = $args->getArg('objects');
    if (!$object_names) {
      throw new PhutilArgumentUsageException(
        pht('Specify one or more objects to destroy.'));
    }

    $object_query = id(new PhabricatorObjectQuery())
      ->setViewer($this->getViewer())
      ->withNames($object_names);

    $object_query->execute();

    $named_objects = $object_query->getNamedResults();
    foreach ($object_names as $object_name) {
      if (empty($named_objects[$object_name])) {
        throw new PhutilArgumentUsageException(
          pht('No such object "%s" exists!', $object_name));
      }
    }

    foreach ($named_objects as $object_name => $object) {

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Pass at least one object name: ./bin/remove destroy T123
  2. If scripting, guard so the command only runs when the names list is non-empty
  3. Check the command's argument spec (phutil executable workflow) when automating

Example fix

# before
./bin/remove destroy

# after
./bin/remove destroy T123
Defensive patterns

Strategy: validation

Validate before calling

# bash wrapper: refuse to invoke with no names
if [ -z "$1" ]; then
  echo "no object names supplied" >&2
  exit 1
fi
./bin/remove destroy "$@"

Prevention

When it happens

Trigger: Running ./bin/remove destroy with no positional object names (monograms or PHIDs), typically because a shell variable holding the names expanded to nothing.

Common situations: Scripts where the names array is empty due to an upstream filter; invoking the command expecting an interactive object picker that does not exist.

Related errors


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