phacility/phabricator · error · Exception

No file storage format with key

Error message

No file storage format with key "%s" exists.

What it means

PhabricatorFileStorageFormat::requireFormat() throws when no storage format class is registered under the given format key. Format keys are FORMATKEY class constants discovered via PhutilClassMapQuery, so an unknown key means a typo or a format class that is not loaded (disabled module, removed custom class). Reads and writes of files can both route through this lookup.

Solutions

  1. List registered keys and fix the typo: var_dump(array_keys(PhabricatorFileStorageFormat::getAllFormats())) — expected keys include 'raw', 'test', 'aes-256-cbc'
  2. If old files reference a removed custom format, restore or re-enable that class (e.g. via a Phabricator module) so the key resolves again
  3. Correct files.default-format to a key that exists on this install

Example fix

// before
$format = PhabricatorFileStorageFormat::requireFormat('aes-256-cbc-256');

// after
$format = PhabricatorFileStorageFormat::requireFormat('aes-256-cbc');
Defensive patterns

Strategy: validation

Validate before calling

// Soft-resolve before requiring:
if (PhabricatorFileStorageFormat::getFormat($format_key) === null) {
  // Unknown format key: choose from the registered set instead of letting
  // requireFormat() throw mid-request.
  $valid = implode(', ', array_keys(PhabricatorFileStorageFormat::getAllFormats()));
  throw new Exception("Unknown storage format '{$format_key}'. Valid: {$valid}");
}

Type guard

function isValidStorageFormatKey($key) {
  return array_key_exists($key, PhabricatorFileStorageFormat::getAllFormats());
}

Prevention

When it happens

Trigger: Calling PhabricatorFileStorageFormat::requireFormat('aes-256-bcb') with a typo; files.default-format set to a key with no matching class; loading a file row whose storage format references a custom format class that is no longer enabled on this install.

Common situations: Renaming or deleting a custom storage format class while old files still reference its key; typo'd config values; moving a database to an install that lacks the extension providing the format.

Related errors


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

Appendix: source

Thrown at src/applications/files/format/PhabricatorFileStorageFormat.php:76

  }

  final public static function getAllFormats() {
    return id(new PhutilClassMapQuery())
      ->setAncestorClass(__CLASS__)
      ->setUniqueMethod('getStorageFormatKey')
      ->execute();
  }

  final public static function getFormat($key) {
    $formats = self::getAllFormats();
    return idx($formats, $key);
  }

  final public static function requireFormat($key) {
    $format = self::getFormat($key);

    if (!$format) {
      throw new Exception(
        pht(
          'No file storage format with key "%s" exists.',
          $key));
    }

    return $format;
  }

}

View on GitHub (pinned to 5720a38cfe)