Page MenuHomePhabricator

Difficulty debugging sudo permissions
Closed, DuplicatePublic

Description

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

Event Timeline

joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Diffusion.
joshuaspence added a subscriber: joshuaspence.

Does GIT_CURL_VERBOSE=1 git clone http://phabricator.local/diffusion/TEST/test.gitdoesn't give you useful informations ?

joshuaspence renamed this task from Difficultly debugging sudo permissions to Difficulty debugging sudo permissions.Nov 1 2015, 8:28 PM
GIT_CURL_VERBOSE=1 git clone http://phabricator.local/diffusion/TEST/test.git
Cloning into 'test'...
* Couldn't find host phabricator.local in the .netrc file; using defaults
* Hostname was NOT found in DNS cache
*   Trying 10.0.0.100...
* Connected to phabricator.local (10.0.0.100) port 80 (#0)
> GET /diffusion/TEST/test.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/2.5.0
Host: phabricator.local
Accept: */*
Accept-Encoding: gzip
Accept-Language: en-US, en;q=0.9, *;q=0.8
Pragma: no-cache

< HTTP/1.1 500 Internal Server Error
* Server nginx is not blacklisted
< Server: nginx
< Date: Sun, 01 Nov 2015 20:32:44 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Frame-Options: Deny
< Cache-Control: private, no-cache, no-store, must-revalidate
< Pragma: no-cache
< Expires: Sat, 01 Jan 2000 00:00:00 GMT
< X-Content-Type-Options: nosniff
< 
* Connection #0 to host phabricator.local left intact
fatal: unable to access 'http://phabricator.local/diffusion/TEST/test.git/': The requested URL returned error: 500