phacility/phabricator · error · Exception

Package key " " is not valid: package keys must not be more…

Error message

Package key "%s" is not valid: package keys must not be more than %s characters long.

What it means

Fires from the package-key validation helper when the key exceeds 64 UTF-8 characters. Invoked from transaction validation; the value and Phabricator-wrapped limit are interpolated and the transaction is rejected before storage.

Solutions

  1. Shorten the package key to 64 characters or fewer
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

          '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(
          'Package key "%s" is not valid: package keys may only contain '.
          'lowercase latin letters.',
          $value));
    }
  }


/* -(  PhabricatorSubscribableInterface  )----------------------------------- */

View on GitHub (pinned to 5720a38cfe)