Page MenuHomePhabricator

When problems occur in phd inside sudo error messages are neither printed nor logged
Closed, InvalidPublic

Description

In function launchDaemons in PhabricatorDaemonManagementWorkflow.php when something fails inside the
sudo or more precisely inside the executeDaemonLaunchCommand method the error message is not very helpful:

sudo command failed. Starting daemon as current user.

No further information included and daemon.log is empty. It would be very helpful if the Exception message is printed
like in the snipped below (this was just a hack I added to find out whats going on:

try {
  $this->executeDaemonLaunchCommand(
    $command,
    $daemon_script_dir,
    $config,
    $this->runDaemonsAsUser);
} catch (Exception $e) {
  // Retry without sudo
  $console->writeOut(
    "%s\n",
    pht(
      '%s command failed. Starting daemon as current user. Exception: %s',
      'sudo', $e->getMessage()));
  $this->executeDaemonLaunchCommand(
    $command,
    $daemon_script_dir,
    $config);

With this the error message is:

sudo command failed. Starting daemon as current user. Exception: Command failed with error #255!
COMMAND
exec sudo -En -u 'phd-user' -- ./phd-daemon 

STDOUT
(empty)

STDERR
[2017-01-04 13:34:31] EXCEPTION: (Exception) Specified daemon PID directory ('/var/tmp/phd/pid') does not exist or is not writable by the daemon user! at [<phutil>/src/daemon/PhutilDaemonOverseer.php:114]
arcanist(), phabricator(), phutil()
  #0 PhutilDaemonOverseer::__construct(array) called at [<phabricator>/scripts/daemon/launch_daemon.php:11]

No very nicely formatted but points to the root cause.

Event Timeline

What version of Phabricator are you running? See Providing Version Information for help.

This doesn't appear to be a valid Feature Request or Bug Report. See Support Resources for how to get support using Phabricator.

Specifically, this was already improved by D15726 in April 2016.

  • Please include version information when you file reports.
  • Please make sure you are up to date before filing reports.

Sorry for wasting your time. For the record:

Not sure why but this installation doesn't show the easy way what versions it has.

Current Versions
phabricator Unknown
arcanist Unknown
phutil Unknown

It was installed from a FreeBSD package which seem to be quite old php5-phabricator-20151220 there is a much newer one
having 20161003 its it name but we started with this old one and I'd really rather finish setting this up completely (we started with it before
the new version was out) before upgrading to a newer version.

It was installed from a FreeBSD package

In the future, also note that we can only provide support for installs using our install instructions, per Contributing Bug Reports:

We do NOT support third-party packages or instructions. If you installed Phabricator (or configured some aspect of it) using a third-party package or by following a third-party guide (like a blog post), we can not help you. Phabricator changes quickly and third-party information is unreliable and often falls out of date. Contact the maintainer of the package or guide you used, or reinstall following the upstream instructions.

If you have an issue with a third-party package, you should ask the package maintainer for help, not us. If you want to be able to file bug reports and feature requests against this upstream, you must follow our install instructions. We get a lot of reports like this one, which report issues we've already fixed, or install problems with packages we didn't write, don't maintain, can't reproduce, have nothing to do with us, and which we can't fix anyway, which is why Contributing Bug Reports asks you to please not file reports like this.

Thanks for the warm welcome to the community

I'm sorry you found this interaction frustrating. How would you prefer we have handled it?