phacility/phabricator · error · PhabricatorProjectTriggerCorruptionException

Trigger ruleset is corrupt: rule

Error message

Trigger ruleset is corrupt: rule (at index "%s") should be a rule specification, but is actually "%s".

What it means

Raised via PhabricatorProjectTriggerCorruptionException in newTriggerRulesFromRuleSpecifications: an entry in the stored rule data list is not itself a rule specification array (the index named in the message holds unexpected data). This indicates corrupt or hand-edited trigger rule storage that cannot be interpreted.

Solutions

  1. Edit the trigger and re-save a valid ruleset to overwrite the malformed entry.
  2. Load with allow_invalid so malformed entries become Unknown Rules, then re-save.
Defensive patterns

Strategy: try-catch

When it happens

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

Appendix: source

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

    // 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 {
        PhutilTypeSpec::checkMap(
          $rule,
          array(
            'type' => 'string',
            'value' => 'wild',
          ));
      } catch (PhutilTypeCheckException $ex) {
        throw new PhabricatorProjectTriggerCorruptionException(
          pht(
            'Trigger ruleset is corrupt: rule (at index "%s") is not a '.

View on GitHub (pinned to 5720a38cfe)