{"record":{"id":"7dbf5277b213a4c4","repo":"phacility/phabricator","slug":"monogram-s-does-not-identify-a-valid-object","errorCode":null,"errorMessage":"Monogram \"%s\" does not identify a valid object.","messagePattern":"Monogram \"(.+?)\" does not identify a valid object\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/transactions/editengine/PhabricatorEditEngine.php","lineNumber":746,"sourceCode":"    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    }\n\n    $expect = $this->newEditableObject();\n    $expect_class = get_class($expect);\n    $target_class = get_class($target);\n    if ($expect_class !== $target_class) {\n      throw new Exception(\n        pht(\n          'Monogram \"%s\" identifies an object of the wrong type. Loaded '.\n          'object has class \"%s\", but this editor operates on objects of '.\n          'type \"%s\".',\n          $identifier,\n          $target_class,\n          $expect_class));\n    }","sourceCodeStart":728,"sourceCodeEnd":764,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/transactions/editengine/PhabricatorEditEngine.php#L728-L764","documentation":"When the identifier is neither numeric nor a PHID-shaped string, PhabricatorEditEngine::newObjectFromIdentifier() tries to resolve it as a monogram (e.g. T123, D45) via PhabricatorObjectQuery->withNames(). This exception means the name resolver found no object at all for that monogram.","triggerScenarios":"Passing objectIdentifier=\"T999999\" (or any monogram of an object that does not exist or is not visible) to an edit-engine Conduit method or /edit/ URL; using a monogram for an application that is not installed/enabled on this instance.","commonSituations":"Users hand-typing a monogram in a URL or automation script with a typo; migrating content between instances where the monogram refers to an object that was never created; referencing monograms of disabled/uninstalled applications; monograms case-mangled by tooling.","solutions":["Check the monogram resolves at all with conduit phid.lookup / phid.query before editing","Confirm the application the monogram belongs to (T=Maniphest, D=Differential, P=Projects, ...) is installed and enabled on this instance","Prefer IDs or PHIDs in machine-to-machine automation; reserve monograms for human input","Wrap the edit call and treat this exception as 'invalid reference' input feedback"],"exampleFix":"// before\n$parameters = array('objectIdentifier' => 'T999999', 'transactions' => $transactions);\n$result = $client->callMethod('maniphest.edit', $parameters);\n// Exception: Monogram \"T999999\" does not identify a valid object.\n\n// after: resolve the monogram first, edit only if it exists\n$lookup = $client->callMethod('phid.lookup', array('names' => array('T999999')));\nif (empty($lookup['T999999'])) {\n  // report an invalid/unknown monogram to the caller\n}\n$result = $client->callMethod('maniphest.edit', $parameters);","handlingStrategy":"validation","validationCode":"// Resolve any monogram before handing it to an editor:\n$lookup = $client->callMethod('phid.lookup', array('names' => array($monogram)));\nif (empty($lookup[$monogram])) {\n  // unknown/invisible monogram; reject the input here\n}","typeGuard":"function isPlausibleMonogram($m) {\n  // e.g. T123, D4567, P12 — uppercase app letter(s) + digits\n  return is_string($m) && preg_match('/^[A-Z]{1,4}\\d+\\z/', $m);\n}","tryCatchPattern":"try {\n  $result = $client->callMethod('maniphest.edit', $parameters);\n} catch (ConduitClientException $ex) {\n  if (strpos($ex->getMessage(), 'does not identify a valid object') !== false) {\n    // surface 'unknown reference' to the user instead of crashing\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Validate user-supplied monograms with phid.lookup before using them in edits","Prefer IDs or PHIDs for machine inputs; monograms are for humans","Confirm the target application is installed before accepting its monograms"],"tags":["phabricator","edit-engine","monogram","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"}