Error message is not being logged when unable to connect to the database


Observed Behavior:
Users are reporting that they are seeing the follow error message multiple times per day:

I can see a number of 500s in our nginx access logs, but nothing in the PHP-FPM logs.

Expected Behavior:
I expect to see the error message ($issue->getMessage()) in the PHP-FPM logs, which would help me to diagnose the problem. For now, I have manually applied the following patch:

diff --git src/aphront/configuration/AphrontApplicationConfiguration.php src/aphront/configuration/AphrontApplicationConfiguration.php
index 60b12557c..9c07cd736 100644
--- src/aphront/configuration/AphrontApplicationConfiguration.php
+++ src/aphront/configuration/AphrontApplicationConfiguration.php
@@ -95,6 +95,7 @@ abstract class AphrontApplicationConfiguration extends Phobject {
       $response = PhabricatorSetupCheck::newIssueResponse($issue);
+      phlog($issue->getMessage());
       return self::writeResponse($sink, $response);

Phabricator Version:

Reproduction Steps:

  1. Load Phabricator successfully (so that the setup checks pass)
  2. Revoke the MySQL permissions for the MySQL user that Phabricator is running as.
  3. Tail the PHP-FPM logs whilst attempting to load any page.


Unrelated, but I’m also see a lot of these warnings in our logs:

[13-Dec-2018 00:33:56 Etc/UTC] [2018-12-13 00:33:56] PHLOG: 'UNSAFE: Raw string ("LEFT JOIN") passed to query ("%s %s e_subtask
          ON e_subtask.src = task.phid
          AND e_subtask.type = %s
         %Q %T subtask
           ON e_subtask.dst = subtask.phid
           AND subtask.status IN (%Ls)") for "%Q" conversion. %Q should be passed a query string.' at [/usr/local/src/libphutil/src/xsprintf/qsprintf.php:435]


Thanks, see