HTTP Error 500: Error 1: ** unknown exception encountered, please report by visiting

Hello. I installed Phabricator and Mercurial in ubuntu server 18.04. I created an empty repository and when I execute hg clone and hg push, I get HTTP Error 500 errors. I note that if I create a git repository, then there are no errors with https, there are no errors either if I do hg clone and hg push by ssh. The error is with hg and https.

I tried to install Mercurial 5.2rc0 from the official site and through apt install mercurial - the error did not disappear.

hg clone https://test.example.com/diffusion/1/test/
http authorization required for https://test.example.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.example.com/diffusion/1/test/
pushing to https://test.example.com/diffusion/1/test/
http authorization required for https://test.example.com/diffusion/1/test/
realm: Phabricator Repositories
user: test
password: 
abort: HTTP Error 500: Internal Server Error

I also performed a re-installation on another system in VirtualBox and received a similar error.

Successful SSH connection:

hg clone ssh://vcs-user@test.example.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.example.com/diffusion/1/test/
pushing to ssh://vcs-user@test.example.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

echo listkeys | /usr/local/bin/hg -R /var/repo/4/ serve --stdio

** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 2.7.15+ (default, Oct 7 2019, 17:39:04) [GCC 7.4.0]
** Mercurial Distributed SCM (version 5.2rc0+10-4565a0afc289)
** Extensions loaded:
Traceback (most recent call last):
File “/usr/local/bin/hg”, line 36, in
dispatch.run()
File “/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py”, line 111, in run
status = dispatch(req)
File “/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py”, line 250, in dispatch
ret = _runcatch(req) or 0
File “/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py”, line 424, in _runcatch
return _callcatch(ui, _runcatchfunc)
File “/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py”, line 433, in _callcatch
return scmutil.callcatch(ui, func)
File “/usr/local/lib/python2.7/dist-packages/mercurial/scmutil.py”, line 177, in callcatch
return func()
File “/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py”, line 414, in _runcatchfunc
return _dispatch(req)
File “/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py”, line 1174, in _dispatch
lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
File “/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py”, line 862, in runcommand
ret = _runcommand(ui, options, cmd, d)
File “/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py”, line 1185, in _runcommand
return cmdfunc()
File “/usr/local/lib/python2.7/dist-packages/mercurial/dispatch.py”, line 1171, in
d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
File “/usr/local/lib/python2.7/dist-packages/mercurial/util.py”, line 1843, in check
return func(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/mercurial/commands.py”, line 6486, in serve
s.serve_forever()
File “/usr/local/lib/python2.7/dist-packages/mercurial/wireprotoserver.py”, line 852, in serve_forever
self.serveuntil(threading.Event())
File “/usr/local/lib/python2.7/dist-packages/mercurial/wireprotoserver.py”, line 858, in serveuntil
_runsshserver(self._ui, self._repo, self._fin, self._fout, ev)
File “/usr/local/lib/python2.7/dist-packages/mercurial/wireprotoserver.py”, line 700, in _runsshserver
rsp = wireprotov1server.dispatch(repo, proto, request)
File “/usr/local/lib/python2.7/dist-packages/mercurial/wireprotov1server.py”, line 80, in dispatch
args = proto.getargs(spec)
File “/usr/local/lib/python2.7/dist-packages/mercurial/wireprotoserver.py”, line 544, in getargs
arg, l = argline.split()
ValueError: need more than 0 values to unpack

Anyone help me solve this?

Apache2 access logs:

“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 logs:

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]

printf ‘listkeys\nnamespace 10\n’ | /usr/local/bin/hg -R /var/repo/4/ serve --stdio
0

The latest version of phabricator from https://github.com/phacility/phabricator.git is able to work with mercurial 4.5.3 and the latest version 5.2rc0 ???