{"record":{"id":"00f00f21c873f00d","repo":"phacility/phabricator","slug":"in-call-to-transaction-search-specified-object","errorCode":null,"errorMessage":"In call to \"transaction.search\", specified \"objectType\" (\"%s\") is unknown. Valid object types are: %s.","messagePattern":"In call to \"transaction\\.search\", specified \"objectType\" \\(\"(.+?)\"\\) is unknown\\. Valid object types are: (.+?)\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php","lineNumber":382,"sourceCode":"\n    if (!$has_type && !$has_identifier) {\n      throw new Exception(\n        pht(\n          'Calls to \"transaction.search\" must specify either an \"objectType\" '.\n          'or an \"objectIdentifier\"'));\n    } else if ($has_type && $has_identifier) {\n      throw new Exception(\n        pht(\n          'Calls to \"transaction.search\" must not specify both an '.\n          '\"objectType\" and an \"objectIdentifier\".'));\n    }\n\n    if ($has_type) {\n      $all_types = PhabricatorPHIDType::getAllTypes();\n\n      if (!isset($all_types[$object_type])) {\n        ksort($all_types);\n        throw new Exception(\n          pht(\n            'In call to \"transaction.search\", specified \"objectType\" (\"%s\") '.\n            'is unknown. Valid object types are: %s.',\n            $object_type,\n            implode(', ', array_keys($all_types))));\n      }\n\n      $object = $all_types[$object_type]->newObject();\n    } else {\n      $object = id(new PhabricatorObjectQuery())\n        ->setViewer($viewer)\n        ->withNames(array($object_identifier))\n        ->executeOne();\n      if (!$object) {\n        throw new Exception(\n          pht(\n            'In call to \"transaction.search\", specified \"objectIdentifier\" '.\n            '(\"%s\") does not exist.',","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php#L364-L400","documentation":"objectType must be one of the keys of PhabricatorPHIDType::getAllTypes() — PHID type constants such as TASK or CMIT, not class or application names. An unknown constant throws with the full sorted list of valid types appended, so the error message itself is the reference. The constant identifies the object family; Phabricator then instantiates a template object via the type's newObject().","triggerScenarios":"Passing objectType: \"ManiphestTask\" or \"maniphest\" instead of \"TASK\"; using a custom object type constant that is not registered in this install.","commonSituations":"Assuming the parameter takes an application or class name; custom applications whose PHID type constants differ from what the caller guessed; constants renamed across versions.","solutions":["Use a PHID type constant from the list in the error message (e.g. TASK for Maniphest tasks).","Deliberately call once with an invalid type to dump the valid list for your install, then correct the call.","For custom object types, verify the constant registered by the application's PhabricatorPHIDType subclass."],"exampleFix":"# before\n{\"objectType\": \"maniphest\"}\n# after\n{\"objectType\": \"TASK\"}","handlingStrategy":"validation","validationCode":"// PHP: whitelist against the install's registered PHID types\n$valid_types = array_keys(PhabricatorPHIDType::getAllTypes());\nif (!in_array($object_type, $valid_types, true)) {\n  throw new InvalidArgumentException(\n    'Unknown objectType. Valid: '.implode(', ', $valid_types));\n}","typeGuard":"// PHP\nfunction isKnownPhidType($type) {\n  $all = PhabricatorPHIDType::getAllTypes();\n  return isset($all[$type]);\n}","tryCatchPattern":"Catch the conduit error client-side, parse the trailing 'Valid object types are:' list from the message, cache it, and re-validate locally next time.","preventionTips":["Use PHID type constants (TASK, CMIT), never application or class names.","Cache the valid-type list per install and re-validate before each call."],"tags":["phabricator","conduit","transaction-search","phid"],"backgroundTag":"unknown-object-type","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}