{"record":{"id":"75c7ed622cfbf0bc","repo":"phacility/phabricator","slug":"the-clone-of-this-repository-s-on-the-local-m","errorCode":null,"errorMessage":"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.","messagePattern":"The clone of this repository \\(\"(.+?)\"\\) on the local machine \\(\"(.+?)\"\\) could not be read\\. Ensure that the repository is in a location where the web server has read permissions\\.","errorType":"exception","errorClass":"DiffusionSetupException","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/request/DiffusionRequest.php","lineNumber":552,"sourceCode":"\n  /**\n   * Check that the working copy of the repository is present and readable.\n   *\n   * @param   string  Path to the working copy.\n   */\n  protected function validateWorkingCopy($path) {\n    if (!is_readable(dirname($path))) {\n      $this->raisePermissionException();\n    }\n\n    if (!Filesystem::pathExists($path)) {\n      $this->raiseCloneException();\n    }\n  }\n\n  protected function raisePermissionException() {\n    $host = php_uname('n');\n    throw new DiffusionSetupException(\n      pht(\n        'The clone of this repository (\"%s\") on the local machine (\"%s\") '.\n        'could not be read. Ensure that the repository is in a '.\n        'location where the web server has read permissions.',\n        $this->getRepository()->getDisplayName(),\n        $host));\n  }\n\n  protected function raiseCloneException() {\n    $host = php_uname('n');\n    throw new DiffusionSetupException(\n      pht(\n        'The working copy for this repository (\"%s\") has not been cloned yet '.\n        'on this machine (\"%s\"). Make sure you have started the '.\n        'daemons. If this problem persists for longer than a clone should '.\n        'take, check the daemon logs (in the Daemon Console) to see if there '.\n        'were errors cloning the repository. Consult the \"Diffusion User '.\n        'Guide\" in the documentation for help setting up repositories.',","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/request/DiffusionRequest.php#L534-L570","documentation":"Before serving a repository, DiffusionRequest::validateWorkingCopy checks that the parent directory of the repository's local path is readable. If is_readable(dirname($path)) fails, raisePermissionException throws this DiffusionSetupException naming the repository and host: the web server or daemon user cannot even traverse the storage directory.","triggerScenarios":"Browsing or serving a repository whose storage directory (or an ancestor of it) has permissions excluding the webserver/daemon user — for example a root-owned 0700 repository root created during setup.","commonSituations":"Storage root created by root with a restrictive umask; storage moved to a new mount; daemons running as a different user than expected; NFS root-squash hiding ownership.","solutions":["Identify the effective daemon and webserver users (bin/phd status, webserver config) and the local path (repository.default-local-path)","Fix ownership and permissions: chown -R <daemon-user> <repo-root> and chmod -R u+rwX,go+rX <repo-root>","Verify as the service user: sudo -u <webserver-user> ls -la <parent-dir>","On NFS, review mount options and root-squash behavior"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Check storage readability before rendering the repository\n$local_path = $repository->getLocalPath();\nif (!is_readable(dirname($local_path))) {\n  // show the setup/permissions guidance instead of hitting the exception\n}","typeGuard":null,"tryCatchPattern":"try {\n  $request->validateRepository();\n} catch (DiffusionSetupException $ex) {\n  // Render the dedicated setup-error page with the remediation steps\n  return $this->newDialog()->setTitle($ex->getMessage());\n}","preventionTips":["Provision repository storage with ownership for the daemon/webserver users from day one","Verify readability as the service user after any storage migration","Monitor for DiffusionSetupException in logs as an early permissions tripwire"],"tags":["permissions","setup","diffusion","filesystem"],"backgroundTag":"repository-permissions","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}