phacility/phabricator · error · PhutilArgumentUsageException

$validation->getMessage()

Error message

$validation->getMessage()

What it means

Passthrough rethrow in bin/config set execute(): the option group's validateOption() raised a PhabricatorConfigValidationException during final validation, which is converted into a usage exception carrying the original message. The wrapped text explains why the value was rejected.

Solutions

  1. Follow the wrapped validation message for the required value format
  2. Check the option's description in Config application for its expected structure
Defensive patterns

Strategy: try-catch

When it happens

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

Appendix: source

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

          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) {
      // Convert this into a usage exception so we don't dump a stack trace.
      throw new PhutilArgumentUsageException($validation->getMessage());
    }

    if ($use_database) {
      $config_entry = PhabricatorConfigEntry::loadConfigEntry($key);
      $config_entry->setValue($value);

      // If the entry has been deleted, resurrect it.
      $config_entry->setIsDeleted(0);

      $config_entry->save();

      $write_message = pht(
        'Wrote configuration key "%s" to database storage.',
        $key);
    } else {
      $config_source = new PhabricatorConfigLocalSource();

      $local_path = $config_source->getReadablePath();

View on GitHub (pinned to 5720a38cfe)