phacility/phabricator · warning · PhutilArgumentUsageException

This server is currently in read-only mode. Use --force to o

Error message

This server is currently in read-only mode. Use --force to override this mode.

What it means

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.

Source

Thrown at src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php:99

    assert_instances_of($patches, 'PhabricatorStoragePatch');
    $this->patches = $patches;
    return $this;
  }

  protected function isReadOnlyWorkflow() {
    return false;
  }

  public function execute(PhutilArgumentParser $args) {
    $this->setDryRun($args->getArg('dryrun'));
    $this->setForce($args->getArg('force'));

    if (!$this->isReadOnlyWorkflow()) {
      if (PhabricatorEnv::isReadOnly()) {
        if ($this->isForce()) {
          PhabricatorEnv::setReadOnly(false, null);
        } else {
          throw new PhutilArgumentUsageException(
            pht(
              'This server is currently in read-only mode. Use --force to '.
              'override this mode.'));
        }
      }
    }

    return $this->didExecute($args);
  }

  public function didExecute(PhutilArgumentParser $args) {}

  private function loadSchemata(PhabricatorStorageManagementAPI $api) {
    $query = id(new PhabricatorConfigSchemaQuery());

    $ref = $api->getRef();
    $ref_key = $ref->getRefKey();

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Fix the reason the install is read-only (restore master availability, clear the read-only setting) — that is usually the real problem.
  2. If writing is intentional (for example local recovery), re-run the command with `--force`.
  3. Before forcing on a cluster, confirm no replicas will diverge from the writes you are about to make.
Defensive patterns

Strategy: validation

Validate before calling

if (PhabricatorEnv::isReadOnly()) {
  // resolve the read-only cause, or deliberately pass --force
  fwrite(STDERR, "install is read-only; refusing storage workflow\n");
  exit(2);
}

Prevention

When it happens

Trigger: Running any non-read-only `bin/storage` workflow while the environment reports read-only, without `--force`, so the !isReadOnlyWorkflow() branch throws.

Common situations: 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.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/2e8f3099007c33a3. Report an issue: GitHub.