{"record":{"id":"959d2d13797df537","repo":"phacility/phabricator","slug":"this-server-is-configured-in-cluster-mode-with-mu","errorCode":null,"errorMessage":"This server is configured in cluster mode, with multiple database hosts. Use \"--host\" to specify which host you want to operate on.","messagePattern":"This server is configured in cluster mode, with multiple database hosts\\. Use \"--host\" to specify which host you want to operate on\\.","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php","lineNumber":48,"sourceCode":"    }\n\n    if (!$results) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'This command only operates on database masters, but the selected '.\n          'database hosts do not include any masters.'));\n    }\n\n    return $results;\n  }\n\n  final public function getSingleAPI() {\n    $apis = $this->getAPIs();\n    if (count($apis) == 1) {\n      return head($apis);\n    }\n\n    throw new PhutilArgumentUsageException(\n      pht(\n        'This server is configured in cluster mode, with multiple database '.\n        'hosts. Use \"--host\" to specify which host you want to operate on.'));\n  }\n\n  final public function getAPIs() {\n    return $this->apis;\n  }\n\n  final protected function isDryRun() {\n    return $this->dryRun;\n  }\n\n  final protected function setDryRun($dry_run) {\n    $this->dryRun = $dry_run;\n    return $this;\n  }\n","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php#L30-L66","documentation":"PhabricatorStorageManagementWorkflow::getSingleAPI() requires exactly one database API but got several: this install resolves to multiple database hosts (cluster mode). Single-host operations — such as `renamespace --live`, which dumps one specific database — refuse to guess which host you mean and demand `--host`.","triggerScenarios":"Running a workflow that calls getSingleAPI() (for example renamespace with `--live`) on an install with multiple database refs configured, without passing `--host`, so count($apis) != 1.","commonSituations":"First use of renamespace --live on a clustered production install; adding a replica to the configuration and forgetting that single-host commands now need --host.","solutions":["Add `--host <ref-key>` naming the exact database host to operate on.","List available hosts with `./bin/storage status` or read the ref keys from the cluster configuration.","For renamespace specifically, skip --live: mysqldump the host yourself and pass `--input <dump>` — the --input path never selects a host."],"exampleFix":"# before\n./bin/storage renamespace --live --from a --to b --output out.sql\n\n# after\n./bin/storage renamespace --live --host db-master-01 --from a --to b --output out.sql","handlingStrategy":"validation","validationCode":"[ -n \"$HOST\" ] || { echo 'error: set HOST (--host) for cluster installs' >&2; exit 2; }\n./bin/storage renamespace --live --host \"$HOST\" --from \"$FROM\" --to \"$TO\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --host on installs with more than one database ref.","Prefer the --input path (dump the host yourself) for scripted renamespace runs."],"tags":["phabricator","bin-storage","cluster","host-selection","usage-error"],"backgroundTag":"ambiguous-database-host","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}