phacility/phabricator · error · Exception
exited with a zero exit code, but emitted output consistent…
Error message
%s exited with a zero exit code, but emitted output consistent with failure under OSX.
What it means
Heuristic guard in executeDaemonLaunchCommand(): after a sudo launch, the command exited 0 but its output matches the signature of OSX's sudo failing silently (sudo -n exits zero when passwordless switching is disallowed). The workflow deliberately treats the launch as failed despite the success exit code.
Solutions
- Configure NOPASSWD sudo for the daemon user in /etc/sudoers
- Run the daemon launch as the target user directly instead of via sudo
- Pass --as-current-user to skip the sudo switch
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:218 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/bfbb735da56c862a.
Report an issue: GitHub.
Appendix: source
Thrown at src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php:218
$command = csprintf(
'sudo -En -u %s -- %C',
$run_as_user,
$command);
$is_sudo = true;
}
$future = new ExecFuture('exec %C', $command);
// Play games to keep 'ps' looking reasonable.
$future->setCWD($daemon_script_dir);
$future->write(json_encode($config));
list($stdout, $stderr) = $future->resolvex();
if ($is_sudo) {
// On OSX, `sudo -n` exits 0 when the user does not have permission to
// switch accounts without a password. This is not consistent with
// sudo on Linux, and seems buggy/broken. Check for this by string
// matching the output.
if (preg_match('/sudo: a password is required/', $stderr)) {
throw new Exception(
pht(
'%s exited with a zero exit code, but emitted output '.
'consistent with failure under OSX.',
'sudo'));
}
}
}
public static function ignoreSignal($signo) {
return;
}
public static function requireExtensions() {
self::mustHaveExtension('pcntl');
self::mustHaveExtension('posix');
}
private static function mustHaveExtension($ext) {View on GitHub (pinned to 5720a38cfe)