{"record":{"id":"fb273ad3ff09d87b","repo":"phacility/phabricator","slug":"export-format-s-is-not-enabled-fb273a","errorCode":null,"errorMessage":"Export format (\"%s\") is not enabled.","messagePattern":"Export format \\(\"(.+?)\"\\) is not enabled\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/infrastructure/export/engine/PhabricatorExportEngineBulkJobType.php","lineNumber":96,"sourceCode":"      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)\n      ->setExportFormat($format);\n\n    $file = $export_engine->exportFile();\n\n    $job\n      ->setParameter('filePHID', $file->getPHID())\n      ->save();","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/export/engine/PhabricatorExportEngineBulkJobType.php#L78-L114","documentation":"The export bulk worker resolved the format class from its key, but the format reports itself disabled via isExportFormatEnabled(). This is an install-capability check, not a configuration toggle: for example PhabricatorExcelExportFormat (xlsx) returns false when the PHP 'zip' extension is not loaded or the PHPExcel library file cannot be included; csv/json/txt always return true.","triggerScenarios":"Exporting as 'xlsx' on a host without the PHP zip extension or without PHPExcel installed; queueing an export that runs on a different web/worker host with a different PHP configuration than the host that offered the format in the UI.","commonSituations":"php-zip missing after a server migration or PHP upgrade; PHPExcel not deployed to the phabricator/libphutil library path; UI shows xlsx (web host has zip) but the worker host does not, so the queued job fails.","solutions":["Install/enable the PHP zip extension (e.g. apt install php-zip) and restart PHP and the daemons, or ensure PHPExcel is on the include path","Export as CSV or JSON instead, which are always enabled","Run bin/config get or a php -m check on the host that executes worker jobs to verify extensions","Keep web and worker hosts' PHP configurations identical so formats offered in the UI match what workers can produce"],"exampleFix":"// before: queueing xlsx blindly\n$job->setParameter('formatKey', 'xlsx');\n\n// after: pick the first enabled format the worker can actually produce\n$formats = PhabricatorExportFormat::getAllExportFormats();\n$format = idx($formats, 'xlsx');\nif (!$format || !$format->isExportFormatEnabled()) {\n  $format = idx($formats, 'csv');\n}\n$job->setParameter('formatKey', $format->getExportFormatKey());","handlingStrategy":"validation","validationCode":"$formats = PhabricatorExportFormat::getAllExportFormats();\n$format = idx($formats, $format_key);\nif (!$format || !$format->isExportFormatEnabled()) {\n  $format = idx($formats, 'csv'); // always enabled\n  $format_key = $format->getExportFormatKey();\n}\n$job->setParameter('formatKey', $format_key);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Offer only formats where isExportFormatEnabled() returns true on the host that runs workers, not just the web host","Keep php-zip and any format dependencies (PHPExcel) installed and identical on all web/worker hosts"],"tags":["export","php-extension","zip","xlsx","phabricator"],"backgroundTag":"feature-not-enabled","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}