0

I've got older Debian Jessie server with Mercurial 3.1.2 and Phabricator. Long time Phabricator protest that HG is old and there is secure problems and I decide to make brand new VM with latest HG. Old:

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.11 (jessie)
Release:        8.11
Codename:       jessie

hg version
Mercurial Distributed SCM (version 3.1.2)
(see http://mercurial.selenic.com for more information)

New:

Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
 hg version
Mercurial Distributed SCM (version 4.8.2)
(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2018 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Enabled extensions:

  largefiles  internal

and configured:

hg debuginstall
checking encoding (UTF-8)...
checking Python executable (/usr/bin/python2)
checking Python version (2.7.16)
checking Python lib (/usr/lib/python2.7)...
checking Python security support (sni,tls1.0,tls1.1,tls1.2)
checking Mercurial version (4.8.2)
checking Mercurial custom build ()
checking module policy (c)
checking installed modules (/usr/lib/python2.7/dist-packages/mercurial)...
checking registered compression engines (bz2, bz2truncated, none, zlib, zstd)
checking available compression engines (bz2, bz2truncated, none, zlib, zstd)
checking available compression engines for wire protocol (zstd, zlib, bz2, none)
checking "re2" regexp engine (missing)
checking templates (/usr/share/mercurial/templates)...
checking default template (/usr/share/mercurial/templates/map-cmdline.default)
checking commit editor... (sensible-editor)
checking username (myuser <myuser@gmail.com>)
no problems detected


 hg --debug showconfig
starting pager for command 'config'
read config from: /usr/etc/mercurial/hgrc
read config from: /etc/mercurial/hgrc
read config from: /etc/mercurial/hgrc.d/cacerts.rc
read config from: /etc/mercurial/hgrc.d/hgext.rc
read config from: /root/.hgrc
read config from: /root/.config/hg/hgrc
/etc/mercurial/hgrc:9: extensions.largefiles=
/etc/mercurial/hgrc:19: trusted.users=root, topperl, www-data
/etc/mercurial/hgrc:12: ui.username=myuser <myuser@gmail.com>
--verbose: ui.verbose=False
--debug: ui.debug=True
--quiet: ui.quiet=False
pager: ui.formatted=True
pager: ui.interactive=False
/etc/mercurial/hgrc.d/cacerts.rc:4: web.cacerts=/etc/ssl/certs/ca-certificates.crt

Rsynced all the repositories and setup hgweb.wsgi to act like a web server (Apache2 vhost as it's easy for me)

# An example WSGI for use with mod_wsgi, edit as necessary
# See https://mercurial-scm.org/wiki/modwsgi for more information

# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/var/www/vhost/hg/cgi-bin/hgweb.config"

# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
#import sys; sys.path.insert(0, "/path/to/python/lib")

# Uncomment to send python tracebacks to the browser if an error occurs:
import cgitb; cgitb.enable()

# enable demandloading to reduce startup time
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb.hgwebdir_mod import hgwebdir

import os
os.environ["HGENCODING"] = "UTF-8"

from mercurial.hgweb import hgweb
application = hgweb(config)

Python version is:

Python 2.7.16 (default, Apr  6 2019, 01:42:57)
[GCC 8.3.0] on linux2

When push large files I receive error:

mod_wsgi (pid=3945): Exception occurred processing WSGI script '/var/www/vhost/hg/cgi-bin/hgwebdir.w

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.py", line 352, in run_wsgi
    for r in self._runwsgi(req, res):
  File "/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgweb_mod.py", line 307, in run_wsgi
    for r in self._runwsgi(req, res, repo):
  File "/usr/lib/python2.7/dist-packages/mercurial/hgweb/hgweb_mod.py", line 333, in _runwsgi
    rctx, req, res, self.check_perm)
  File "/usr/lib/python2.7/dist-packages/mercurial/wireprotoserver.py", line 221, in handlewsgireque

    _callhttp(repo, req, res, proto, cmd)
  File "/usr/lib/python2.7/dist-packages/mercurial/wireprotoserver.py", line 436, in _callhttp
    rsp = wireprotov1server.dispatch(repo, proto, cmd)
  File "/usr/lib/python2.7/dist-packages/mercurial/wireprotov1server.py", line 74, in dispatch
    return func(repo, proto, *args)
  File "/usr/lib/python2.7/dist-packages/mercurial/wireprotov1server.py", line 196, in batch
    result = func(repo, proto, *[data[k] for k in keys])
  File "/usr/lib/python2.7/dist-packages/hgext/largefiles/proto.py", line 89, in statlfile
    filename = lfutil.findfile(repo, sha)
  File "/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.py", line 111, in findfile
    elif inusercache(repo.ui, hash):
  File "/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.py", line 100, in inusercache
    path = usercachepath(ui, hash)
  File "/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.py", line 71, in usercachepath
    return os.path.join(_usercachedir(ui), hash)
  File "/usr/lib/python2.7/dist-packages/hgext/largefiles/lfutil.py", line 97, in _usercachedir
    raise error.Abort(_('unknown %s usercache location') % name)
Abort: unknown largefiles usercache location

Tried realy hard whole day that and another tweak and advice but no luck :/

Some one with smtar advice ?

PS: Also tried to clone old >> push new some repos and not good again

Topper
  • 103

1 Answers1

0

Partial resolve the problem - users cloned repositories can now make hg push repo Add to /etc/mercurial/hgrc except:

[extensions]
largefiles =

and

[largefiles]
usercache = /path/to/largefiles/storage

Still facing the problem how to migrate all the repost from old to new server. If I found proper solution will edit the topic.

Topper
  • 103