{"record":{"id":"8e0414471fbe3946","repo":"phacility/phabricator","slug":"err-bad-task","errorCode":"ERR_BAD_TASK","errorMessage":"ERR_BAD_TASK","messagePattern":"ERR_BAD_TASK","errorType":"error_code","errorClass":"ConduitException","httpStatus":null,"severity":"error","filePath":"src/applications/maniphest/conduit/ManiphestInfoConduitAPIMethod.php","lineNumber":49,"sourceCode":"  }\n\n  protected function defineErrorTypes() {\n    return array(\n      'ERR_BAD_TASK' => pht('No such Maniphest task exists.'),\n    );\n  }\n\n  protected function execute(ConduitAPIRequest $request) {\n    $task_id = $request->getValue('task_id');\n\n    $task = id(new ManiphestTaskQuery())\n      ->setViewer($request->getUser())\n      ->withIDs(array($task_id))\n      ->needSubscriberPHIDs(true)\n      ->needProjectPHIDs(true)\n      ->executeOne();\n    if (!$task) {\n      throw new ConduitException('ERR_BAD_TASK');\n    }\n\n    return $this->buildTaskInfoDictionary($task);\n  }\n\n}\n","sourceCodeStart":31,"sourceCodeEnd":56,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/maniphest/conduit/ManiphestInfoConduitAPIMethod.php#L31-L56","documentation":"The Conduit method maniphest.info loads the task with ManiphestTaskQuery->withIDs(array($task_id)) as the requesting user; when the query returns no row it throws ConduitException with code ERR_BAD_TASK. That means no task with that numeric ID exists, or the task exists but is not visible to the user owning the Conduit credential.","triggerScenarios":"Calling maniphest.info with task_id 999999 (nonexistent), passing the monogram 'T123' where withIDs() expects the bare numeric ID, or querying a task whose policies exclude the API token's user.","commonSituations":"Scripts that paste 'T123' instead of 123; tasks deleted between fetch and detail call; using a bot token that lacks access to the project the task is in.","solutions":["Pass the numeric ID without the 'T' prefix (task_id: 123, not 'T123').","Check visibility: call maniphest.query with the same credentials and ids to see whether the task is visible at all.","If the task was deleted, stop retrying and fix the upstream ID source."],"exampleFix":"// before\n$result = $conduit->callMethodSynchronous(\n  'maniphest.info',\n  array('task_id' => 'T123'));\n// after\n$result = $conduit->callMethodSynchronous(\n  'maniphest.info',\n  array('task_id' => 123));","handlingStrategy":"try-catch","validationCode":"// Check visibility/existence first with the same credentials:\n$tasks = id(new ManiphestTaskQuery())\n  ->setViewer($viewer)\n  ->withIDs(array((int)$task_id))\n  ->execute();\nif (!$tasks) {\n  // do not call maniphest.info with this id\n  return null;\n}","typeGuard":"function maniphestTaskVisible($viewer, $task_id) {\n  return (bool)id(new ManiphestTaskQuery())\n    ->setViewer($viewer)\n    ->withIDs(array((int)$task_id))\n    ->execute();\n}","tryCatchPattern":"try {\n  $info = $conduit->callMethodSynchronous(\n    'maniphest.info',\n    array('task_id' => (int)$task_id));\n} catch (ConduitException $ex) {\n  if ($ex->getErrorCode() === 'ERR_BAD_TASK') {\n    // nonexistent or invisible task: skip, do not retry\n    $info = null;\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Send the bare numeric ID (123), never the monogram 'T123'.","Normalize task IDs to int and verify with maniphest.query when IDs come from user input or external systems.","Run Conduit calls as a token whose owner can actually see the tasks being queried."],"tags":["conduit","maniphest","phabricator","api","entity-not-found"],"backgroundTag":"conduit-record-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}