phacility/phabricator · error · PhutilArgumentUsageException

Configuration key " " is of type " ". Specify it in JSON.

Error message

Configuration key "%s" is of type "%s". Specify it in JSON.

What it means

Format guard in bin/config set execute(): for options with a custom/wild type, the supplied value was json_decode()'d and did not yield an array. The message names the key and its declared type and requires the value be given as JSON.

Solutions

  1. Pass the value as valid JSON, e.g. bin/config set <key> '[1,2,3]'
  2. Quote the JSON so the shell does not strip its brackets
  3. Check the JSON for syntax errors
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php:107 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/56e5ca07f8547398. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php:107

      } catch (PhabricatorConfigValidationException $ex) {
        throw new PhutilArgumentUsageException($ex->getMessage());
      }
    } else {
      // NOTE: For now, this handles both "wild" values and custom types.
      $type = $option->getType();
      switch ($type) {
        default:
          $value = json_decode($value, true);
          if (!is_array($value)) {
            switch ($type) {
              default:
                $message = pht(
                  'Configuration key "%s" is of type "%s". Specify it in JSON.',
                  $key,
                  $type);
                break;
            }
            throw new PhutilArgumentUsageException($message);
          }
          break;
      }
    }

    $use_database = $args->getArg('database');
    if ($option->getLocked() && $use_database) {
      throw new PhutilArgumentUsageException(
        pht(
          'Config key "%s" is locked and can only be set in local '.
          'configuration. To learn more, see "%s" in the documentation.',
          $key,
          pht('Configuration Guide: Locked and Hidden Configuration')));
    }

    try {
      $option->getGroup()->validateOption($option, $value);
    } catch (PhabricatorConfigValidationException $validation) {

View on GitHub (pinned to 5720a38cfe)