{"record":{"id":"dd760deea09283d9","repo":"phacility/phabricator","slug":"you-are-trying-to-run-a-daemon-as-a-nonstandard-us","errorCode":null,"errorMessage":"You are trying to run a daemon as a nonstandard user, and `%s` was not able to `%s` to the correct user. \nThe daemons are configured to run as \"%s\", but the current user is \"%s\". \nUse `%s` to run as a different user, pass `%s` to ignore this warning, or edit `%s` to change the configuration.","messagePattern":"You are trying to run a daemon as a nonstandard user, and `(.+?)` was not able to `(.+?)` to the correct user\\. \nThe daemons are configured to run as \"(.+?)\", but the current user is \"(.+?)\"\\. \nUse `(.+?)` to run as a different user, pass `(.+?)` to ignore this warning, or edit `(.+?)` to change the configuration\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php","lineNumber":92,"sourceCode":"    $run_as_current_user = false) {\n\n    // Convert any shorthand classnames like \"taskmaster\" into proper class\n    // names.\n    foreach ($daemons as $key => $daemon) {\n      $class = $this->findDaemonClass($daemon['class']);\n      $daemons[$key]['class'] = $class;\n    }\n\n    $console = PhutilConsole::getConsole();\n\n    if (!$run_as_current_user) {\n      // Check if the script is started as the correct user\n      $phd_user = PhabricatorEnv::getEnvConfig('phd.user');\n      $current_user = posix_getpwuid(posix_geteuid());\n      $current_user = $current_user['name'];\n      if ($phd_user && $phd_user != $current_user) {\n        if ($debug) {\n          throw new PhutilArgumentUsageException(\n            pht(\n              \"You are trying to run a daemon as a nonstandard user, \".\n              \"and `%s` was not able to `%s` to the correct user. \\n\".\n              'The daemons are configured to run as \"%s\", '.\n              'but the current user is \"%s\". '.\"\\n\".\n              'Use `%s` to run as a different user, pass `%s` to ignore this '.\n              'warning, or edit `%s` to change the configuration.',\n              'phd',\n              'sudo',\n              $phd_user,\n              $current_user,\n              'sudo',\n              '--as-current-user',\n              'phd.user'));\n        } else {\n          $this->runDaemonsAsUser = $phd_user;\n          $console->writeOut(pht('Starting daemons as %s', $phd_user).\"\\n\");\n        }","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php#L74-L110","documentation":"Error \"You are trying to run a daemon as a nonstandard user, and `%s` was not able to `%s` to the correct user. \nThe daemons are configured to run as \"%s\", but the current user is \"%s\". \nUse `%s` to run as a different user, pass `%s` to ignore this warning, or edit `%s` to change the configuration.\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:92 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"}