Однажды я установил Phabricator и выполнив hg clone по https, заметил следующую ошибку:
hg clone https://test.ixnfo.com/diffusion/1/test/
http authorization required for https://test.ixnfo.com/diffusion/1/test/
realm: Phabricator Repositories
user: test
password:
destination directory: test
abort: HTTP Error 500: Error 1: ** unknown exception encountered, please report by visiting
hg push https://test.ixnfo.com/diffusion/1/test/
pushing to https://test.ixnfo.com/diffusion/1/test/
http authorization required for https://test.ixnfo.com/diffusion/1/test/
realm: Phabricator Repositories
user: test
password:
abort: HTTP Error 500: Internal Server Error
При этом hg clone успешно выполнялось по ssh, а также git работал по https и ssh:
hg clone ssh://vcs-user@test.ixnfo.com/diffusion/1/test/
destination directory: test
no changes found
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
hg push ssh://vcs-user@test.ixnfo.com/diffusion/1/test/
pushing to ssh://vcs-user@test.ixnfo.com/diffusion/1/test/
no changes found
Версии были следующие:
phabricator
38694578e1d0c416e992a0fa95edbc270c8af5e8 (Fri, Oct 25)
arcanist
da6d4f85eefb0ae9c945e41659b678549fbb8c8a (Thu, Oct 17)
phutil
39ed96cd818aae761ec92613a9ba0800824d0ab0 (Mon, Sep 30)
php
7.2.19-0ubuntu0.18.04.2
diff
3.6 at /usr/bin/diff
git
2.17.1 at /usr/bin/git
hg
5.2 at /home/phd/phabricator/support/bin/hg
pygmentize
2.2.0 at /usr/bin/pygmentize
svn
Not Available
Apache2 access логи во время ошибки:
"GET /diffusion/4/admin/?cmd=capabilities HTTP/1.1" 401 3554 "-" "mercurial/proto-1.0 (Mercurial 4.5.3)"
"GET /diffusion/4/admin/?cmd=capabilities HTTP/1.1" 200 4021 "-" "mercurial/proto-1.0 (Mercurial 4.5.3)"
"GET /diffusion/4/admin/?cmd=listkeys&namespace=bookmarks HTTP/1.1" 500 319 "-" "mercurial/proto-1.0 (Mercurial 4.5.3)"
Apache2 error логи во время ошибки:
EXCEPTION: (Exception) Expected nonempty ‘cmds’ specification! at [/src/applications/diffusion/protocol/DiffusionMercurialWireProtocol.php:73]
arcanist(head=master, ref.master=da6d4f85eefb), phabricator(head=master, ref.master=38694578e1d0), phutil(head=master, ref.master=39ed96cd818a)
#0 <#2> DiffusionMercurialWireProtocol::isReadOnlyBatchCommand(NULL) called at [/src/applications/diffusion/controller/DiffusionServeController.php:506]
#1 <#2> DiffusionServeController::isReadOnlyRequest(PhabricatorRepository) called at [/src/applications/diffusion/controller/DiffusionServeController.php:279]
#2 <#2> DiffusionServeController::serveRequest(AphrontRequest) called at [/src/applications/diffusion/controller/DiffusionServeController.php:99]
#3 <#2> DiffusionServeController::handleRequest(AphrontRequest) called at [/src/aphront/AphrontController.php:71]
#4 <#2> AphrontController::delegateToController(DiffusionServeController) called at [/src/applications/diffusion/controller/DiffusionController.php:27]
#5 <#2> DiffusionController::willBeginExecution() called at [/src/aphront/configuration/AphrontApplicationConfiguration.php:273]
#6 phlog(Exception) called at [/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
#7 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, Exception) called at [/src/aphront/configuration/AphrontApplicationConfiguration.php:750]
#8 AphrontApplicationConfiguration::handleThrowable(Exception) called at [/src/aphront/configuration/AphrontApplicationConfiguration.php:298]
#9 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [/src/aphront/configuration/AphrontApplicationConfiguration.php:209]
#10 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [/webroot/index.php:35]
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: Expected nonempty ‘cmds’ specification! at [/src/aphront/configuration/AphrontApplicationConfiguration.php:318]
arcanist(head=master, ref.master=da6d4f85eefb), phabricator(head=master, ref.master=38694578e1d0), phutil(head=master, ref.master=39ed96cd818a)
#0 <#4> DiffusionMercurialWireProtocol::isReadOnlyBatchCommand(NULL) called at [/src/applications/diffusion/controller/DiffusionServeController.php:506]
#1 <#4> DiffusionServeController::isReadOnlyRequest(PhabricatorRepository) called at [/src/applications/diffusion/controller/DiffusionServeController.php:279]
#2 <#4> DiffusionServeController::serveRequest(AphrontRequest) called at [/src/applications/diffusion/controller/DiffusionServeController.php:99]
#3 <#4> DiffusionServeController::handleRequest(AphrontRequest) called at [/src/aphront/AphrontController.php:71]
#4 <#4> AphrontController::delegateToController(DiffusionServeController) called at [/src/applications/diffusion/controller/DiffusionController.php:27]
#5 <#4> DiffusionController::willBeginExecution() called at [/src/aphront/configuration/AphrontApplicationConfiguration.php:273]
#6 <#3> PhabricatorUser::requireCacheData(string) called at [/src/applications/people/storage/PhabricatorUser.php:375]
#7 <#3> PhabricatorUser::getUserSetting(string) called at [/src/applications/people/storage/PhabricatorUser.php:432]
#8 <#3> PhabricatorUser::getTimezoneIdentifier() called at [/src/applications/people/storage/PhabricatorUser.php:613]
#9 <#3> PhabricatorUser::getTimeZone() called at [/src/applications/people/storage/PhabricatorUser.php:617]
#10 <#3> PhabricatorUser::getTimeZoneOffset() called at [/src/view/page/PhabricatorStandardPageView.php:230]
#11 <#3> PhabricatorStandardPageView::willRenderPage() called at [/src/view/page/AphrontPageView.php:46]
#12 <#3> AphrontPageView::render() called at [/src/applications/base/controller/PhabricatorController.php:286]
#13 <#3> PhabricatorController::willSendResponse(AphrontDialogResponse) called at [/src/aphront/configuration/AphrontApplicationConfiguration.php:302]
#14 <#2> AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [/src/aphront/configuration/AphrontApplicationConfiguration.php:209]
#15 <#2> AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [/webroot/index.php:35]
#16 phlog(PhutilAggregateException) called at [/src/aphront/response/AphrontUnhandledExceptionResponse.php:32]
#17 AphrontUnhandledExceptionResponse::setException(PhutilAggregateException) called at [/webroot/index.php:46]
Установка nginx тоже не решила проблему и в терминале ошибок не наблюдалось:
printf ‘listkeys\nnamespace 10\n’ | /usr/local/bin/hg -R /var/repo/4/ serve --stdio
0
Проблема решилась добавлением в файл /src/applications/diffusion/protocol/DiffusionMercurialWireProtocol.php следующей строки:
array_push($parts, ‘httpheader=1024’);
Перед:
return implode(’ ', $parts);
И я так понял что эта проблема была еще в 2017 году и не пойму почему ее до сих пор не исправили.
Установку Phabricator я описал в статье:
Установка Phabricator в Ubuntu