{"record":{"id":"efb0416a35c2b5d5","repo":"phacility/phabricator","slug":"attempting-to-build-a-repository-command-for-repo-efb041","errorCode":null,"errorMessage":"Attempting to build a repository command (for repository \"%s\"), but the CommandEngine is configured to connect as both the current cluster device (\"%s\") and with a specific credential (\"%s\"). These options are mutually exclusive. Connections must authenticate as one or the other, not both.","messagePattern":"Attempting to build a repository command \\(for repository \"(.+?)\"\\), but the CommandEngine is configured to connect as both the current cluster device \\(\"(.+?)\"\\) and with a specific credential \\(\"(.+?)\"\\)\\. These options are mutually exclusive\\. Connections must authenticate as one or the other, not both\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/protocol/DiffusionCommandEngine.php","lineNumber":202,"sourceCode":"    $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(),\n            $credential_phid));\n      }\n    }\n\n\n    if ($this->isAnySSHProtocol()) {\n      if ($credential_phid) {\n        $env['PHABRICATOR_CREDENTIAL'] = $credential_phid;\n      }\n      if ($as_device) {","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/protocol/DiffusionCommandEngine.php#L184-L220","documentation":"Error \"Attempting to build a repository command (for repository \"%s\"), but the CommandEngine is configured to connect as both the current cluster device (\"%s\") and with a specific credential (\"%s\"). These options are mutually exclusive. Connections must authenticate as one or the other, not both.\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/diffusion/protocol/DiffusionCommandEngine.php:202 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"}