{"record":{"id":"defa317440f608f2","repo":"phacility/phabricator","slug":"err-closed","errorCode":"ERR_CLOSED","errorMessage":"ERR_CLOSED","messagePattern":"ERR_CLOSED","errorType":"error_code","errorClass":"ConduitException","httpStatus":null,"severity":"error","filePath":"src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php","lineNumber":73,"sourceCode":"    }\n\n    $revision = id(new DifferentialRevisionQuery())\n      ->setViewer($request->getUser())\n      ->withIDs(array($request->getValue('id')))\n      ->needReviewers(true)\n      ->needActiveDiffs(true)\n      ->requireCapabilities(\n        array(\n          PhabricatorPolicyCapability::CAN_VIEW,\n          PhabricatorPolicyCapability::CAN_EDIT,\n        ))\n      ->executeOne();\n    if (!$revision) {\n      throw new ConduitException('ERR_BAD_REVISION');\n    }\n\n    if ($revision->isPublished()) {\n      throw new ConduitException('ERR_CLOSED');\n    }\n\n    $this->applyFieldEdit(\n      $request,\n      $revision,\n      $diff,\n      $request->getValue('fields', array()),\n      $request->getValue('message'));\n\n    return array(\n      'revisionid'  => $revision->getID(),\n      'uri'         => PhabricatorEnv::getURI('/D'.$revision->getID()),\n    );\n  }\n\n}\n","sourceCodeStart":55,"sourceCodeEnd":90,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php#L55-L90","documentation":"Once a revision isPublished() — its change landed and the revision was closed — differential.updaterevision refuses further edits and throws ERR_CLOSED before applying any field edit. In Differential's model a closed revision is a historical record; new work requires a new revision.","triggerScenarios":"Calling differential.updaterevision on a revision that was closed by arc land, by commit detection, or by a manual close action.","commonSituations":"Automation retrying an update after the branch already landed; developers who keep working on a topic after landing and push updates to the old revision.","solutions":["Create a new revision for follow-up changes instead of updating the closed one.","If the close itself was wrong, reopen the revision first (the revision 'Reopen' command/action) and retry.","Guard the call: load the revision and skip when its status is published/closed."],"exampleFix":"// before\n$client->callMethodSynchronous('differential.updaterevision', $params);\n\n// after\n$result = $client->callMethodSynchronous('differential.revision.search', array(\n  'constraints' => array('ids' => array($revision_id)),\n));\n$status = idx(idx(idx($result, 'data', array()), 0, array()), 'fields', array());\nif (idx(idx($status, 'status', array()), 'value') === 'published') {\n  // closed: create a new revision instead\n  return;\n}\n$client->callMethodSynchronous('differential.updaterevision', $params);","handlingStrategy":"validation","validationCode":"$result = $client->callMethodSynchronous('differential.revision.search', array(\n  'constraints' => array('ids' => array($revision_id)),\n));\n$revision = idx(idx($result, 'data', array()), 0, array());\n$status_value = idx(idx(idx($revision, 'fields', array()), 'status', array()), 'value');\nif ($status_value === 'published') {\n  // closed: create a new revision instead of updating\n  return;\n}","typeGuard":null,"tryCatchPattern":"try {\n  $result = $client->callMethodSynchronous(\n    'differential.updaterevision', $params);\n} catch (ConduitClientException $ex) {\n  if ($ex->getErrorCode() === 'ERR_CLOSED') {\n    // permanent for this revision: create a new revision, do not retry\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Treat closed revisions as immutable; create a new revision for follow-up work.","Check the revision status before attempting updates.","Never retry ERR_CLOSED — it only clears if an admin reopens the revision."],"tags":["phabricator","conduit","differential","revision-closed"],"backgroundTag":"resource-already-closed","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}