{"record":{"id":"8dfb4c092ecdb53c","repo":"phacility/phabricator","slug":"storage-type-s-is-unknown-supported-types-are","errorCode":null,"errorMessage":"Storage type \"%s\" is unknown. Supported types are: %s.","messagePattern":"Storage type \"(.+?)\" is unknown\\. Supported types are: (.+?)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/differential/management/PhabricatorDifferentialMigrateHunkWorkflow.php","lineNumber":80,"sourceCode":"        pht(\n          'Options \"--to\" (to choose a specific storage format) and \"--auto\" '.\n          '(to select a storage format automatically) are mutually '.\n          'exclusive.'));\n    } else if (!$is_auto && !$storage) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Use \"--to\" to choose a storage format, or \"--auto\" to select a '.\n          'format automatically.'));\n    }\n\n    $types = array(\n      DifferentialHunk::DATATYPE_TEXT,\n      DifferentialHunk::DATATYPE_FILE,\n    );\n    $types = array_fuse($types);\n    if (strlen($storage)) {\n      if (!isset($types[$storage])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Storage type \"%s\" is unknown. Supported types are: %s.',\n            $storage,\n            implode(', ', array_keys($types))));\n      }\n    }\n\n    if ($id) {\n      $hunk = $this->loadHunk($id);\n      $hunks = array($hunk);\n    } else {\n      $hunks = new LiskMigrationIterator(new DifferentialHunk());\n    }\n\n    foreach ($hunks as $hunk) {\n      try {\n        $this->migrateHunk($hunk, $storage, $is_auto, $is_dry_run);\n      } catch (Exception $ex) {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/differential/management/PhabricatorDifferentialMigrateHunkWorkflow.php#L62-L98","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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)"],"exampleFix":"# before\nphabricator/ $ ./bin/differential migrate-hunk --all --to gzip\nUsage Exception: Storage type \"gzip\" is unknown. Supported types are: text, file.\n\n# after\nphabricator/ $ ./bin/differential migrate-hunk --all --to file","handlingStrategy":"validation","validationCode":"// Validate the storage type against the supported set before invoking\n$supported = array(DifferentialHunk::DATATYPE_TEXT, DifferentialHunk::DATATYPE_FILE); // 'text', 'file'\nif (!in_array($to_format, $supported, true)) {\n  throw new Exception('Use --to text, --to file, or --auto.');\n}","typeGuard":"function isValidHunkStorageType($type) {\n  return in_array($type, array('text', 'file'), true);\n}","tryCatchPattern":"try {\n  $workflow->execute($args);\n} catch (PhutilArgumentUsageException $ex) {\n  // Unknown storage type: the message lists the accepted values for this\n  // installed version; pick one (or --auto) and re-run.\n}","preventionTips":["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"],"tags":["phabricator","differential","cli","migrate-hunk","invalid-value","storage-format","usage-error"],"backgroundTag":"invalid-option-value","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}