{"record":{"id":"6d86cc42d054101e","repo":"phacility/phabricator","slug":"this-repository-is-currently-in-read-only-maintena","errorCode":null,"errorMessage":"This repository is currently in read-only maintenance mode.","messagePattern":"This repository is currently in read-only maintenance mode\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/ssh/DiffusionSSHWorkflow.php","lineNumber":273,"sourceCode":"\n  protected function requireWriteAccess($protocol_command = null) {\n    if ($this->hasWriteAccess === true) {\n      return;\n    }\n\n    $repository = $this->getRepository();\n    $viewer = $this->getSSHUser();\n\n    if ($viewer->isOmnipotent()) {\n      throw new Exception(\n        pht(\n          'This request is authenticated as a cluster device, but is '.\n          'performing a write. Writes must be performed with a real '.\n          'user account.'));\n    }\n\n    if ($repository->isReadOnly()) {\n      throw new Exception($repository->getReadOnlyMessageForDisplay());\n    }\n\n    $protocol = PhabricatorRepositoryURI::BUILTIN_PROTOCOL_SSH;\n    if ($repository->canServeProtocol($protocol, true)) {\n      $can_push = PhabricatorPolicyFilter::hasCapability(\n        $viewer,\n        $repository,\n        DiffusionPushCapability::CAPABILITY);\n      if (!$can_push) {\n        throw new Exception(\n          pht('You do not have permission to push to this repository.'));\n      }\n    } else {\n      if ($protocol_command !== null) {\n        throw new Exception(\n          pht(\n            'This repository is read-only over SSH (tried to execute '.\n            'protocol command \"%s\").',","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php#L255-L291","documentation":"Thrown by DiffusionSSHWorkflow::requireWriteAccess() when an SSH user requests write access to a repository whose 'read-only' detail flag is set. The flag is written by PhabricatorRepositoryMaintenanceTransaction, i.e. an administrator enabled Maintenance Mode on the repository; getReadOnlyMessageForDisplay() prepends this fixed text to any admin-supplied maintenance message. No VCS write over SSH is served while the flag is on.","triggerScenarios":"Any SSH push path (git push over ssh://, hg push, or an svn+ssh session that begins writing) against a repository where the 'read-only' detail is true: an admin turned on Maintenance Mode from the repository edit page, or a maintenance script set it programmatically via setReadOnly(true).","commonSituations":"Admin enabled maintenance before an upgrade or storage migration and forgot to turn it off; maintenance window still open while users retry pushes; flag left set after a manual recovery operation on the repository.","solutions":["Open the repository in Diffusion, edit Maintenance, disable Maintenance Mode, then retry the push","If maintenance is intentional, wait for the window to close and watch the repository timeline for the read-only flag clearing","Confirm you are pushing the intended repository (callsign/URI) - the flag is per-repository, so sibling repositories still accept writes"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if ($repository->isReadOnly()) {\n  // Surface the maintenance message instead of starting a push session.\n  return $repository->getReadOnlyMessageForDisplay();\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check isReadOnly() before advertising or starting push workflows so users fail fast with the maintenance message","Alert on PhabricatorRepositoryMaintenanceTransaction applications so maintenance windows are never forgotten"],"tags":["phabricator","diffusion","ssh","vcs-push","read-only","maintenance-mode"],"backgroundTag":"repository-read-only","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}