phacility/phabricator · error · Exception

Package key " " is not valid: package keys are required.

Error message

Package key "%s" is not valid: package keys are required.

What it means

Fires from the package-key validation helper when the key is an empty string. Called during transaction validation, this guard requires a non-empty key for a Packages package; the offending (empty) value is interpolated into the message before the edit is rejected.

Solutions

  1. Provide a nonempty package key (lowercase letters only)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/packages/storage/PhabricatorPackagesPackage.php:104 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/91173ad6f8fc81f4. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/packages/storage/PhabricatorPackagesPackage.php:104

          'Package name "%s" is not valid: package names are required.',
          $value));
    }

    $max_length = 64;
    if ($length > $max_length) {
      throw new Exception(
        pht(
          'Package name "%s" is not valid: package names must not be '.
          'more than %s characters long.',
          $value,
          new PhutilNumber($max_length)));
    }
  }

  public static function assertValidPackageKey($value) {
    $length = phutil_utf8_strlen($value);
    if (!$length) {
      throw new Exception(
        pht(
          'Package key "%s" is not valid: package keys are required.',
          $value));
    }

    $max_length = 64;
    if ($length > $max_length) {
      throw new Exception(
        pht(
          'Package key "%s" is not valid: package keys must not be '.
          'more than %s characters long.',
          $value,
          new PhutilNumber($max_length)));
    }

    if (!preg_match('/^[a-z]+\z/', $value)) {
      throw new Exception(
        pht(

View on GitHub (pinned to 5720a38cfe)