phacility/phabricator · error · Exception

Project depth is too great.

Error message

Project depth is too great.

What it means

Raised in PhabricatorProject::save() when computing the project path: the project's nesting depth equals or exceeds getProjectDepthLimit(). Deeply nested (parent chain too long) projects cannot be saved, preventing unbounded hierarchy growth.

Solutions

  1. Flatten the hierarchy by moving the project to a shallower parent.
  2. Reorganize deeply nested subprojects so no chain exceeds the depth limit.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/project/storage/PhabricatorProject.php:434 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/bea53bd21e9e7fdf. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/project/storage/PhabricatorProject.php:434

    if ($path_key === null || $path_key === '') {
      $hash = PhabricatorHash::digestForIndex($this->getPHID());
      $hash = substr($hash, 0, 4);
      $this->setProjectPathKey($hash);
    }

    $path = array();
    $depth = 0;
    if ($this->parentProjectPHID) {
      $parent = $this->getParentProject();
      $path[] = $parent->getProjectPath();
      $depth = $parent->getProjectDepth() + 1;
    }
    $path[] = $this->getProjectPathKey();
    $path = implode('', $path);

    $limit = self::getProjectDepthLimit();
    if ($depth >= $limit) {
      throw new Exception(pht('Project depth is too great.'));
    }

    $this->setProjectPath($path);
    $this->setProjectDepth($depth);

    $this->openTransaction();
      $result = parent::save();
      $this->updateDatasourceTokens();
    $this->saveTransaction();

    return $result;
  }

  public static function getProjectDepthLimit() {
    // This is limited by how many path hashes we can fit in the path
    // column.
    return 16;
  }

View on GitHub (pinned to 5720a38cfe)