解决phabircator Unable to find `git-http-backend` in $PATH!

git clone 错误如下

[yeqiang@localhost tmp]$ git clone http://127.0.0.1:81/diffusion/2/test.git
Cloning into 'test'...
Username for 'http://127.0.0.1:81': yeq
Password for 'http://[email protected]:81': 
fatal: unable to access 'http://127.0.0.1:81/diffusion/2/test.git/': The requested URL returned error: 500

此时phabircator日志如下:

phabricator_1  | 172.20.0.4:80 172.20.0.1 - - [09/Dec/2019:08:10:16 +0000] "GET /diffusion/2/test.git/info/refs?service=git-upload-pack HTTP/1.1" 401 398 "-" "git/2.23.0"
phabricator_1  | [Mon Dec 09 08:10:21.874127 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010] [2019-12-09 08:10:21] EXCEPTION: (Exception) Unable to find `git-http-backend` in $PATH! at [<phabricator>/src/applications/diffusion/controller/DiffusionServeController.php:546]
phabricator_1  | [Mon Dec 09 08:10:21.874261 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010] arcanist(), phabricator(), phutil()
phabricator_1  | [Mon Dec 09 08:10:21.874266 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010]   #0 <#2> DiffusionServeController::serveGitRequest(PhabricatorRepository, PhabricatorUser) called at [<phabricator>/src/applications/diffusion/controller/DiffusionServeController.php:462]
phabricator_1  | [Mon Dec 09 08:10:21.874267 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010]   #1 <#2> DiffusionServeController::serveVCSRequest(PhabricatorRepository, PhabricatorUser) called at [<phabricator>/src/applications/diffusion/controller/DiffusionServeController.php:395]
phabricator_1  | [Mon Dec 09 08:10:21.874268 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010]   #2 <#2> DiffusionServeController::serveRequest(AphrontRequest) called at [<phabricator>/src/applications/diffusion/controller/DiffusionServeController.php:99]
phabricator_1  | [Mon Dec 09 08:10:21.874269 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010]   #3 <#2> DiffusionServeController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/AphrontController.php:71]
phabricator_1  | [Mon Dec 09 08:10:21.874270 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010]   #4 <#2> AphrontController::delegateToController(DiffusionServeController) called at [<phabricator>/src/applications/diffusion/controller/DiffusionController.php:27]
phabricator_1  | [Mon Dec 09 08:10:21.874271 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010]   #5 <#2> DiffusionController::willBeginExecution() called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:273]
phabricator_1  | [Mon Dec 09 08:10:21.874272 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010]   #6 phlog(Exception) called at [<phabricator>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
phabricator_1  | [Mon Dec 09 08:10:21.874273 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010]   #7 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, Exception) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:750]
phabricator_1  | [Mon Dec 09 08:10:21.874274 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010]   #8 AphrontApplicationConfiguration::handleThrowable(Exception) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:298]
phabricator_1  | [Mon Dec 09 08:10:21.874275 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010]   #9 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:209]
phabricator_1  | [Mon Dec 09 08:10:21.874276 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010]   #10 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:35]
phabricator_1  | [Mon Dec 09 08:10:21.874923 2019] [php7:notice] [pid 86] [client 172.20.0.1:41010] [2019-12-09 08:10:21] EXCEPTION: (PhutilAggregateException) Encountered a processing exception, then another exception when trying to build a response for the first exception.\n    - PhabricatorDataNotAttachedException: Attempting to access attached data on PhabricatorUser (via getUserSetting()), but the data is not actually attached. Before accessing attachable data on an object, you must load and attach it.\n      \n      Data is normally attached by calling the corresponding needX() method on the Query class when the object is loaded. You can also call the corresponding attachX() method explicitly.\n    - Exception: Unable to find `git-http-backend` in $PATH! at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:318]

解决办法,手动创建软链接

root@46f78880c578:/# ln -s /usr/lib/git-core/git-http-fetch /usr/bin/git-http-fetch
root@46f78880c578:/# ln -s /usr/lib/git-core/git-http-push /usr/bin/git-http-push
root@46f78880c578:/# ln -s /usr/lib/git-core/git-http-backend /usr/bin/git-http-backend
root@46f78880c578:/# ls -l /usr/bin/| grep git
-rwxr-xr-x. 1 root root   2081456 Sep 28  2018 git
lrwxrwxrwx. 1 root root        34 Dec  9 08:27 git-http-backend -> /usr/lib/git-core/git-http-backend
lrwxrwxrwx. 1 root root        32 Dec  9 08:27 git-http-fetch -> /usr/lib/git-core/git-http-fetch
lrwxrwxrwx. 1 root root        31 Dec  9 08:27 git-http-push -> /usr/lib/git-core/git-http-push
lrwxrwxrwx. 1 root root         3 Sep 28  2018 git-receive-pack -> git
-rwxr-xr-x. 1 root root   1031136 Sep 28  2018 git-shell
lrwxrwxrwx. 1 root root         3 Sep 28  2018 git-upload-archive -> git
-rwxr-xr-x. 1 root root   1113296 Sep 28  2018 git-upload-pack
root@46f78880c578:/# 

发布了161 篇原创文章 · 获赞 39 · 访问量 36万+

猜你喜欢

转载自blog.csdn.net/hknaruto/article/details/103460149