phacility/phabricator · error · Exception

%s exited with a zero exit code, but emitted output consiste

Error message

%s exited with a zero exit code, but emitted output consistent with failure under OSX.

What it means

Error "%s exited with a zero exit code, but emitted output consistent with failure under OSX." thrown in phacility/phabricator.

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)

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.