{"record":{"id":"6ab15389663391e4","repo":"phacility/phabricator","slug":"transaction-with-key-s-has-invalid-type-s-t","errorCode":null,"errorMessage":"Transaction with key \"%s\" has invalid type \"%s\". This type is not recognized. Valid types are: %s.","messagePattern":"Transaction with key \"(.+?)\" has invalid type \"(.+?)\"\\. This type is not recognized\\. Valid types are: (.+?)\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/transactions/editengine/PhabricatorEditEngine.php","lineNumber":2254,"sourceCode":"   * @param list<wild> Raw conduit transactions.\n   * @param list<PhabricatorEditType> Supported edit types.\n   * @param PhabricatorApplicationTransaction Template transaction.\n   * @return list<PhabricatorApplicationTransaction> Generated transactions.\n   * @task conduit\n   */\n  private function getConduitTransactions(\n    ConduitAPIRequest $request,\n    array $xactions,\n    array $types,\n    PhabricatorApplicationTransaction $template) {\n\n    $viewer = $request->getUser();\n    $results = array();\n\n    foreach ($xactions as $key => $xaction) {\n      $type = $xaction['type'];\n      if (empty($types[$type])) {\n        throw new Exception(\n          pht(\n            'Transaction with key \"%s\" has invalid type \"%s\". This type is '.\n            'not recognized. Valid types are: %s.',\n            $key,\n            $type,\n            implode(', ', array_keys($types))));\n      }\n    }\n\n    if ($this->getIsCreate()) {\n      $results[] = id(clone $template)\n        ->setTransactionType(PhabricatorTransactions::TYPE_CREATE);\n    }\n\n    $is_strict = $request->getIsStrictlyTyped();\n\n    foreach ($xactions as $xaction) {\n      $type = $types[$xaction['type']];","sourceCodeStart":2236,"sourceCodeEnd":2272,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/transactions/editengine/PhabricatorEditEngine.php#L2236-L2272","documentation":"In getConduitTransactions(), each transaction's 'type' must be one of the edit types the engine's current form/fields expose for the acting viewer. The key is looked up in the $types map; an unknown key throws this exception, and helpfully the message lists every valid type name.","triggerScenarios":"Calling maniphest.edit with 'type' => 'assignee' (not a type; the real key is 'owner'), using transaction type names from a different application's editor, or using a type whose field is disabled/hidden on the default form for that viewer.","commonSituations":"Porting scripts between Phabricator versions or between applications (each engine has its own type vocabulary); custom forms that removed a field (its type then disappears); guessing type names instead of copying them.","solutions":["Read the exception message: it enumerates the exact valid types for this editor — use one of those strings verbatim","Common Maniphest types: title, description, priority, owner, status, projects, subscribers, comment, file, parents, subtasks, subtype, cover","If a type you expect is missing, check that the corresponding field is enabled on the form used by the viewer (EditEngine form configuration)","After upgrading Phabricator, re-run one probe edit per type to detect renamed/removed types early"],"exampleFix":"// before\n'transactions' => array(array('type' => 'assignee', 'value' => 'alice')),\n// Exception: Transaction with key \"0\" has invalid type \"assignee\" ...\n\n// after\n'transactions' => array(array('type' => 'owner', 'value' => array('alice'))),","handlingStrategy":"validation","validationCode":"// Keep an allow-list per editor and check before sending:\n$valid_maniphest_types = array(\n  'title', 'description', 'priority', 'owner', 'status',\n  'projects', 'subscribers', 'comment', 'file', 'parents',\n  'subtasks', 'subtype', 'points', 'cover',\n);\nforeach ($parameters['transactions'] as $txn) {\n  if (!in_array($txn['type'], $valid_maniphest_types, true)) {\n    // unknown type: drop it or fail loudly before the call\n  }\n}","typeGuard":"function isKnownEditType($type, array $allowed) {\n  return is_string($type) && isset($allowed[$type]);\n}","tryCatchPattern":"try {\n  $result = $client->callMethod('maniphest.edit', $parameters);\n} catch (ConduitClientException $ex) {\n  if (strpos($ex->getMessage(), 'has invalid type') !== false) {\n    // the message lists every valid type; log it and fix the payload\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["The exception message is the documentation: it enumerates valid types — read it before guessing","After Phabricator upgrades, run a probe edit per type your scripts use","Check the edit form configuration when a formerly valid type disappears — a disabled field removes its type"],"tags":["phabricator","conduit","edit-engine","unknown-type","request-validation"],"backgroundTag":"invalid-request-payload","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}