{"record":{"id":"2b04b88cca128331","repo":"phacility/phabricator","slug":"unknown-export-format-s","errorCode":null,"errorMessage":"Unknown export format (\"%s\").","messagePattern":"Unknown export format \\(\"(.+?)\"\\)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/infrastructure/export/engine/PhabricatorExportEngineBulkJobType.php","lineNumber":89,"sourceCode":"        ->withQueryKeys(array($query_key))\n        ->executeOne();\n    } else {\n      $saved_query = null;\n    }\n\n    if (!$saved_query) {\n      throw new Exception(\n        pht(\n          'Failed to load saved query (\"%s\").',\n          $query_key));\n    }\n\n    $format_key = $job->getParameter('formatKey');\n\n    $all_formats = PhabricatorExportFormat::getAllExportFormats();\n    $format = idx($all_formats, $format_key);\n    if (!$format) {\n      throw new Exception(\n        pht(\n          'Unknown export format (\"%s\").',\n          $format_key));\n    }\n\n    if (!$format->isExportFormatEnabled()) {\n      throw new Exception(\n        pht(\n          'Export format (\"%s\") is not enabled.',\n          $format_key));\n    }\n\n    $export_engine = id(new PhabricatorExportEngine())\n      ->setViewer($actor)\n      ->setTitle($job->getParameter('title'))\n      ->setFilename($job->getParameter('filename'))\n      ->setSearchEngine($engine)\n      ->setSavedQuery($saved_query)","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/export/engine/PhabricatorExportEngineBulkJobType.php#L71-L107","documentation":"Thrown by the export bulk worker when the job's 'formatKey' parameter does not map to any registered export format. Formats are discovered with PhabricatorExportFormat::getAllExportFormats(), a class-map query over subclasses of PhabricatorExportFormat keyed by getExportFormatKey(); if idx() on that map misses, the key is unknown to this install.","triggerScenarios":"Queueing a job with formatKey that is null, misspelled, or refers to a format class not loaded (e.g. a custom export format extension that is disabled or removed); a job queued under an older Phabricator version referencing a format key that no longer exists when the worker finally runs after an upgrade.","commonSituations":"Version upgrades renaming/removing format keys; third-party format extensions uninstalled while old queued jobs still reference their key; hand-crafted worker job parameters.","solutions":["Re-run the export from the UI and pick a currently offered format (csv, json, txt are always registered)","Check the spelling of formatKey against array_keys(PhabricatorExportFormat::getAllExportFormats())","If a custom format is expected, confirm its class is installed and its getExportFormatKey() returns the key being used","Discard stale queued jobs that were created before a format was removed"],"exampleFix":"// before\n$job->setParameter('formatKey', $format_key);\n\n// after: validate the key against registered formats before queueing\n$formats = PhabricatorExportFormat::getAllExportFormats();\nif (empty($formats[$format_key])) {\n  throw new Exception(\n    pht('Unknown format key \"%s\". Available: %s.',\n      $format_key, implode(', ', array_keys($formats))));\n}\n$job->setParameter('formatKey', $format_key);","handlingStrategy":"validation","validationCode":"$formats = PhabricatorExportFormat::getAllExportFormats();\nif (!isset($formats[$format_key])) {\n  throw new Exception(pht(\n    'Unknown export format \"%s\". Choose one of: %s.',\n    $format_key, implode(', ', array_keys($formats))));\n}\n$job->setParameter('formatKey', $format_key);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build export format choices in the UI from PhabricatorExportFormat::getAllExportFormats() so users can only pick registered keys","After upgrading or removing a custom format extension, purge queued export jobs that reference the removed key"],"tags":["export","format","bulk-job","phabricator"],"backgroundTag":"unsupported-export-format","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}