phacility/phabricator · warning · PhutilArgumentUsageException
Storage type "%s" is unknown. Supported types are: %s.
Error message
Storage type "%s" is unknown. Supported types are: %s.
What it means
migrate-hunk validates the --to value against the supported hunk storage datatypes, which are exactly DifferentialHunk::DATATYPE_TEXT ('text') and DifferentialHunk::DATATYPE_FILE ('file'). Any other string throws this usage exception listing the accepted values, so the check runs before any hunk is read or written.
Source
Thrown at src/applications/differential/management/PhabricatorDifferentialMigrateHunkWorkflow.php:80
pht(
'Options "--to" (to choose a specific storage format) and "--auto" '.
'(to select a storage format automatically) are mutually '.
'exclusive.'));
} else if (!$is_auto && !$storage) {
throw new PhutilArgumentUsageException(
pht(
'Use "--to" to choose a storage format, or "--auto" to select a '.
'format automatically.'));
}
$types = array(
DifferentialHunk::DATATYPE_TEXT,
DifferentialHunk::DATATYPE_FILE,
);
$types = array_fuse($types);
if (strlen($storage)) {
if (!isset($types[$storage])) {
throw new PhutilArgumentUsageException(
pht(
'Storage type "%s" is unknown. Supported types are: %s.',
$storage,
implode(', ', array_keys($types))));
}
}
if ($id) {
$hunk = $this->loadHunk($id);
$hunks = array($hunk);
} else {
$hunks = new LiskMigrationIterator(new DifferentialHunk());
}
foreach ($hunks as $hunk) {
try {
$this->migrateHunk($hunk, $storage, $is_auto, $is_dry_run);
} catch (Exception $ex) {View on GitHub (pinned to 5720a38cfe)
Solutions
- Use exactly one of the two listed values: --to text or --to file
- If unsure which to pick, use --auto instead of --to and let Phabricator choose
- Print the supported types from the error message itself; they are authoritative for your installed version
- Fix the script variable that produced the bad token (quote it and default it)
Example fix
# before phabricator/ $ ./bin/differential migrate-hunk --all --to gzip Usage Exception: Storage type "gzip" is unknown. Supported types are: text, file. # after phabricator/ $ ./bin/differential migrate-hunk --all --to file
Defensive patterns
Strategy: validation
Validate before calling
// Validate the storage type against the supported set before invoking
$supported = array(DifferentialHunk::DATATYPE_TEXT, DifferentialHunk::DATATYPE_FILE); // 'text', 'file'
if (!in_array($to_format, $supported, true)) {
throw new Exception('Use --to text, --to file, or --auto.');
} Type guard
function isValidHunkStorageType($type) {
return in_array($type, array('text', 'file'), true);
} Try / catch
try {
$workflow->execute($args);
} catch (PhutilArgumentUsageException $ex) {
// Unknown storage type: the message lists the accepted values for this
// installed version; pick one (or --auto) and re-run.
} Prevention
- Remember the datatype vocabulary is only 'text' and 'file'; compression formats are data formats, not --to values
- Source the valid list from the error message or the DifferentialHunk constants of your version rather than memory
- Use --auto when the distinction is unclear
When it happens
Trigger: Passing --to with an invented or misremembered value (e.g., 'mysql', 's3', 'files', 'gzip', 'database'); passing the data-format name instead of the datatype (formats like 'gzip' are not storage types); typos or shell-expansion artifacts in the argument.
Common situations: Operators confusing the hunk 'data type' (where bytes live: database text vs file storage) with the 'data format' (compression/encoding of the bytes); scripts copied from older or newer versions whose supported lists differ; uninitialized FORMAT variables expanding to an empty or wrong token.
Related errors
- Options "--all" (to migrate all hunks) and "--id" (to migrat
- Specify a hunk to migrate with "--id", or migrate all hunks
- Options "--to" (to choose a specific storage format) and "--
- Use "--to" to choose a storage format, or "--auto" to select
- Specify a commit and a revision to attach it to.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/8dfb4c092ecdb53c.
Report an issue: GitHub.