phacility/phabricator · error · Exception
You can not close this revision because it has not been…
Error message
You can not close this revision because it has not been accepted. Revisions must be accepted before they can be closed.
What it means
Precondition guard inside DifferentialRevisionCloseTransaction::validateAction(): the revision's status is not 'Accepted', so the close action is refused. Phabricator only allows revisions to be closed (manually) after review has concluded with acceptance; closing from 'Needs Review', 'Needs Revision', 'Changes Planned', or 'Draft' is not a permitted transition. Discovery-based closes (isCloseByCommit) return before this check, so this is exclusively a manual-close path failure.
Solutions
- Complete the review first: have the required reviewers accept the revision, then close it
- If review is still in progress, wait or chase reviewers via 'Request Review' instead of closing
- If the change already landed without acceptance, let Phabricautic's commit discovery close the revision automatically rather than closing manually
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php:74 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/97684f1aa5248de5.
Report an issue: GitHub.
Appendix: source
Thrown at src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php:74
protected function validateAction($object, PhabricatorUser $viewer) {
if ($this->hasEditor()) {
if ($this->getEditor()->getIsCloseByCommit()) {
// If we're closing a revision because we discovered a commit, we don't
// care what state it was in.
return;
}
}
if ($object->isClosed()) {
throw new Exception(
pht(
'You can not close this revision because it has already been '.
'closed. Only open revisions can be closed.'));
}
if (!$object->isAccepted()) {
throw new Exception(
pht(
'You can not close this revision because it has not been accepted. '.
'Revisions must be accepted before they can be closed.'));
}
$config_key = 'differential.always-allow-close';
if (!PhabricatorEnv::getEnvConfig($config_key)) {
if (!$this->isViewerRevisionAuthor($object, $viewer)) {
throw new Exception(
pht(
'You can not close this revision because you are not the '.
'author. You can only close revisions you own. You can change '.
'this behavior by adjusting the "%s" setting in Config.',
$config_key));
}
}
}
View on GitHub (pinned to 5720a38cfe)