I was attempting to clone a repository over HTTP on my dev install, but was getting a 500 returned:
> git clone http://phabricator.local/diffusion/TEST/test.git Cloning into 'test'... fatal: unable to access 'http://phabricator.local/diffusion/TEST/test.git/': The requested URL returned error: 500
It took me a while to work this out because there was nothing in the error logs. In order to debug this, I ended up doing this:
--- i/src/aphront/AphrontController.php +++ w/src/aphront/AphrontController.php @@ -68,7 +68,11 @@ abstract class AphrontController extends Phobject { $controller->setCurrentApplication($application); } - return $controller->handleRequest($request); + $response = $controller->handleRequest($request); + + if ($response instanceof PhabricatorVCSResponse) { + phlog($response->getMessage()); + } } final public function setCurrentApplication(
After doing this, I got some useful information in the error log:
2015/10/31 05:19:15 [error] 2161#0: *156 FastCGI sent in stderr: "PHP message: [2015-10-31 16:19:15] PHLOG: 'Error 1: sudo: a password is required ' at [/usr/src/phabricator/src/aphront/AphrontController.php:74] PHP message: [2015-10-31 16:19:15] EXCEPTION: (InvalidArgumentException) Argument 1 passed to AphrontView::setUser() must be an instance of PhabricatorUser, null given, called in /usr/src/phabricator/src/aphront/response/Aphront404Response.php on line 14 and defined at [<phutil>/src/error/PhutilErrorHandler.php:200] PHP message: arcanist(head=master, ref.master=baf5eb8a8795), phabricator(head=master, ref.master=98a301a59b1d), phutil(head=master, ref.master=59f5a8d2bb82) PHP message: #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<phabricator>/src/view/AphrontView.php:19] PHP message: #1 <#2> AphrontView::setUser(NULL) called at [<phabricator>/src/aphront/response/Aphront404Response.php:14] PHP message: #2 <#2> Aphront404Response::buildResponseString() called at [<phabricator>/src/aphront/response/AphrontResponse.php:26] PHP message: #3 <#2> AphrontResponse::getContentIterator() called at [<phabricator>/src/aphront/sink/AphrontHTTPSink.php:102] PHP message: #4 <#2> AphrontHTTPSink::writeResponse(Aphront404Response) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:274] PHP message: #5 <#2> AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:149] PHP message: #6 <#2> AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:17] PHP message: #7 phlog(InvalidArgumentException) called at [<phabricator>/src/aphront/response/AphrontUnhandledExceptionResponse.php:20] PHP message: #8 AphrontUnhandledExceptionResponse::setException(InvalidArgumentException) called at [<phabricator>/webroot/index.php:21]" while