{"record":{"id":"e8d08256961da8b0","repo":"phacility/phabricator","slug":"repository-s-does-not-have-a-working-copy-on-th","errorCode":null,"errorMessage":"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.","messagePattern":"Repository \"(.+?)\" 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 (.+?)` on this host \\(\"(.+?)\"\\) to build it explicitly\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php","lineNumber":865,"sourceCode":"  /**\n   * @task internal\n   */\n  private function logText($message) {\n    $log = $this->logger;\n    if ($log) {\n      $log->writeClusterEngineLogMessage($message);\n    }\n    return $this;\n  }\n\n  private function requireWorkingCopy() {\n    $repository = $this->getRepository();\n    $local_path = $repository->getLocalPath();\n\n    if (!Filesystem::pathExists($local_path)) {\n      $device = AlmanacKeys::getLiveDevice();\n\n      throw new Exception(\n        pht(\n          'Repository \"%s\" does not have a working copy on this device '.\n          'yet, so it can not be synchronized. Wait for the daemons to '.\n          'construct one or run `bin/repository update %s` on this host '.\n          '(\"%s\") to build it explicitly.',\n          $repository->getDisplayName(),\n          $repository->getMonogram(),\n          $device->getName()));\n    }\n  }\n\n  private function logActiveWriter(\n    PhabricatorUser $viewer,\n    PhabricatorRepository $repository) {\n\n    $writer = PhabricatorRepositoryWorkingCopyVersion::loadWriter(\n      $repository->getPHID());\n    if (!$writer) {","sourceCodeStart":847,"sourceCodeEnd":883,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/protocol/DiffusionRepositoryClusterEngine.php#L847-L883","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$local_path = $repository->getLocalPath();\nif (!Filesystem::pathExists($local_path)) {\n  // run bin/repository update on this host, or defer the job until daemons build the copy\n}","typeGuard":"function hasWorkingCopy(PhabricatorRepository $repo) {\n  return Filesystem::pathExists($repo->getLocalPath());\n}","tryCatchPattern":"try {\n  $engine->synchronizeWorkingCopyBeforeRead();\n} catch (Exception $ex) {\n  // reschedule the job after provisioning instead of failing the repository\n}","preventionTips":["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"],"tags":["cluster","working-copy","provisioning","phabricator"],"backgroundTag":"missing-working-copy","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}