phacility/phabricator · error · Exception

You can not close this revision because it has already been…

Error message

You can not close this revision because it has already been closed. Only open revisions can be closed.

What it means

State-machine guard inside DifferentialRevisionCloseTransaction::validateAction(): the manual close action is rejected because the revision is already in a closed status. Note the preceding editor check: when the editor flags isCloseByCommit (Phabricator discovered the landed commit, see T13300) validation is bypassed entirely; this error therefore only fires on user-initiated closes of already-closed revisions.

Solutions

  1. Inspect the revision history to confirm how it was closed (usually automatically when the commit landed)
  2. If the wrong commit closed it, correct the underlying repository/commit association rather than closing again
  3. Create a new revision for follow-up changes instead of trying to re-close the existing one
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php:67 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/7ad5a17b9b23e55b. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php:67

      $was_accepted);

    // See T13300. When a revision is closed, we promote it out of "Draft"
    // immediately. This usually happens when a user creates a draft revision
    // and then lands the associated commit before the revision leaves draft.
    $object->setShouldBroadcast(true);
  }

  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 '.

View on GitHub (pinned to 5720a38cfe)