phacility/phabricator · error · Exception

This event instance has not been created yet. Log in to crea

Error message

This event instance has not been created yet. Log in to create it.

What it means

Thrown by the Calendar event view controller when a recurring-event instance (event PHID + sequence number) does not exist yet and the acting viewer is not logged in. Phabricator creates instance stubs lazily on demand, but only for authenticated users; anonymous visitors get this exception instead of a created instance.

Source

Thrown at src/applications/calendar/controller/PhabricatorCalendarEventViewController.php:580

    if ($event->isChildEvent()) {
      $event = $event->getParentEvent();
    }

    // Try to load the instance. If it already exists, we're all done and
    // can just return it.
    $instance = id(new PhabricatorCalendarEventQuery())
      ->setViewer($viewer)
      ->withInstanceSequencePairs(
        array(
          array($event->getPHID(), $sequence),
        ))
      ->executeOne();
    if ($instance) {
      return $instance;
    }

    if (!$viewer->isLoggedIn()) {
      throw new Exception(
        pht(
          'This event instance has not been created yet. Log in to create '.
          'it.'));
    }

    if (!$event->isValidSequenceIndex($viewer, $sequence)) {
      return null;
    }

    return $event->newStub($viewer, $sequence);
  }

  private function buildSubheaderView(PhabricatorCalendarEvent $event) {
    $viewer = $this->getViewer();

    $host_phid = $event->getHostPHID();

    $handles = $viewer->loadHandles(array($host_phid));

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Log in as a registered user and reload the instance URL - the stub is created on demand via newStub().
  2. When generating links, only link to instances that already exist (verify with calendar.event.search Conduit).
  3. For crawlers/anonymous traffic, exclude instance URIs from indexing or route them to a login prompt.
Defensive patterns

Strategy: validation

Validate before calling

// In a controller or Conduit endpoint, gate before requesting the instance:
if (!$viewer->isLoggedIn()) {
  // return a login redirect / 403 response instead of triggering the throw
  return $this->requireLogin($request)->setConsoleMessage(
    pht('Log in to view or create event instances.'));
}
$instance = $event->newStubIfNeeded($viewer, $sequence);

Try / catch

try {
  $instance = $event->loadInstance($viewer, $sequence);
} catch (Exception $ex) {
  // anonymous viewer hit a not-yet-created instance
  return new Aphront404Response();
}

Prevention

When it happens

Trigger: An anonymous request to a recurring event instance URI like /E123/45 where sequence 45 has never been generated (no row found by withInstanceSequencePairs, and isLoggedIn() is false). Also API/script hits that carry no session cookie.

Common situations: Logged-out users following links to future instances; search-engine crawlers indexing instance URIs; expired sessions; feed/email links to not-yet-created instances.

Related errors


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