phacility/phabricator · error · Exception

Invalid revision ID "%s".

Error message

Invalid revision ID "%s".

What it means

The inline-comment edit controller resolves the revision from the request's revision id. If the policy-filtered query returns no revision, it throws 'Invalid revision ID'. This is a request-construction problem: the ID never identified a visible revision at request time.

Source

Thrown at src/applications/differential/controller/DifferentialInlineCommentEditController.php:27

  protected function newContainerObject() {
    return $this->loadRevision();
  }

  private function getRevisionID() {
    return $this->getRequest()->getURIData('id');
  }

  private function loadRevision() {
    $viewer = $this->getViewer();
    $revision_id = $this->getRevisionID();

    $revision = id(new DifferentialRevisionQuery())
      ->setViewer($viewer)
      ->withIDs(array($revision_id))
      ->executeOne();
   if (!$revision) {
      throw new Exception(pht('Invalid revision ID "%s".', $revision_id));
    }

    return $revision;
  }

  protected function createComment() {
    // Verify revision and changeset correspond to actual objects, and are
    // connected to one another.
    $changeset_id = $this->getChangesetID();
    $viewer = $this->getViewer();

    $revision = $this->loadRevision();

    $changeset = id(new DifferentialChangesetQuery())
      ->setViewer($viewer)
      ->withIDs(array($changeset_id))
      ->executeOne();
    if (!$changeset) {

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Reload the revision page so the form and URI carry fresh, correct IDs.
  2. Verify the revision still exists and is visible to your account.
  3. Do not hand-edit inline comment URIs or replay captured requests.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  // dispatch the inline comment edit request (controller/custom flow)
} catch (Exception $ex) {
  if (preg_match('/Invalid revision ID/', $ex->getMessage())) {
    // stale request: re-fetch the revision URI and retry once with fresh ids
  } else {
    throw $ex;
  }
}

Prevention

When it happens

Trigger: Submitting an inline comment create/edit/done request whose revision id is nonexistent or invisible; stale pages kept open after a revision was deleted; hand-modified URIs or replayed requests.

Common situations: Long-lived browser tabs after revisions were removed; browser extensions or custom front-ends that post to the inline-comment endpoints with stale IDs.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/97e7f30341df529e. Report an issue: GitHub.