{"record":{"id":"23883c8723dbed6c","repo":"phacility/phabricator","slug":"daemons-are-configured-to-run-as-user-s-in-conf","errorCode":null,"errorMessage":"Daemons are configured to run as user \"%s\" in configuration option `%s`, but the current user is \"%s\" and `phd` was unable to switch to the correct user with `sudo`. Command output:\n\n%s","messagePattern":"Daemons are configured to run as user \"(.+?)\" in configuration option `(.+?)`, but the current user is \"(.+?)\" and `phd` was unable to switch to the correct user with `sudo`\\. Command output:\n\n(.+?)","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php","lineNumber":175,"sourceCode":"      echo \"\\n    scripts/daemon/ \\$ {$command}\\n\\n\";\n\n      $tempfile = new TempFile('daemon.config');\n      Filesystem::writeFile($tempfile, json_encode($config));\n\n      phutil_passthru(\n        '(cd %s && exec %C < %s)',\n        $daemon_script_dir,\n        $command,\n        $tempfile);\n    } else {\n      try {\n        $this->executeDaemonLaunchCommand(\n          $command,\n          $daemon_script_dir,\n          $config,\n          $this->runDaemonsAsUser);\n      } catch (Exception $ex) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Daemons are configured to run as user \"%s\" in configuration '.\n            'option `%s`, but the current user is \"%s\" and `phd` was unable '.\n            'to switch to the correct user with `sudo`. Command output:'.\n            \"\\n\\n\".\n            '%s',\n            $phd_user,\n            'phd.user',\n            $current_user,\n            $ex->getMessage()));\n      }\n    }\n  }\n\n  private function executeDaemonLaunchCommand(\n    $command,\n    $daemon_script_dir,\n    array $config,","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php#L157-L193","documentation":"Error \"Daemons are configured to run as user \"%s\" in configuration option `%s`, but the current user is \"%s\" and `phd` was unable to switch to the correct user with `sudo`. Command output:\n\n%s\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:175 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"}