Package: mercurial-server
Version: 1.2-2.2
Severity: grave
Justification: renders package unusable

Dear Maintainer,

after upgrading my mercurial server from stretch to buster, I'm not
able to push or clone to this server from a buster client, the command
fails with:

    ...
    remote:   File
"/usr/share/mercurial-server/mercurialserver/changes.py", line 6, in changes
    remote:     start = repo.changectx(node).rev()
    remote: AttributeError:
'derivedrepo:/var/lib/mercurial-server/repos/projec' object has no
attribute 'changectx'
    abort: stream ended unexpectedly (got 0 bytes, expected 4)

Only solution found is to disable access hook in
/etc/mercurial-server/remote-hgrc.d/access.rc but since it's removing
all access control security, this is not a real solution (and it also
raises another bug in the logging hook but at least repository is
cloned/pushed).

Clone from or pull are not affected (except for the logging hook bug).

Steps to reproduce:

    sudo lxc-create hgserver -t debian --
--package=mercurial-server,openssh-server,sudo,reportbug -r buster
    sudo lxc-start hgserver
    sudo lxc-attach hgserver
    apt update
    apt dist-upgrade
    cd
    ssh-keygen
    mkdir -p /etc/mercurial-server/keys/root
    cp .ssh/id_rsa.pub /etc/mercurial-server/keys/root
    sed -i 's/localhost/localhost hgserver/' /etc/hosts
    sudo -u hg /usr/share/mercurial-server/refresh-auth
    mkdir project
    cd project
    hg init
    touch spam
    hg add spam
    hg commit -m 'add spam' -u root
    hg clone . ssh://[email protected]/project

Error trace:

    searching for changes
    remote: adding changesets
    remote: adding manifests
    remote: adding file changes
    remote: added 1 changesets with 1 changes to 1 files
    remote: error: pretxnchangegroup.access hook raised an exception:
'derivedrepo:/var/lib/mercurial-server/repos/projec' object has no
attribute 'changectx'
    remote: transaction abort!
    remote: rollback completed
    remote: ** unknown exception encountered, please report by visiting
    remote: ** https://mercurial-scm.org/wiki/BugTracker
    remote: ** Python 2.7.16 (default, Oct 10 2019, 22:02:15) [GCC 8.3.0]
    remote: ** Mercurial Distributed SCM (version 4.8.2)
    remote: ** Extensions loaded:
    remote: Traceback (most recent call last):
    remote:   File "/usr/share/mercurial-server/hg-ssh", line 91, in
<module>
    remote:     dispatch.dispatch(request(['-R', repo, 'serve', '--stdio']))
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 220, in
dispatch
    remote:     ret = _runcatch(req) or 0
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 363, in
_runcatch
    remote:     return _callcatch(ui, _runcatchfunc)
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 371, in
_callcatch
    remote:     return scmutil.callcatch(ui, func)
    remote:   File "/usr/lib/python2.7/dist-packages/mercurial/scmutil.py",
line 166, in callcatch
    remote:     return func()
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 354, in
_runcatchfunc
    remote:     return _dispatch(req)
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 994, in
_dispatch
    remote:     cmdpats, cmdoptions)
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 737, in
runcommand
    remote:     ret = _runcommand(ui, options, cmd, d)
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 1003, in
_runcommand
    remote:     return cmdfunc()
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 991, in
<lambda>
    remote:     d = lambda: util.checksignature(func)(ui, *args,
**strcmdopt)
    remote:   File "/usr/lib/python2.7/dist-packages/mercurial/util.py",
line 1646, in check
    remote:     return func(*args, **kwargs)
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 5207, in
serve
    remote:     s.serve_forever()
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/wireprotoserver.py", line 797,
in serve_forever
    remote:     self.serveuntil(threading.Event())
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/wireprotoserver.py", line 804,
in serveuntil
    remote:     _runsshserver(self._ui, self._repo, self._fin, self._fout,
ev)
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/wireprotoserver.py", line 656,
in _runsshserver
    remote:     rsp = wireprotov1server.dispatch(repo, proto, request)
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/wireprotov1server.py", line 74,
in dispatch
    remote:     return func(repo, proto, *args)
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/wireprotov1server.py", line
599, in unbundle
    remote:     proto.client())
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/exchange.py", line 2377, in
unbundle
    remote:     op = bundle2.processbundle(repo, cg, op=op)
    remote:   File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py",
line 460, in processbundle
    remote:     processparts(repo, op, unbundler)
    remote:   File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py",
line 467, in processparts
    remote:     _processpart(op, part)
    remote:   File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py",
line 534, in _processpart
    remote:     handler(op, part)
    remote:   File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py",
line 1829, in handlechangegroup
    remote:     expectedtotal=nbchangesets, **extrakwargs)
    remote:   File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py",
line 470, in _processchangegroup
    remote:     ret = cg.apply(op.repo, tr, source, url, **kwargs)
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/changegroup.py", line 366, in
apply
    remote:     throw=True, **pycompat.strkwargs(hookargs))
    remote:   File
"/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 1370, in
hook
    remote:     return hook.hook(self.ui, self, name, throw, **args)
    remote:   File "/usr/lib/python2.7/dist-packages/mercurial/hook.py",
line 218, in hook
    remote:     res = runhooks(ui, repo, htype, hooks, throw=throw, **args)
    remote:   File "/usr/lib/python2.7/dist-packages/mercurial/hook.py",
line 270, in runhooks
    remote:     throw)
    remote:   File "/usr/lib/python2.7/dist-packages/mercurial/hook.py",
line 98, in pythonhook
    remote:     r = obj(ui=ui, repo=repo, hooktype=htype,
**pycompat.strkwargs(args))
    remote:   File "/usr/share/mercurial-server/mercurialserver/access.py",
line 24, in hook
    remote:     for ctx in changes.changes(repo, node):
    remote:   File
"/usr/share/mercurial-server/mercurialserver/changes.py", line 6, in changes
    remote:     start = repo.changectx(node).rev()
    remote: AttributeError:
'derivedrepo:/var/lib/mercurial-server/repos/projec' object has no
attribute 'changectx'
    abort: stream ended unexpectedly (got 0 bytes, expected 4)

Thanks.

-- System Information:
Debian Release: 10.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-6-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_USER, TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages mercurial-server depends on:
ii  adduser                      3.118
ii  debconf [debconf-2.0]        1.5.71
ii  mercurial                    4.8.2-1+deb10u1
ii  mercurial-common             4.8.2-1+deb10u1
ii  openssh-server [ssh-server]  1:7.9p1-10+deb10u1
ii  python                       2.7.16-1

mercurial-server recommends no packages.

mercurial-server suggests no packages.

-- debconf information:
  mercurial-server/purge_repositories: false

Reply via email to