{"record":{"id":"a4d1d0237ec5ca7c","repo":"phacility/phabricator","slug":"unknown-export-format-s-known-formats-are","errorCode":null,"errorMessage":"Unknown export format (\"%s\"). Known formats are: %s.","messagePattern":"Unknown export format \\(\"(.+?)\"\\)\\. Known formats are: (.+?)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/transactions/bulk/management/PhabricatorBulkManagementExportWorkflow.php","lineNumber":63,"sourceCode":"        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $viewer = $this->getViewer();\n\n    list($engine, $queries) = $this->newQueries($args);\n\n    $format_key = $args->getArg('format');\n    if (!strlen($format_key)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify an export format with \"--format\".'));\n    }\n\n    $all_formats = PhabricatorExportFormat::getAllExportFormats();\n    $format = idx($all_formats, $format_key);\n    if (!$format) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Unknown export format (\"%s\"). Known formats are: %s.',\n          $format_key,\n          implode(', ', array_keys($all_formats))));\n    }\n\n    if (!$format->isExportFormatEnabled()) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Export format (\"%s\") is not enabled.',\n          $format_key));\n    }\n\n    $is_overwrite = $args->getArg('overwrite');\n    $output_path = $args->getArg('output');\n\n    if (!strlen($output_path)) {\n      throw new PhutilArgumentUsageException(","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/transactions/bulk/management/PhabricatorBulkManagementExportWorkflow.php#L45-L81","documentation":"The --format value is looked up in PhabricatorExportFormat::getAllExportFormats(). An unrecognized key aborts and the error enumerates the registered format keys, so the correct keys are always in the message.","triggerScenarios":"Passing a typo'd format key or one that does not exist in this install's registry (for example a format provided by an extension that is not loaded).","commonSituations":"Scripts written against a different Phabricator version whose format registry differs; documentation drift; missing custom export format extensions.","solutions":["Use one of the formats listed verbatim in the error message (csv is the always-registered baseline)","Update the script for the current version's registry","If the format comes from an extension, verify the extension is installed and loaded"],"exampleFix":"# before\n./bin/bulk export --format xml ...\n\n# after: a format the registry actually knows\n./bin/bulk export --format csv ...","handlingStrategy":"validation","validationCode":"// Check the key against the registry before running the workflow.\n$all_formats = PhabricatorExportFormat::getAllExportFormats();\nif (!isset($all_formats[$format_key])) {\n  $format_key = 'csv'; // or report: known formats are array_keys($all_formats)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read the known-formats list straight from the error message or getAllExportFormats()","Pin scripts to format keys that exist in the deployed Phabricator version"],"tags":["cli","usage","export","format","registry"],"backgroundTag":"invalid-argument-value","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}