phacility/phabricator · warning · Exception
Repository "%s" does not have a working copy on this device
Error message
Repository "%s" does not have a working copy on this device yet, so it can not be synchronized. Wait for the daemons to construct one or run `bin/repository update %s` on this host ("%s") to build it explicitly. What it means
requireWorkingCopy() asserts that the repository's local storage path exists on this device before any synchronization or discovery work. The path is missing, so the working copy has never been constructed on this host (or the storage disk was wiped/moved), and the engine tells you exactly how to build it.
Source
Thrown at src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php:865
/**
* @task internal
*/
private function logText($message) {
$log = $this->logger;
if ($log) {
$log->writeClusterEngineLogMessage($message);
}
return $this;
}
private function requireWorkingCopy() {
$repository = $this->getRepository();
$local_path = $repository->getLocalPath();
if (!Filesystem::pathExists($local_path)) {
$device = AlmanacKeys::getLiveDevice();
throw new Exception(
pht(
'Repository "%s" does not have a working copy on this device '.
'yet, so it can not be synchronized. Wait for the daemons to '.
'construct one or run `bin/repository update %s` on this host '.
'("%s") to build it explicitly.',
$repository->getDisplayName(),
$repository->getMonogram(),
$device->getName()));
}
}
private function logActiveWriter(
PhabricatorUser $viewer,
PhabricatorRepository $repository) {
$writer = PhabricatorRepositoryWorkingCopyVersion::loadWriter(
$repository->getPHID());
if (!$writer) {View on GitHub (pinned to 5720a38cfe)
Solutions
- Run 'bin/repository update <monogram>' on that host to build the working copy explicitly
- Or wait for the daemons to construct it and watch bin/phd logs for that repository until the clone completes
- If storage was wiped accidentally, verify the repository's local path configuration points at the correct disk before rebuilding
Defensive patterns
Strategy: validation
Validate before calling
$local_path = $repository->getLocalPath();
if (!Filesystem::pathExists($local_path)) {
// run bin/repository update on this host, or defer the job until daemons build the copy
} Type guard
function hasWorkingCopy(PhabricatorRepository $repo) {
return Filesystem::pathExists($repo->getLocalPath());
} Try / catch
try {
$engine->synchronizeWorkingCopyBeforeRead();
} catch (Exception $ex) {
// reschedule the job after provisioning instead of failing the repository
} Prevention
- Provision working copies (bin/repository update) before binding a new device into service
- Verify local path disk configuration on new hosts before daemons start importing
When it happens
Trigger: A cluster sync or discovery job reaches a device where the repository's local path does not exist: typically a newly bound device whose daemons have not cloned the repository yet, or a host whose storage directory was deleted or misconfigured.
Common situations: Adding a new cluster node and job schedulers racing the initial clone; accidentally wiping storage; fresh hosts where the repository daemon is still mid-import.
Related errors
- This host has device ID "%s", but there is no corresponding
- Configuration file specifies cluster peer ("%s", at index "%
- Configuration file specifies cluster peer "%s" more than onc
- Failed to load repository cluster service.
- Failed to acquire read lock after waiting %s second(s). You
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/e8d08256961da8b0.
Report an issue: GitHub.