phacility/phabricator · error · Exception

Export format ("%s") is not enabled.

Error message

Export format ("%s") is not enabled.

What it means

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.

Source

Thrown at src/infrastructure/export/engine/PhabricatorExportEngineBulkJobType.php:96

      throw new Exception(
        pht(
          'Failed to load saved query ("%s").',
          $query_key));
    }

    $format_key = $job->getParameter('formatKey');

    $all_formats = PhabricatorExportFormat::getAllExportFormats();
    $format = idx($all_formats, $format_key);
    if (!$format) {
      throw new Exception(
        pht(
          'Unknown export format ("%s").',
          $format_key));
    }

    if (!$format->isExportFormatEnabled()) {
      throw new Exception(
        pht(
          'Export format ("%s") is not enabled.',
          $format_key));
    }

    $export_engine = id(new PhabricatorExportEngine())
      ->setViewer($actor)
      ->setTitle($job->getParameter('title'))
      ->setFilename($job->getParameter('filename'))
      ->setSearchEngine($engine)
      ->setSavedQuery($saved_query)
      ->setExportFormat($format);

    $file = $export_engine->exportFile();

    $job
      ->setParameter('filePHID', $file->getPHID())
      ->save();

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. 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
  2. Export as CSV or JSON instead, which are always enabled
  3. Run bin/config get or a php -m check on the host that executes worker jobs to verify extensions
  4. Keep web and worker hosts' PHP configurations identical so formats offered in the UI match what workers can produce

Example fix

// before: queueing xlsx blindly
$job->setParameter('formatKey', 'xlsx');

// after: pick the first enabled format the worker can actually produce
$formats = PhabricatorExportFormat::getAllExportFormats();
$format = idx($formats, 'xlsx');
if (!$format || !$format->isExportFormatEnabled()) {
  $format = idx($formats, 'csv');
}
$job->setParameter('formatKey', $format->getExportFormatKey());
Defensive patterns

Strategy: validation

Validate before calling

$formats = PhabricatorExportFormat::getAllExportFormats();
$format = idx($formats, $format_key);
if (!$format || !$format->isExportFormatEnabled()) {
  $format = idx($formats, 'csv'); // always enabled
  $format_key = $format->getExportFormatKey();
}
$job->setParameter('formatKey', $format_key);

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/fb273ad3ff09d87b. Report an issue: GitHub.