phacility/phabricator · error · Exception

Color key " " is not a valid color key. The supported color…

Error message

Color key "%s" is not a valid color key. The supported color keys are: %s.

What it means

Fires in validateColorConfiguration when a projects.icons color entry references a 'key' that is not in the set of available (built-in) color keys. This is a configuration typo guard: the invalid key and the full list of supported keys are interpolated into the message.

Solutions

  1. Use one of the supported PHUITagView color keys listed in the error.
  2. Check the configuration for typos in the key name.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/project/icon/PhabricatorProjectIconSet.php:461 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src/applications/project/icon/PhabricatorProjectIconSet.php:461

    foreach ($config as $idx => $value) {
      if (!is_array($value)) {
        throw new Exception(
          pht(
            'Value for index "%s" should be a dictionary.',
            $idx));
      }

      PhutilTypeSpec::checkMap(
        $value,
        array(
          'key' => 'string',
          'name' => 'string',
          'default' => 'optional bool',
        ));

      $key = $value['key'];
      if (!isset($available_keys[$key])) {
        throw new Exception(
          pht(
            'Color key "%s" is not a valid color key. The supported color '.
            'keys are: %s.',
            $key,
            implode(', ', $available_keys)));
      }
    }

    $default = null;
    $keys = array();
    foreach ($config as $idx => $value) {
      $key = $value['key'];
      if (isset($keys[$key])) {
        throw new Exception(
          pht(
            'Project colors must have unique keys, but two icons share the '.
            'same key ("%s").',
            $key));

View on GitHub (pinned to 5720a38cfe)