phacility/phabricator · error · Exception
No file storage format with key "%s" exists.
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.
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)
Solutions
- List registered keys and fix the typo: var_dump(array_keys(PhabricatorFileStorageFormat::getAllFormats())) — expected keys include 'raw', 'test', 'aes-256-cbc'
- 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
- 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
- Derive format keys from class constants, e.g. PhabricatorFileAES256StorageFormat::FORMATKEY, instead of string literals
- Keep custom storage format classes enabled on every install that holds files referencing their keys
- Add a deploy-time check that files.default-format resolves via getFormat()
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
- Unrecognized verb: %s
- The following regex is malformed and cannot be used: %s
- Database "%s" is configured as a replica, but specifies a "p
- Database "%s" is configured as a replica, but does not speci
- Database "%s" is configured as a replica, but there is no ma
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/6777a18b8faef5b6.
Report an issue: GitHub.