{"record":{"id":"2e8f3099007c33a3","repo":"phacility/phabricator","slug":"this-server-is-currently-in-read-only-mode-use","errorCode":null,"errorMessage":"This server is currently in read-only mode. Use --force to override this mode.","messagePattern":"This server is currently in read-only mode\\. Use --force to override this mode\\.","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php","lineNumber":99,"sourceCode":"    assert_instances_of($patches, 'PhabricatorStoragePatch');\n    $this->patches = $patches;\n    return $this;\n  }\n\n  protected function isReadOnlyWorkflow() {\n    return false;\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $this->setDryRun($args->getArg('dryrun'));\n    $this->setForce($args->getArg('force'));\n\n    if (!$this->isReadOnlyWorkflow()) {\n      if (PhabricatorEnv::isReadOnly()) {\n        if ($this->isForce()) {\n          PhabricatorEnv::setReadOnly(false, null);\n        } else {\n          throw new PhutilArgumentUsageException(\n            pht(\n              'This server is currently in read-only mode. Use --force to '.\n              'override this mode.'));\n        }\n      }\n    }\n\n    return $this->didExecute($args);\n  }\n\n  public function didExecute(PhutilArgumentParser $args) {}\n\n  private function loadSchemata(PhabricatorStorageManagementAPI $api) {\n    $query = id(new PhabricatorConfigSchemaQuery());\n\n    $ref = $api->getRef();\n    $ref_key = $ref->getRefKey();\n","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php#L81-L117","documentation":"The Phabricator environment is in read-only mode (PhabricatorEnv::isReadOnly(), typically because database masters are unreachable or an operator enabled it) and the workflow is a writing one. Without `--force` the tool refuses to clear the flag and aborts, which protects a degraded cluster from accidental writes. With `--force` it clears the flag (PhabricatorEnv::setReadOnly(false, null)) and proceeds.","triggerScenarios":"Running any non-read-only `bin/storage` workflow while the environment reports read-only, without `--force`, so the !isReadOnlyWorkflow() branch throws.","commonSituations":"Storage commands during disaster recovery while only replicas are up; read-only mode left enabled after maintenance; masters down or misconfigured so the install declares itself read-only.","solutions":["Fix the reason the install is read-only (restore master availability, clear the read-only setting) — that is usually the real problem.","If writing is intentional (for example local recovery), re-run the command with `--force`.","Before forcing on a cluster, confirm no replicas will diverge from the writes you are about to make."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (PhabricatorEnv::isReadOnly()) {\n  // resolve the read-only cause, or deliberately pass --force\n  fwrite(STDERR, \"install is read-only; refusing storage workflow\\n\");\n  exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check install health (master availability) before maintenance commands.","Treat --force as a deliberate recovery action, not a default flag in scripts."],"tags":["phabricator","bin-storage","read-only","cluster","maintenance"],"backgroundTag":"server-read-only-mode","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}