phacility/phabricator · error · Exception
Owner rule value must have only one elmement (value is "%s")
Error message
Owner rule value must have only one elmement (value is "%s").
What it means
Thrown by assertValidRuleRecordValue() for the 'task.owner' rule when the value list contains more than one entry. The rule models a single owner, so after the empty check it enforces count($value) == 1. (Upstream message contains the typo 'elmement'.) This is save-time validation via getRuleRecordValueValidationException().
Source
Thrown at src/applications/project/trigger/PhabricatorProjectTriggerManiphestOwnerRule.php:42
protected function assertValidRuleRecordFormat($value) {
if (!is_array($value)) {
throw new Exception(
pht(
'Owner rule value should be a list, but is not (value is "%s").',
phutil_describe_type($value)));
}
}
protected function assertValidRuleRecordValue($value) {
if (!$value) {
throw new Exception(
pht(
'Owner rule value is required. Specify a user to assign tasks '.
'to, or the token "none()" to unassign tasks.'));
}
if (count($value) > 1) {
throw new Exception(
pht(
'Owner rule value must have only one elmement (value is "%s").',
implode(', ', $value)));
}
$owner_phid = $this->convertTokenizerValueToOwner($value);
if ($owner_phid !== null) {
$user = id(new PhabricatorPeopleQuery())
->setViewer($this->getViewer())
->withPHIDs(array($owner_phid))
->executeOne();
if (!$user) {
throw new Exception(
pht(
'User PHID ("%s") is not a valid user.',
$owner_phid));
}
}View on GitHub (pinned to 5720a38cfe)
Solutions
- Edit the trigger so the owner field contains exactly one entry: one user PHID or the token none().
- Repair the stored record to a one-element array if the editor cannot open it.
- Fix import/migration code to pick a single owner for task.owner rules (they cannot hold a list).
- Split conflicting requirements into separate columns/triggers, since each drop applies one owner.
Example fix
// before
$value = array('PHID-USER-a', 'PHID-USER-b');
// after
$value = array('PHID-USER-a'); Defensive patterns
Strategy: validation
Validate before calling
if (count($value) > 1) {
throw new Exception('Owner rule accepts exactly one value; got '.count($value));
} Type guard
function isSingleOwnerValue($value) {
return is_array($value) && count($value) === 1;
} Try / catch
$ex = $rule->getRuleRecordValueValidationException();
if ($ex) { /* render message in editor; keep first value only */ } Prevention
- Remember task.owner is single-valued even though the UI control looks like a tokenizer.
- When importing, enforce count===1 before writing owner rule records.
- Do not reuse add-projects value arrays for owner rules.
When it happens
Trigger: A task.owner rule whose value array holds 2+ PHIDs, e.g. ['PHID-USER-a','PHID-USER-b'] — typically from a hand-edited record, an import script, or a client that reused an 'Add Projects' style value for the owner rule. Saving or re-validating the trigger throws.
Common situations: Copy-paste of an 'add projects' value shape into an owner rule; migration tooling that mapped a multi-owner field onto the single-owner rule; direct DB writes.
Related errors
- You must select at least one project tag to add.
- Owner rule value is required. Specify a user to assign tasks
- You must select at least one project tag to remove.
- Add project rule value should be a list, but is not (value i
- Owner rule value should be a list, but is not (value is "%s"
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/f262aaaf3de374ac.
Report an issue: GitHub.