phacility/phabricator · error · Exception
Task status value ("%s") is not a valid task status. Valid s
Error message
Task status value ("%s") is not a valid task status. Valid statues are: %s. What it means
Thrown by assertValidRuleRecordValue() for the 'task.status' rule when the stored value is not a key of ManiphestTaskStatus::getTaskStatusMap(). The rule targets a status that does not exist on this install (the message's 'statues' is an upstream typo for 'statuses'). Validation runs at trigger save and when rules are re-checked.
Source
Thrown at src/applications/project/trigger/PhabricatorProjectTriggerManiphestStatusRule.php:24
const TRIGGERTYPE = 'task.status';
public function getSelectControlName() {
return pht('Change status to');
}
protected function assertValidRuleRecordFormat($value) {
if (!is_string($value)) {
throw new Exception(
pht(
'Status rule value should be a string, but is not (value is "%s").',
phutil_describe_type($value)));
}
}
protected function assertValidRuleRecordValue($value) {
$map = ManiphestTaskStatus::getTaskStatusMap();
if (!isset($map[$value])) {
throw new Exception(
pht(
'Task status value ("%s") is not a valid task status. '.
'Valid statues are: %s.',
$value,
implode(', ', array_keys($map))));
}
}
protected function newDropTransactions($object, $value) {
return array(
$this->newTransaction()
->setTransactionType(ManiphestTaskStatusTransaction::TRANSACTIONTYPE)
->setNewValue($value),
);
}
protected function newDropEffects($value) {
$status_name = ManiphestTaskStatus::getTaskStatusName($value);View on GitHub (pinned to 5720a38cfe)
Solutions
- Use the valid-key list in the error message.
- Re-edit the trigger and choose a status that exists, then save.
- If a needed status was removed by config, restore it or migrate all task.status trigger records to the replacement.
- Sweep all task.status rule records and remap stale keys.
Example fix
// before (key not in ManiphestTaskStatus::getTaskStatusMap()) $value = 'done'; // after $value = 'resolved';
Defensive patterns
Strategy: validation
Validate before calling
$map = ManiphestTaskStatus::getTaskStatusMap();
if (!isset($map[$value])) {
throw new Exception('Invalid status; valid: '.implode(', ', array_keys($map)));
} Type guard
function isValidStatusKeyword($value) {
return is_string($value)
&& array_key_exists($value, ManiphestTaskStatus::getTaskStatusMap());
} Try / catch
$ex = $rule->getRuleRecordValueValidationException();
if ($ex) { /* render valid-status list in the editor form */ } Prevention
- After editing maniphest.statuses config, audit existing task.status triggers.
- Choose statuses from the dropdown; avoid hand-typed keys.
- When importing triggers, remap status keys against the target map.
When it happens
Trigger: A trigger stores status key 'done' while the map only defines keys like 'open', 'resolved', 'wontfix' (or custom statuses). Saving or re-validating the trigger throws and lists the valid keys. Common after maniphest.statuses config changes or cross-instance imports.
Common situations: Custom status config (maniphest.statuses project option) removed or renamed a status after triggers were created; import from an instance with different status config; typo'd key in scripted records.
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 priority value ("%s") is not a valid task priority. Val
- 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/b3ba4885d8d52b93.
Report an issue: GitHub.