phacility/phabricator · error · Exception
No image exists with PHID "%s".
Error message
No image exists with PHID "%s".
What it means
PholioMockEditor::loadPholioImage resolves an image PHID with the editor's actor as viewer while applying mock transactions (replace/reorder image). If PholioImageQuery returns nothing for that PHID, the transaction stream references an image that does not exist (or is invisible to the actor), and the edit is aborted with an Exception before anything is written.
Source
Thrown at src/applications/pholio/editor/PholioMockEditor.php:220
switch ($xaction->getTransactionType()) {
case PholioMockInlineTransaction::TRANSACTIONTYPE:
return true;
}
return parent::shouldImplyCC($object, $xaction);
}
public function loadPholioImage($object, $phid) {
if (!isset($this->images[$phid])) {
$image = id(new PholioImageQuery())
->setViewer($this->getActor())
->withPHIDs(array($phid))
->executeOne();
if (!$image) {
throw new Exception(
pht(
'No image exists with PHID "%s".',
$phid));
}
$mock_phid = $image->getMockPHID();
if ($mock_phid) {
if ($mock_phid !== $object->getPHID()) {
throw new Exception(
pht(
'Image ("%s") belongs to the wrong object ("%s", expected "%s").',
$phid,
$mock_phid,
$object->getPHID()));
}
}
$this->images[$phid] = $image;View on GitHub (pinned to 5720a38cfe)
Solutions
- Reload the mock in the UI and retry the edit against the current image set
- For editor/API callers, re-fetch valid image PHIDs with PholioImageQuery scoped to the mock before building transactions
- Never reuse PHIDs captured from a different mock or an earlier version of the mock
Example fix
// before: reusing a stale PHID captured earlier $xaction->setNewValue($old_image_phid); // after $images = id(new PholioImageQuery()) ->setViewer($actor) ->withMockPHIDs(array($mock->getPHID())) ->execute(); $xaction->setNewValue(head($images)->getPHID());
Defensive patterns
Strategy: validation
Validate before calling
// Verify the image exists (and belongs to this mock) before building transactions
$image = id(new PholioImageQuery())
->setViewer($actor)
->withPHIDs(array($image_phid))
->withMockPHIDs(array($mock->getPHID()))
->executeOne();
if (!$image) {
throw new Exception('Stale image reference; reload the mock.');
} Try / catch
try {
$editor->applyTransactions($mock, $xactions);
} catch (Exception $ex) {
if (strpos($ex->getMessage(), 'No image exists with PHID') !== false) {
// stale reference: re-fetch images and rebuild transactions
}
} Prevention
- Always re-fetch image PHIDs with PholioImageQuery scoped to the mock at edit time
- Discard captured PHIDs when the mock was edited concurrently - reload first
- Never replay recorded transaction streams against new mocks
When it happens
Trigger: A replaceImage/reorder transaction carries a PHID captured before another user deleted that image; concurrent edits where the image was removed between page load and submit; API callers fabricating or replaying PHIDs from a different mock instance.
Common situations: Stale browser sessions after a mock was edited by someone else; scripts replaying recorded transaction streams; copy-pasting example PHIDs into custom clients.
Related errors
- Image ("%s") belongs to the wrong object ("%s", expected "%s
- File is not viewable.
- User PHID ("%s") is not a valid user.
- Request parameter "%s" is not formatted properly. Expected a
- Request parameter "%s" is not formatted properly. Expected a
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/48a56e4e7ead5732.
Report an issue: GitHub.