phacility/phabricator · error · Exception

Search constraint "minDepth" must be no larger than search…

Error message

Search constraint "minDepth" must be no larger than search constraint "maxDepth".

What it means

Cross-field validation in the project search engine's buildQueryFromParameters: both minDepth and maxDepth constraints were supplied and minDepth exceeds maxDepth, producing an empty-by-definition depth range.

Solutions

  1. Set minDepth less than or equal to maxDepth in the search query.
  2. Omit one of the two depth constraints if a range is not intended.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/project/query/PhabricatorProjectSearchEngine.php:175 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/33dd9a78311c1f33. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/project/query/PhabricatorProjectSearchEngine.php:175

    if ($map['icons']) {
      $query->withIcons($map['icons']);
    }

    if ($map['colors']) {
      $query->withColors($map['colors']);
    }

    if ($map['isMilestone'] !== null) {
      $query->withIsMilestone($map['isMilestone']);
    }

    $min_depth = $map['minDepth'];
    $max_depth = $map['maxDepth'];

    if ($min_depth !== null || $max_depth !== null) {
      if ($min_depth !== null && $max_depth !== null) {
        if ($min_depth > $max_depth) {
          throw new Exception(
            pht(
              'Search constraint "minDepth" must be no larger than '.
              'search constraint "maxDepth".'));
        }
      }
    }

    if ($map['isRoot'] !== null) {
      if ($map['isRoot']) {
        if ($max_depth === null) {
          $max_depth = 0;
        } else {
          $max_depth = min(0, $max_depth);
        }

        $query->withDepthBetween(null, 0);
      } else {
        if ($min_depth === null) {

View on GitHub (pinned to 5720a38cfe)