{"record":{"id":"3ece21b5e918ab33","repo":"phacility/phabricator","slug":"this-rule-was-created-with-a-newer-version-of-hera","errorCode":null,"errorMessage":"This rule was created with a newer version of Herald. You can not view or edit it in this older version. Upgrade your software.","messagePattern":"This rule was created with a newer version of Herald\\. You can not view or edit it in this older version\\. Upgrade your software\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/herald/controller/HeraldRuleController.php","lineNumber":108,"sourceCode":"        if (!$adapter->canTriggerOnObject($object)) {\n          throw new Exception(\n            pht('Object is of wrong type for adapter!'));\n        }\n      }\n\n      $cancel_uri = $this->getApplicationURI();\n    }\n\n    if ($rule->isGlobalRule()) {\n      $this->requireApplicationCapability(\n        HeraldManageGlobalRulesCapability::CAPABILITY);\n    }\n\n    $adapter = HeraldAdapter::getAdapterForContentType($rule->getContentType());\n\n    $local_version = id(new HeraldRule())->getConfigVersion();\n    if ($rule->getConfigVersion() > $local_version) {\n      throw new Exception(\n        pht(\n          'This rule was created with a newer version of Herald. You can not '.\n          'view or edit it in this older version. Upgrade your software.'));\n    }\n\n    // Upgrade rule version to our version, since we might add newly-defined\n    // conditions, etc.\n    $rule->setConfigVersion($local_version);\n\n    $rule_conditions = $rule->loadConditions();\n    $rule_actions = $rule->loadActions();\n\n    $rule->attachConditions($rule_conditions);\n    $rule->attachActions($rule_actions);\n\n    $e_name = true;\n    $errors = array();\n    if ($request->isFormPost() && $request->getStr('save')) {","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/herald/controller/HeraldRuleController.php#L90-L126","documentation":"Thrown by HeraldRuleController when a rule's stored config version (HeraldRule::getConfigVersion()) is greater than the version this install knows (the default on a fresh HeraldRule). Herald bumps the rule config version when the storage format for conditions/actions changes; a rule written by a NEWER Phabricator cannot be safely interpreted by an OLDER one, so viewing or editing is blocked outright.","triggerScenarios":"Opening /herald/view/ or /herald/edit/ for a rule whose config_version column is higher than the current install's HeraldRule default. Happens after downgrading Phabricator, restoring a database dump from a newer version onto older code, running a replica pair with mixed versions, or after restoring backups across version boundaries.","commonSituations":"Downgrade or partial upgrade: web frontends on different Phabricator versions sharing one database. Restoring a production DB dump into an older development environment. This is a guard against data corruption, not a rule-content bug — the fix is at the install level, not the rule level.","solutions":["Upgrade Phabricator (and phutil/libphutil) to a version at least as new as the one that wrote the rule, then reload.","If you restored a dump from a newer version, upgrade that environment rather than hand-editing config_version.","Ensure ALL web/daemon hosts point at code of the same version when sharing a database (mixed-version frontends cause intermittent occurrences).","As a last resort on a scratch copy, set the rule's config_version back to the local default — but only on data you are willing to corrupt, since conditions/actions may decode incorrectly."],"exampleFix":"// before — mixed-version cluster\nweb-1: phabricator 2021.x  (newer, wrote rule, config_version = 27)\nweb-2: phabricator 2020.x  (older, local version  = 26)  -> throws\n\n// after\n# upgrade every host to the same (newest) release\ngit -C phabricator pull origin stable && git -C arcanist pull origin stable\n# on all web/daemon hosts, then reload the rule","handlingStrategy":"validation","validationCode":"// Gate rules by config version before opening them for edit/view\n$local_version = id(new HeraldRule())->getConfigVersion();\nif ($rule->getConfigVersion() > $local_version) {\n  // show 'upgrade required' notice; do NOT proceed to loadConditions()\n}","typeGuard":"function ruleIsViewableInThisInstall(HeraldRule $rule) {\n  return $rule->getConfigVersion() <= id(new HeraldRule())->getConfigVersion();\n}","tryCatchPattern":"try {\n  // handling a rule view/edit request\n} catch (Exception $ex) {\n  if (strpos($ex->getMessage(), 'newer version of Herald') !== false) {\n    // render an upgrade-required page instead of a stack trace\n  }\n}","preventionTips":["Run all web fronts and daemons against the same Phabricator checkout sharing a database.","After restoring a dump from a newer version, upgrade code first, then browse.","Monitor rule config_version max vs local default after every upgrade/downgrade."],"tags":["herald","phabricator","php","version-skew","upgrade","config-version","database-restore"],"backgroundTag":"config-version-mismatch","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}