phacility/phabricator · error · Exception
Task priority value ("%s") is not a valid task priority. Val
Error message
Task priority value ("%s") is not a valid task priority. Valid priorities are: %s. What it means
Thrown by assertValidRuleRecordValue() for the 'task.priority' rule when the stored keyword is not a key of ManiphestTaskPriority::getTaskPriorityMap(). This is save/re-validation time: the rule points at a priority that no longer exists in this install's configuration.
Source
Thrown at src/applications/project/trigger/PhabricatorProjectTriggerManiphestPriorityRule.php:24
const TRIGGERTYPE = 'task.priority';
public function getSelectControlName() {
return pht('Change priority to');
}
protected function assertValidRuleRecordFormat($value) {
if (!is_string($value)) {
throw new Exception(
pht(
'Priority rule value should be a string, but is not (value is "%s").',
phutil_describe_type($value)));
}
}
protected function assertValidRuleRecordValue($value) {
$map = ManiphestTaskPriority::getTaskPriorityMap();
if (!isset($map[$value])) {
throw new Exception(
pht(
'Task priority value ("%s") is not a valid task priority. '.
'Valid priorities are: %s.',
$value,
implode(', ', array_keys($map))));
}
}
protected function newDropTransactions($object, $value) {
$value = ManiphestTaskPriority::getKeywordForTaskPriority($value);
return array(
$this->newTransaction()
->setTransactionType(ManiphestTaskPriorityTransaction::TRANSACTIONTYPE)
->setNewValue($value),
);
}
protected function newDropEffects($value) {View on GitHub (pinned to 5720a38cfe)
Solutions
- Read the error text: it lists all valid priority keywords for this install.
- Re-open the trigger editor and pick one of the currently valid priorities, then save.
- If the keyword was removed by a config change, either restore it in maniphest.custom-priorities or retarget every affected trigger.
- Audit other rules of type task.priority: SELECT * FROM phabricator_project_trigger_rule_record WHERE type='task.priority'; and align values with the map.
Example fix
// before (keyword no longer defined) $value = '25'; // after (a key of ManiphestTaskPriority::getTaskPriorityMap()) $value = '20';
Defensive patterns
Strategy: validation
Validate before calling
// Before saving:
$map = ManiphestTaskPriority::getTaskPriorityMap();
if (!isset($map[$value])) {
throw new Exception('Invalid priority; valid: '.implode(', ', array_keys($map)));
} Type guard
function isValidPriorityKeyword($value) {
return is_string($value)
&& array_key_exists($value, ManiphestTaskPriority::getTaskPriorityMap());
} Try / catch
$ex = $rule->getRuleRecordValueValidationException();
if ($ex) { /* show message listing valid priorities in editor */ } Prevention
- Re-validate task.priority triggers after changing maniphest.custom-priorities.
- Select priorities from the editor dropdown, never free-typed keywords.
- Keep priority keywords stable across config revisions or write a migration.
When it happens
Trigger: A trigger stores priority keyword '25' but the install's maniphest.custom-priorities config removed/rekeyed it; saving or validating the trigger throws, listing the currently valid keywords. Also hit when a hand-built record uses an invented keyword.
Common situations: An admin edited maniphest.custom-priorities (renamed or dropped a priority) after triggers were configured; triggers migrated from another instance with different priority config; typo in a scripted value.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Task status value ("%s") is not a valid task status. Valid s
- Add project rule value should be a list, but is not (value i
- You must select at least one project tag to add.
- Owner rule value should be a list, but is not (value is "%s"
- Owner rule value is required. Specify a user to assign tasks
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/221cd7474b5c25b9.
Report an issue: GitHub.