phacility/phabricator · error · PhabricatorWorkerPermanentFailureException

No "%s" in task data.

Error message

No "%s" in task data.

What it means

FileDeletionWorker (the PhabricatorWorker that actually removes file data from storage engines) requires 'objectPHID' in its task data; idx($this->getTaskData(), 'objectPHID') came back empty. It throws PhabricatorWorkerPermanentFailureException, which tells the queue the task can never succeed, so it is discarded rather than retried — the producer of the task passed malformed data.

Source

Thrown at src/applications/files/worker/FileDeletionWorker.php:8

<?php

final class FileDeletionWorker extends PhabricatorWorker {

  private function loadFile() {
    $phid = idx($this->getTaskData(), 'objectPHID');
    if (!$phid) {
      throw new PhabricatorWorkerPermanentFailureException(
        pht('No "%s" in task data.', 'objectPHID'));
    }

    $file = id(new PhabricatorFileQuery())
      ->setViewer(PhabricatorUser::getOmnipotentUser())
      ->withPHIDs(array($phid))
      ->executeOne();

    if (!$file) {
      throw new PhabricatorWorkerPermanentFailureException(
        pht('File "%s" does not exist.', $phid));
    }

    return $file;
  }

  protected function doWork() {
    $file = $this->loadFile();

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Queue the task with the required key: PhabricatorWorker::scheduleTask('FileDeletionWorker', array('objectPHID' => $file->getPHID()));
  2. Prefer calling $file->delete() (or PhabricatorFileQuery + delete) and let it build correct task data for you.
  3. Audit custom producers for the exact 'objectPHID' key; note tasks already failed permanently will not retry — re-queue them after fixing.

Example fix

// before
PhabricatorWorker::scheduleTask(
  'FileDeletionWorker',
  array('filePHID' => $file->getPHID()), // wrong key
);

// after
PhabricatorWorker::scheduleTask(
  'FileDeletionWorker',
  array('objectPHID' => $file->getPHID()),
);
Defensive patterns

Strategy: validation

Validate before calling

$data = array('objectPHID' => $file->getPHID());
if (idx($data, 'objectPHID') === null) {
  throw new Exception('Refusing to queue FileDeletionWorker without objectPHID.');
}
PhabricatorWorker::scheduleTask('FileDeletionWorker', $data);

Type guard

function isValidDeletionTaskData(array $data): bool {
  return idx($data, 'objectPHID') !== null;
}

Prevention

When it happens

Trigger: Queueing FileDeletionWorker with task data missing the key: PhabricatorWorker::scheduleTask('FileDeletionWorker', array(), ...) or with a typo'd key like 'filePHID'/'phid'; also code paths that build task data dynamically and silently drop the key.

Common situations: Custom scripts that schedule deletion workers directly instead of using PhabricatorFile::delete() (which sets objectPHID correctly); refactors renaming the task-data key; serialization bugs that empty the array.

Related errors


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