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
- Start the daemons with bin/phd start and watch the Daemon Console for the cloning task
- Force clone/update directly: bin/repository update <callsign>
- Check the daemon logs in the Daemon Console for clone errors (remote auth, disk space, timeouts)
- 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
- Run bin/phd start as part of deployment and verify with bin/phd status
- After adding repositories, confirm the clone completes in the Daemon Console
- On cluster nodes, ensure each node clones before it receives routed traffic
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
- The clone of this repository ("%s") on the local machine ("%
- Config option "phd.user" is not set. You must set this optio
- Commit "%s" does not exist.
- Commit "%s" is not valid.
- To search for commits which are ancestors of particular refs
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/a33f58c5eed8ad78.
Report an issue: GitHub.