phacility/phabricator · error · Exception

Configuration is not valid. Maniphest priority configuration

Error message

Configuration is not valid. Maniphest priority configurations must be dictionaries.

What it means

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.

Source

Thrown at src/applications/maniphest/constants/ManiphestTaskPriority.php:199

    krsort($config);
    return $config;
  }

  private static function isValidPriorityKeyword($keyword) {
    if (!strlen($keyword) || strlen($keyword) > 64) {
      return false;
    }

    // Alphanumeric, but not exclusively numeric
    if (!preg_match('/^(?![0-9]*$)[a-zA-Z0-9]+$/', $keyword)) {
      return false;
    }
    return true;
  }

  public static function validateConfiguration($config) {
    if (!is_array($config)) {
      throw new Exception(
        pht(
          'Configuration is not valid. Maniphest priority configurations '.
          'must be dictionaries.'));
    }

    $all_keywords = array();
    foreach ($config as $key => $value) {
      if (!ctype_digit((string)$key)) {
        throw new Exception(
          pht(
            'Key "%s" is not a valid priority constant. Priority constants '.
            'must be nonnegative integers.',
            $key));
      }

      if (!is_array($value)) {
        throw new Exception(
          pht(

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Provide a dict keyed by nonnegative integer constants: `{"90": {"name": "Unbreak Now", "keywords": ["unbreak-now"]}, ...}`.
  2. Copy the default map from the Phabricator documentation/UI as a starting point and edit names/keywords rather than authoring from scratch.
  3. Use the web Config editor for maniphest.priorities so the JSON is validated and errors are shown in context.

Example fix

# before
$ ./bin/config set maniphest.priorities '[100, 90, 50, 25, 0]'

# after
$ ./bin/config set maniphest.priorities '{"100": {"name": "Unbreak Now", "keywords": ["unbreak-now"]}, "0": {"name": "Low", "keywords": ["low"]}}'
Defensive patterns

Strategy: validation

Validate before calling

function is_valid_priorities_shape($config) {
  if (!is_array($config) || array_keys($config) === range(0, count($config) - 1)) {
    return false; // not a dict / is a list
  }
  foreach ($config as $key => $value) {
    if (!ctype_digit((string)$key) || !is_array($value)) return false;
  }
  return true;
}

Type guard

function is_priority_map($c) { return is_array($c) && !self::is_list($c); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/404ed23fe32202da. Report an issue: GitHub.