phacility/phabricator · error · PhabricatorProjectTriggerCorruptionException

Trigger ruleset is corrupt: expected a list of rule…

Error message

Trigger ruleset is corrupt: expected a list of rule specifications, found "%s".

What it means

Corruption detection in PhabricatorProjectTrigger::newTriggerRulesFromRuleSpecifications: the stored trigger ruleset data is not a PHP list (its actual type is interpolated), so the rules cannot even be enumerated. Callers can pass allow_invalid to degrade to placeholder rules instead.

Solutions

  1. Repair the trigger's stored rule data by editing and re-saving the trigger.
  2. Inspect and correct the ruleset stored for the affected trigger row.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/applications/project/storage/PhabricatorProjectTrigger.php:131 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/8305285d3fe38bf4. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/project/storage/PhabricatorProjectTrigger.php:131

    // When they do, we still want the UI to reflect the ruleset state
    // accurately and "Edit" + "Save" shouldn't destroy data unless the
    // user explicitly modifies the ruleset.

    // In this mode, when we run into rules which are structured correctly but
    // which have types we don't know about, we replace them with "Unknown
    // Rules". If we know about the type of a rule but the value doesn't
    // validate, we replace it with "Invalid Rules". These two rule types don't
    // take any actions when a card is dropped into the column, but they show
    // the user what's wrong with the ruleset and can be saved without causing
    // any collateral damage.

    $rule_map = PhabricatorProjectTriggerRule::getAllTriggerRules();

    // If the stored rule data isn't a list of rules (or we encounter other
    // fundamental structural problems, below), there isn't much we can do
    // to try to represent the state.
    if (!is_array($list)) {
      throw new PhabricatorProjectTriggerCorruptionException(
        pht(
          'Trigger ruleset is corrupt: expected a list of rule '.
          'specifications, found "%s".',
          phutil_describe_type($list)));
    }

    $trigger_rules = array();
    foreach ($list as $key => $rule) {
      if (!is_array($rule)) {
        throw new PhabricatorProjectTriggerCorruptionException(
          pht(
            'Trigger ruleset is corrupt: rule (at index "%s") should be a '.
            'rule specification, but is actually "%s".',
            $key,
            phutil_describe_type($rule)));
      }

      try {

View on GitHub (pinned to 5720a38cfe)