{"record":{"id":"24cd8fc675556060","repo":"phacility/phabricator","slug":"attempting-to-build-a-repository-command-for-repo","errorCode":null,"errorMessage":"Attempting to build a repository command (for repository \"%s\") as device, but this host (\"%s\") is not configured as a cluster device.","messagePattern":"Attempting to build a repository command \\(for repository \"(.+?)\"\\) as device, but this host \\(\"(.+?)\"\\) is not configured as a cluster device\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/protocol/DiffusionCommandEngine.php","lineNumber":192,"sourceCode":"  private function newCommonEnvironment() {\n    $repository = $this->getRepository();\n\n    $env = array();\n      // NOTE: Force the language to \"en_US.UTF-8\", which overrides locale\n      // settings. This makes stuff print in English instead of, e.g., French,\n      // so we can parse the output of some commands, error messages, etc.\n    $env['LANG'] = 'en_US.UTF-8';\n\n      // Propagate PHABRICATOR_ENV explicitly. For discussion, see T4155.\n    $env['PHABRICATOR_ENV'] = PhabricatorEnv::getSelectedEnvironmentName();\n\n    $as_device = $this->getConnectAsDevice();\n    $credential_phid = $this->getCredentialPHID();\n\n    if ($as_device) {\n      $device = AlmanacKeys::getLiveDevice();\n      if (!$device) {\n        throw new Exception(\n          pht(\n            'Attempting to build a repository command (for repository \"%s\") '.\n            'as device, but this host (\"%s\") is not configured as a cluster '.\n            'device.',\n            $repository->getDisplayName(),\n            php_uname('n')));\n      }\n\n      if ($credential_phid) {\n        throw new Exception(\n          pht(\n            'Attempting to build a repository command (for repository \"%s\"), '.\n            'but the CommandEngine is configured to connect as both the '.\n            'current cluster device (\"%s\") and with a specific credential '.\n            '(\"%s\"). These options are mutually exclusive. Connections must '.\n            'authenticate as one or the other, not both.',\n            $repository->getDisplayName(),\n            $device->getName(),","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/protocol/DiffusionCommandEngine.php#L174-L210","documentation":"Error \"Attempting to build a repository command (for repository \"%s\") as device, but this host (\"%s\") is not configured as a cluster device.\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/diffusion/protocol/DiffusionCommandEngine.php:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}