{"record":{"id":"3da1aff2f6ea2ae6","repo":"phacility/phabricator","slug":"owner-rule-value-should-be-a-list-but-is-not-val","errorCode":null,"errorMessage":"Owner rule value should be a list, but is not (value is \"%s\").","messagePattern":"Owner rule value should be a list, but is not \\(value is \"(.+?)\"\\)\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php","lineNumber":26,"sourceCode":"  public function getSelectControlName() {\n    return pht('Assign task to');\n  }\n\n  protected function getValueForEditorField() {\n    return $this->getDatasource()->getWireTokens($this->getValue());\n  }\n\n  private function convertTokenizerValueToOwner($value) {\n    $value = head($value);\n    if ($value === PhabricatorPeopleNoOwnerDatasource::FUNCTION_TOKEN) {\n      $value = null;\n    }\n    return $value;\n  }\n\n  protected function assertValidRuleRecordFormat($value) {\n    if (!is_array($value)) {\n      throw new Exception(\n        pht(\n          'Owner rule value should be a list, but is not (value is \"%s\").',\n          phutil_describe_type($value)));\n    }\n  }\n\n  protected function assertValidRuleRecordValue($value) {\n    if (!$value) {\n      throw new Exception(\n        pht(\n          'Owner rule value is required. Specify a user to assign tasks '.\n          'to, or the token \"none()\" to unassign tasks.'));\n    }\n\n    if (count($value) > 1) {\n      throw new Exception(\n        pht(\n          'Owner rule value must have only one elmement (value is \"%s\").',","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php#L8-L44","documentation":"Thrown by assertValidRuleRecordFormat() when the stored value of a 'task.owner' (Assign Owner) trigger rule is not an array. The check runs in PhabricatorProjectTriggerRule::setRecord() on every load of the rule record, because downstream code (convertTokenizerValueToOwner) calls head($value) and expects a list produced by the tokenizer control.","triggerScenarios":"Any load of a trigger whose task.owner rule has a scalar value, e.g. value = \"PHID-USER-abc\" or null instead of [\"PHID-USER-abc\"]. Opening a workboard column with such a trigger, or editing the trigger, hits setRecord() and throws.","commonSituations":"Corrupt or hand-edited value column, records written by a migration/import that used a single PHID string, or a custom rule writer that skipped the tokenizer wire format.","solutions":["Check the rule record: SELECT * FROM phabricator_project_trigger_rule_record WHERE type='task.owner'; the value must be a JSON array.","Rewrite the value as a one-element array, e.g. [\"PHID-USER-abc\"] or [\"none()\"], through the trigger editor or a repair script.","Fix any import/migration code so owner values are always emitted as arrays.","Verify by reloading the workboard or trigger page."],"exampleFix":"// before\n$value = 'PHID-USER-abc';\n\n// after\n$value = array('PHID-USER-abc');","handlingStrategy":"type-guard","validationCode":"// Before writing a task.owner rule record value:\nif (!is_array($value) || count($value) !== 1) {\n  throw new InvalidArgumentException(\n    'owner value must be a one-element list of a user PHID or \"none()\"');\n}","typeGuard":"function isOwnerRuleValue($value) {\n  return is_array($value) && count($value) === 1\n    && (preg_match('/^PHID-USER-/', $value[0]) || $value[0] === 'none()');\n}","tryCatchPattern":"try {\n  $rule->setRecord($record);\n} catch (Exception $ex) {\n  phlog('Corrupt task.owner trigger record '.$record->getID());\n  // skip this rule, continue rendering the board\n}","preventionTips":["Owner values come from the user tokenizer: never hand-build them as scalars.","In migrations, wrap value emission with is_array checks per rule type.","Unit-test setRecord() with representative values for each TRIGGERTYPE."],"tags":["php","phabricator","project-triggers","workboard","data-corruption"],"backgroundTag":"stored-config-validation-failed","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}