{"record":{"id":"7c7c3a4cf2dc7138","repo":"phacility/phabricator","slug":"err-bad-poll","errorCode":"ERR_BAD_POLL","errorMessage":"ERR_BAD_POLL","messagePattern":"ERR_BAD_POLL","errorType":"error_code","errorClass":"ConduitException","httpStatus":null,"severity":"error","filePath":"src/applications/slowvote/conduit/SlowvoteInfoConduitAPIMethod.php","lineNumber":47,"sourceCode":"  }\n\n  protected function defineErrorTypes() {\n    return array(\n      'ERR_BAD_POLL' => pht('No such poll exists.'),\n    );\n  }\n\n  protected function execute(ConduitAPIRequest $request) {\n    $viewer = $this->getViewer();\n\n    $poll_id = $request->getValue('poll_id');\n\n    $poll = id(new PhabricatorSlowvoteQuery())\n      ->setViewer($viewer)\n      ->withIDs(array($poll_id))\n      ->executeOne();\n    if (!$poll) {\n      throw new ConduitException('ERR_BAD_POLL');\n    }\n\n    $result = array(\n      'id'          => $poll->getID(),\n      'phid'        => $poll->getPHID(),\n      'authorPHID'  => $poll->getAuthorPHID(),\n      'question'    => $poll->getQuestion(),\n      'uri'         => PhabricatorEnv::getProductionURI('/V'.$poll->getID()),\n    );\n\n    return $result;\n  }\n\n}\n","sourceCodeStart":29,"sourceCodeEnd":62,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/slowvote/conduit/SlowvoteInfoConduitAPIMethod.php#L29-L62","documentation":"Conduit method slowvote.info loads the poll by ID via PhabricatorSlowvoteQuery under the acting viewer; when no poll loads (nonexistent ID, deleted poll, or a poll the authenticated user cannot see due to policies) it throws ConduitException('ERR_BAD_POLL'), which the Conduit pipeline surfaces to API clients as an error with that code.","triggerScenarios":"Conduit call slowvote.info with {\"poll_id\": N} where N does not exist, was deleted, or is policy-restricted relative to the Conduit token's user.","commonSituations":"Scripts iterating a range of poll IDs that include deleted ones; bot/API tokens whose accounts lack visibility on the poll; carrying IDs between dev and prod environments where they differ.","solutions":["Verify the poll exists at /V<id> in the web UI while logged in as the same account the token belongs to","Discover valid IDs first via slowvote.query under the same credentials","Treat ERR_BAD_POLL as a skip-and-continue condition in iterators instead of aborting","Confirm you passed poll_id (the numeric ID), not a PHID"],"exampleFix":"// before\n$info = $conduit->executeMethod('slowvote.info', array('poll_id' => $id));\n\n// after: confirm visibility first, then fetch\n$polls = $conduit->executeMethod('slowvote.query', array('ids' => array($id)));\nif (!$polls) {\n  continue;\n}\n$info = $conduit->executeMethod('slowvote.info', array('poll_id' => $id));","handlingStrategy":"try-catch","validationCode":"// Discover visible polls under the same credentials before fetching\n$polls = $conduit->executeMethod(\n  'slowvote.query',\n  array('ids' => array($pollId)));\nif (!$polls) {\n  // skip: poll missing or invisible to this token\n}","typeGuard":null,"tryCatchPattern":"try {\n  $info = $conduit->executeMethod('slowvote.info', array('poll_id' => $id));\n} catch (ConduitException $ex) {\n  if ($ex->getMessage() === 'ERR_BAD_POLL') {\n    // nonexistent or not visible: skip and continue the iteration\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Enumerate polls with slowvote.query under the same token before slowvote.info","Handle ERR_BAD_POLL as an expected miss in bulk scripts","Never carry numeric poll IDs between environments; resolve them per install"],"tags":["conduit","api","slowvote","not-found","policy"],"backgroundTag":"entity-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}