phacility/phabricator · warning · PhutilArgumentUsageException

Name one or more buildables to publish, like "B123".

Error message

Name one or more buildables to publish, like "B123".

What it means

Usage error from `bin harbormaster publish`: the command republishes (finalizes) buildables, and at least one buildable name (monogram like B123 or a PHID) must be given as wildcard arguments. An empty argument list fails here immediately.

Source

Thrown at src/applications/harbormaster/management/HarbormasterManagementPublishWorkflow.php:28

      ->setSynopsis(
        pht(
          'Publish a buildable. This is primarily useful for developing '.
          'and debugging applications which have buildable objects.'))
      ->setArguments(
        array(
          array(
            'name' =>  'buildable',
            'wildcard' => true,
          ),
        ));
  }

  public function execute(PhutilArgumentParser $args) {
    $viewer = $this->getViewer();

    $buildable_names = $args->getArg('buildable');
    if (!$buildable_names) {
      throw new PhutilArgumentUsageException(
        pht(
          'Name one or more buildables to publish, like "B123".'));
    }

    $query = id(new PhabricatorObjectQuery())
      ->setViewer($viewer)
      ->withNames($buildable_names);

    $query->execute();

    $result_map = $query->getNamedResults();

    foreach ($buildable_names as $name) {
      if (!isset($result_map[$name])) {
        throw new PhutilArgumentUsageException(
          pht(
            'Argument "%s" does not name a buildable. Provide one or more '.
            'valid buildable monograms or PHIDs.',

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Pass one or more buildable monograms/PHIDs: `./bin/phabricator harbormaster publish B123 B124`.
  2. Guard automation: skip the call when the computed name list is empty.

Example fix

# before
./bin/phabricator harbormaster publish

# after
./bin/phabricator harbormaster publish B123
Defensive patterns

Strategy: validation

Validate before calling

if (count($buildable_names) === 0) {
  fwrite(STDERR, "Name one or more buildables to publish, like B123.\n");
  exit(64);
}

Try / catch

try {
  runPublishWorkflow($args);
} catch (PhutilArgumentUsageException $e) {
  fwrite(STDERR, $e->getMessage()."\n");
  exit(64);
}

Prevention

When it happens

Trigger: Running `harbormaster publish` with no arguments; a wrapper/cron line where the variable holding names expands to nothing because the preceding query returned no results.

Common situations: Automation that derives buildable names dynamically and runs the command unconditionally, even when the list is empty.

Related errors


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