phacility/phabricator · error · PhutilArgumentUsageException

Daemons are configured to run as user "%s" in configuration

Error message

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:

%s

What it means

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: %s" thrown in phacility/phabricator.

Source

Thrown at src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:175

      echo "\n    scripts/daemon/ \$ {$command}\n\n";

      $tempfile = new TempFile('daemon.config');
      Filesystem::writeFile($tempfile, json_encode($config));

      phutil_passthru(
        '(cd %s && exec %C < %s)',
        $daemon_script_dir,
        $command,
        $tempfile);
    } else {
      try {
        $this->executeDaemonLaunchCommand(
          $command,
          $daemon_script_dir,
          $config,
          $this->runDaemonsAsUser);
      } catch (Exception $ex) {
        throw new PhutilArgumentUsageException(
          pht(
            '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',
            $phd_user,
            'phd.user',
            $current_user,
            $ex->getMessage()));
      }
    }
  }

  private function executeDaemonLaunchCommand(
    $command,
    $daemon_script_dir,
    array $config,

View on GitHub (pinned to 5720a38cfe)

When it happens

Trigger: Thrown at src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:175 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/23883c8723dbed6c. Report an issue: GitHub.