phacility/phabricator · error · PhutilArgumentUsageException

No trigger exists with id "%s"!

Error message

No trigger exists with id "%s"!

What it means

Thrown by trigger management workflows when a requested `--id` does not correspond to an existing PhabricatorWorkerTrigger row. The workflow executes PhabricatorWorkerTriggerQuery with `needEvents(true)` and maps results by ID; every requested ID must appear or the command aborts. Triggers are calendar/subscription scheduling records, and deleted or never-existing IDs fail here.

Source

Thrown at src/infrastructure/daemon/workers/management/PhabricatorWorkerTriggerManagementWorkflow.php:33

  }

  protected function loadTriggers(PhutilArgumentParser $args) {
    $ids = $args->getArg('id');
    if (!$ids) {
      throw new PhutilArgumentUsageException(
        pht('Use %s to select triggers by ID.', '--id'));
    }

    $triggers = id(new PhabricatorWorkerTriggerQuery())
      ->setViewer($this->getViewer())
      ->withIDs($ids)
      ->needEvents(true)
      ->execute();
    $triggers = mpull($triggers, null, 'getID');

    foreach ($ids as $id) {
      if (empty($triggers[$id])) {
        throw new PhutilArgumentUsageException(
          pht('No trigger exists with id "%s"!', $id));
      }
    }

    return $triggers;
  }

  protected function describeTrigger(PhabricatorWorkerTrigger $trigger) {
    return pht('Trigger %d', $trigger->getID());
  }

}

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. List valid trigger IDs from the `worker_trigger` table and re-run with an existing ID
  2. If the trigger was deleted, regenerate it via the owning feature (e.g. re-save the subscription/calendar) instead of forcing execution

Example fix

# before
./bin/worker trigger execute --id 999

# after
./bin/worker trigger execute --id 7   # 7 confirmed in worker_trigger table
Defensive patterns

Strategy: validation

Validate before calling

// Verify trigger rows exist before acting
$rows = queryfx_all(
  $conn,
  'SELECT id FROM %T WHERE id IN (%Ld)',
  'worker_trigger',
  $trigger_ids);
$existing = mpull($rows, null, 'id');
$missing = array_diff($trigger_ids, array_keys($existing));
if ($missing) {
  // skip or report missing triggers instead of failing the whole command
}

Prevention

When it happens

Trigger: `./bin/worker trigger execute --id 999` where no trigger 999 exists; an ID recycled from a previous install; a trigger deleted by its owning object (e.g. a subscription) between observation and invocation.

Common situations: Stale IDs copied from old output or documentation; scripts replaying recorded trigger IDs against a refreshed database; typo'd IDs.

Related errors


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