{"record":{"id":"404ed23fe32202da","repo":"phacility/phabricator","slug":"configuration-is-not-valid-maniphest-priority-con","errorCode":null,"errorMessage":"Configuration is not valid. Maniphest priority configurations must be dictionaries.","messagePattern":"Configuration is not valid\\. Maniphest priority configurations must be dictionaries\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/maniphest/constants/ManiphestTaskPriority.php","lineNumber":199,"sourceCode":"    krsort($config);\n    return $config;\n  }\n\n  private static function isValidPriorityKeyword($keyword) {\n    if (!strlen($keyword) || strlen($keyword) > 64) {\n      return false;\n    }\n\n    // Alphanumeric, but not exclusively numeric\n    if (!preg_match('/^(?![0-9]*$)[a-zA-Z0-9]+$/', $keyword)) {\n      return false;\n    }\n    return true;\n  }\n\n  public static function validateConfiguration($config) {\n    if (!is_array($config)) {\n      throw new Exception(\n        pht(\n          'Configuration is not valid. Maniphest priority configurations '.\n          'must be dictionaries.'));\n    }\n\n    $all_keywords = array();\n    foreach ($config as $key => $value) {\n      if (!ctype_digit((string)$key)) {\n        throw new Exception(\n          pht(\n            'Key \"%s\" is not a valid priority constant. Priority constants '.\n            'must be nonnegative integers.',\n            $key));\n      }\n\n      if (!is_array($value)) {\n        throw new Exception(\n          pht(","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/maniphest/constants/ManiphestTaskPriority.php#L181-L217","documentation":"ManiphestTaskPriority::validateConfiguration rejects the 'maniphest.priorities' config when its top level is not an array/dict. The whole structure is a map from numeric priority constant (e.g. 90) to a spec dict, so a scalar or a plain list is invalid before any per-key checks run.","triggerScenarios":"Setting maniphest.priorities to a non-map via bin/config, e.g. `bin/config set maniphest.priorities 100` or a JSON array like '[90, 100]' with no keys. The is_array($config) gate throws during the config write.","commonSituations":"Admins migrating a simple priority scale (Unbreak Now / High / Normal / Low ...) assume a list of numbers or a single max value is enough. Pasting JSON where the top-level braces were lost (a bare list of name strings) also lands here. This error masks the finer-grained per-key errors that follow once a real dict is supplied.","solutions":["Provide a dict keyed by nonnegative integer constants: `{\"90\": {\"name\": \"Unbreak Now\", \"keywords\": [\"unbreak-now\"]}, ...}`.","Copy the default map from the Phabricator documentation/UI as a starting point and edit names/keywords rather than authoring from scratch.","Use the web Config editor for maniphest.priorities so the JSON is validated and errors are shown in context."],"exampleFix":"# before\n$ ./bin/config set maniphest.priorities '[100, 90, 50, 25, 0]'\n\n# after\n$ ./bin/config set maniphest.priorities '{\"100\": {\"name\": \"Unbreak Now\", \"keywords\": [\"unbreak-now\"]}, \"0\": {\"name\": \"Low\", \"keywords\": [\"low\"]}}'","handlingStrategy":"validation","validationCode":"function is_valid_priorities_shape($config) {\n  if (!is_array($config) || array_keys($config) === range(0, count($config) - 1)) {\n    return false; // not a dict / is a list\n  }\n  foreach ($config as $key => $value) {\n    if (!ctype_digit((string)$key) || !is_array($value)) return false;\n  }\n  return true;\n}","typeGuard":"function is_priority_map($c) { return is_array($c) && !self::is_list($c); }","tryCatchPattern":null,"preventionTips":["Start from the shipped default maniphest.priorities map and edit it.","Use the web Config editor, which validates before saving.","Top level must be keyed by digit-string constants, not a list or scalar."],"tags":["phabricator","maniphest","configuration","priority","type-validation"],"backgroundTag":"config-schema-validation","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}