phacility/phabricator · error · PhabricatorSearchConstraintException

The specified "Occurs Before" date is earlier in time than…

Error message

The specified "Occurs Before" date is earlier in time than the specified "Occurs After" date, so this query can never match any results.

What it means

Range-consistency check in buildQueryFromParameters: both 'Occurs After' (rangeStart) and 'Occurs Before' (rangeEnd) were supplied and the start epoch is greater than the end epoch, producing an empty, unsatisfiable window. Thrown as PhabricatorSearchConstraintException so the UI can report the contradictory filter rather than return zero rows silently.

Solutions

  1. Correct the date range so 'Occurs After' precedes 'Occurs Before'
  2. Clear one of the two bounds if only an open-ended range is intended
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/feed/query/PhabricatorFeedSearchEngine.php:92 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/45725363149eabc2. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/feed/query/PhabricatorFeedSearchEngine.php:92

    }

    if ($phids) {
      $query->withFilterPHIDs($phids);
    }

    $range_min = $map['rangeStart'];
    if ($range_min) {
      $range_min = $range_min->getEpoch();
    }

    $range_max = $map['rangeEnd'];
    if ($range_max) {
      $range_max = $range_max->getEpoch();
    }

    if ($range_min && $range_max) {
      if ($range_min > $range_max) {
        throw new PhabricatorSearchConstraintException(
          pht(
            'The specified "Occurs Before" date is earlier in time than the '.
            'specified "Occurs After" date, so this query can never match '.
            'any results.'));
      }
    }

    if ($range_min || $range_max) {
      $query->withEpochInRange($range_min, $range_max);
    }

    return $query;
  }

  protected function getURI($path) {
    return '/feed/'.$path;
  }

View on GitHub (pinned to 5720a38cfe)