{"record":{"id":"ba1728e6aec3af61","repo":"phacility/phabricator","slug":"no-object-exists-with-phid-s","errorCode":null,"errorMessage":"No object exists with PHID \"%s\".","messagePattern":"No object exists with PHID \"(.+?)\"\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/transactions/editengine/PhabricatorEditEngine.php","lineNumber":732,"sourceCode":"    if (is_int($identifier) || ctype_digit($identifier)) {\n      $object = $this->newObjectFromID($identifier, $capabilities);\n\n      if (!$object) {\n        throw new Exception(\n          pht(\n            'No object exists with ID \"%s\".',\n            $identifier));\n      }\n\n      return $object;\n    }\n\n    $type_unknown = PhabricatorPHIDConstants::PHID_TYPE_UNKNOWN;\n    if (phid_get_type($identifier) != $type_unknown) {\n      $object = $this->newObjectFromPHID($identifier, $capabilities);\n\n      if (!$object) {\n        throw new Exception(\n          pht(\n            'No object exists with PHID \"%s\".',\n            $identifier));\n      }\n\n      return $object;\n    }\n\n    $target = id(new PhabricatorObjectQuery())\n      ->setViewer($this->getViewer())\n      ->withNames(array($identifier))\n      ->executeOne();\n    if (!$target) {\n      throw new Exception(\n        pht(\n          'Monogram \"%s\" does not identify a valid object.',\n          $identifier));\n    }","sourceCodeStart":714,"sourceCodeEnd":750,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/transactions/editengine/PhabricatorEditEngine.php#L714-L750","documentation":"Thrown by PhabricatorEditEngine::newObjectFromIdentifier() when the identifier's PHID type is recognized (phid_get_type() is not UNKNOWN) so the engine routes to newObjectFromPHID(), but that query returns nothing. As with the ID path, policy filtering means the PHID may exist yet be invisible to the acting viewer.","triggerScenarios":"Passing objectIdentifier=\"PHID-TASK-abcdef...\" to an edit-engine Conduit method or /edit/ controller where the object was deleted, the PHID is malformed/fabricated, or the viewer lacks the requested capability on it.","commonSituations":"Chaining tools that carry PHIDs across systems or backups restored into a fresh install; scripts storing PHIDs long-term (objects get deleted); API tokens belonging to a user without permission on the object; passing a PHID of the right application but wrong concrete object type for the engine.","solutions":["Resolve the PHID first with conduit phid.query / conduit.phid.lookup or the object's *.search method (constraints.phids) using the same credentials","If the PHID came from stale storage (queue, cache, exported sheet), re-resolve it from a monogram or ID before editing","Check the object still exists and the acting user/token has edit capability on it","Catch the exception and branch to a not-found/forbidden handler in the caller"],"exampleFix":"// before: editing a PHID captured earlier\n$parameters = array('objectIdentifier' => $phid, 'transactions' => $transactions);\n$result = $client->callMethod('maniphest.edit', $parameters);\n// Exception: No object exists with PHID \"PHID-TASK-...\".\n\n// after: verify the PHID resolves for this viewer first\n$lookup = $client->callMethod('phid.query', array('names' => array($phid)));\nif (empty($lookup[$phid])) {\n  // handle missing/invisible object\n}\n$result = $client->callMethod('maniphest.edit', $parameters);","handlingStrategy":"validation","validationCode":"// Resolve the PHID with the same credentials before editing:\n$lookup = $client->callMethod('phid.query', array('names' => array($phid)));\nif (empty($lookup[$phid])) {\n  // missing, deleted, or not visible; skip the edit\n}","typeGuard":"function isPlausiblePhid($phid) {\n  return is_string($phid) && preg_match('/^PHID-[A-Z]{4}-[A-Za-z0-9]{20,}\\z/', $phid);\n}","tryCatchPattern":"try {\n  $result = $client->callMethod('maniphest.edit', $parameters);\n} catch (ConduitClientException $ex) {\n  if (strpos($ex->getMessage(), 'No object exists with PHID') === 0) {\n    // drop stale PHID from your store and re-resolve from a monogram/id\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Treat stored PHIDs as cache entries with re-resolution, not permanent truth","After object deletions/imports, prune queued PHIDs before workers process them","Validate PHID shape client-side to catch truncation/corruption early"],"tags":["phabricator","edit-engine","phid","object-not-found","conduit"],"backgroundTag":"object-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}