phacility/phabricator · error · DiffusionSetupException

The working copy for this repository ("%s") has not been clo

Error message

The working copy for this repository ("%s") has not been cloned yet on this machine ("%s"). Make sure you have started the daemons. If this problem persists for longer than a clone should take, check the daemon logs (in the Daemon Console) to see if there were errors cloning the repository. Consult the "Diffusion User Guide" in the documentation for help setting up repositories.

What it means

If the parent directory is readable but the repository directory itself does not exist (Filesystem::pathExists fails), raiseCloneException throws this DiffusionSetupException: the working copy has not been cloned on this machine yet, and the message points at the daemons because the repository daemon performs clones.

Source

Thrown at src/applications/diffusion/request/DiffusionRequest.php:563

    if (!Filesystem::pathExists($path)) {
      $this->raiseCloneException();
    }
  }

  protected function raisePermissionException() {
    $host = php_uname('n');
    throw new DiffusionSetupException(
      pht(
        'The clone of this repository ("%s") on the local machine ("%s") '.
        'could not be read. Ensure that the repository is in a '.
        'location where the web server has read permissions.',
        $this->getRepository()->getDisplayName(),
        $host));
  }

  protected function raiseCloneException() {
    $host = php_uname('n');
    throw new DiffusionSetupException(
      pht(
        'The working copy for this repository ("%s") has not been cloned yet '.
        'on this machine ("%s"). Make sure you have started the '.
        'daemons. If this problem persists for longer than a clone should '.
        'take, check the daemon logs (in the Daemon Console) to see if there '.
        'were errors cloning the repository. Consult the "Diffusion User '.
        'Guide" in the documentation for help setting up repositories.',
        $this->getRepository()->getDisplayName(),
        $host));
  }

  private function queryStableCommit() {
    $types = array();
    if ($this->symbolicCommit) {
      $ref = $this->symbolicCommit;
    } else {
      if ($this->supportsBranches()) {
        $ref = $this->getBranch();

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Start the daemons with bin/phd start and watch the Daemon Console for the cloning task
  2. Force clone/update directly: bin/repository update <callsign>
  3. Check the daemon logs in the Daemon Console for clone errors (remote auth, disk space, timeouts)
  4. Confirm repository.default-local-path points where the daemons actually write
Defensive patterns

Strategy: validation

Validate before calling

// Detect a missing working copy before serving the request
if (!Filesystem::pathExists($repository->getLocalPath())) {
  // surface 'clone in progress / start the daemons' guidance
}

Try / catch

try {
  $request->validateRepository();
} catch (DiffusionSetupException $ex) {
  if (preg_match('/has not been cloned yet/', $ex->getMessage())) {
    // poll or prompt the user to start daemons / run bin/repository update
  }
}

Prevention

When it happens

Trigger: Requesting a hosted or imported repository whose local clone was never created on this host — the daemons were never started, the initial clone is still running, or a previous clone failed and left no directory.

Common situations: Fresh installs where bin/phd start was skipped; newly created repositories inside the initial clone window; clones that failed on disk-full or auth errors; cluster nodes that lack their local working copy.

Related errors


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