Issue #377: Sub-Repositories not correctly managed since upgrade to python 3 (conservancy/kallithea)

Philippe Corbel issues-reply at bitbucket.org
Fri Jun 12 14:45:18 UTC 2020


New issue 377: Sub-Repositories not correctly managed since upgrade to python 3
https://bitbucket.org/conservancy/kallithea/issues/377/sub-repositories-not-correctly-managed

Philippe Corbel:

I’m using Kallithea for the SCM server in my company; it hosts several tens of different mercurial repositories.

Since the upgrade to 0.6.0 and after 0.6.1 \(and the use of python v3 in place of v2\), i’ve got several “500 Internal Server Error” on some of my repositories.

It is associated with this kind of stack trace:

 TRACEBACK:

Traceback \(most recent call last\):

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/appwrappers/session.py", line 71, in \_\_call\_\_

    response = self.next\_handler\(controller, environ, context\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/appwrappers/i18n.py", line 71, in \_\_call\_\_

    return self.next\_handler\(controller, environ, context\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/wsgiapp.py", line 243, in \_dispatch

    return controller\(environ, context\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/kallithea/lib/base.py", line 536, in \_\_call\_\_

    return super\(BaseController, self\).\_\_call\_\_\(environ, context\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/controllers/dispatcher.py", line 118, in \_\_call\_\_

    response = self.\_perform\_call\(context\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/controllers/dispatcher.py", line 107, in \_perform\_call

    r = self.\_call\(action, params, remainder=remainder, context=context\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/controllers/decoratedcontroller.py", line 129, in \_call

    output = controller\_caller\(context\_config, bound\_controller\_callable, remainder, params\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/controllers/decoration.py", line 21, in \_decorated\_controller\_caller

    return application\_controller\_caller\(tg\_config, controller, remainder, params\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/configurator/components/dispatch.py", line 114, in \_call\_controller

    return controller\(\*remainder, \*\*params\)

  File "<decorator-gen-40>", line 2, in index

   

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/kallithea/lib/auth.py", line 614, in \_\_wrapper

    return func\(\*fargs, \*\*fkwargs\)

  File "<decorator-gen-39>", line 2, in index

   

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/kallithea/lib/auth.py", line 657, in \_\_wrapper

    return func\(\*fargs, \*\*fkwargs\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/kallithea/controllers/files.py", line 193, in index

    return render\('files/files.html'\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/kallithea/lib/base.py", line 63, in render

    return render\_template\(\{'url': url\}, 'mako', template\_path\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/render.py", line 208, in render

    kwargs\['result'\] = render\_function\(template\_name, tg\_vars, \*\*kwargs\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/renderers/mako.py", line 134, in \_\_call\_\_

    cache\_type=cache\_type, cache\_expire=cache\_expire\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/render.py", line 274, in cached\_template

    return render\_func\(\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/tg/renderers/mako.py", line 131, in render\_template

    return Markup\(template.render\_unicode\(\*\*template\_vars\)\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/mako/template.py", line 482, in render\_unicode

    self, self.callable\_, args, data, as\_unicode=True

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/mako/runtime.py", line 883, in \_render

* \*\_kwargs\_for\_callable\(callable\_, data\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/mako/runtime.py", line 920, in \_render\_context

    \_exec\_template\(inherit, lclcontext, args=args, kwargs=kwargs\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/mako/runtime.py", line 947, in \_exec\_template

    callable\_\(context, \*args, \*\*kwargs\)

  File "\_base\_root\_html", line 211, in render\_body

   

  File "\_base\_base\_html", line 42, in render\_body

   

  File "files\_files\_html", line 130, in render\_main

   

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/mako/runtime.py", line 795, in \_include\_file

    callable\_\(ctx, \*\*kwargs\)

  File "files\_files\_ypjax\_html", line 44, in render\_body

   

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/mako/runtime.py", line 795, in \_include\_file

    callable\_\(ctx, \*\*kwargs\)

  File "files\_files\_browser\_html", line 77, in render\_body

   

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/kallithea/lib/vcs/nodes.py", line 502, in \_\_iter\_\_

    for node in self.nodes:

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/kallithea/lib/vcs/utils/lazy.py", line 41, in \_\_get\_\_

    value = self.\_func\(obj\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/kallithea/lib/vcs/nodes.py", line 487, in nodes

    nodes = self.changeset.get\_nodes\(self.path\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/kallithea/lib/vcs/backends/hg/changeset.py", line 333, in get\_nodes

    alias=als\)\)

  File "/opt/kallithea\_0\_6\_1/venv/lib/python3.7/site-packages/kallithea/lib/vcs/nodes.py", line 587, in \_\_init\_\_

    self.path = name.rstrip\('/'\)

TypeError: a bytes-like object is required, not 'str'

 

 

ENVIRON:

                HTTP\_ACCEPT: 'text/html,application/xhtml\+xml,application/xml;q=0.9,image/webp,\*/\*;q=0.8'

                HTTP\_ACCEPT\_ENCODING: 'gzip, deflate'

                HTTP\_ACCEPT\_LANGUAGE: 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3'

                HTTP\_CONNECTION: 'keep-alive'

                HTTP\_COOKIE: 'kallithea=f6b698e7b347df33c22b9f79b08e8c7895def907b7cd503572c947f7a4612a80b0e79166'

                HTTP\_HOST: 'kallithea'

                HTTP\_REFERER: '[http://kallithea/ESW/STC-B2M/BEO-UT556](http://kallithea/ESW/STC-B2M/BEO-UT556)'

                HTTP\_UPGRADE\_INSECURE\_REQUESTS: '1'

                HTTP\_USER\_AGENT: 'Mozilla/5.0 \(Windows NT 10.0; Win64; x64; rv:77.0\) Gecko/20100101 Firefox/77.0'

                PATH\_INFO: '/ESW/STC-B2M/BEO-UT556/files/tip/'

                QUERY\_STRING: ''

                REMOTE\_ADDR: '152.28.10.144'

                REMOTE\_HOST: '152.28.10.144'

                REMOTE\_PORT: '60298'

                REQUEST\_METHOD: 'GET'

                SCRIPT\_NAME: ''

                SERVER\_NAME: 'kallithea'

                SERVER\_PORT: '5000'

                SERVER\_PROTOCOL: 'HTTP/1.1'

                SERVER\_SOFTWARE: 'waitress'

 

 

WSGI:

                beaker.cache: <beaker.cache.CacheManager object at 0x7f94e9b50588>

                beaker.get\_session: <bound method SessionApplicationWrapper.\_get\_session of <tg.appwrappers.session.SessionApplicationWrapper object at 0x7f94e9b3f940>>

                beaker.session: \{'\_domain': None, '\_path': '/', '\_creation\_time': 1591972763.232398, '\_accessed\_time': 1591972775.6497796, 'authuser': \{'user\_id': 43, 'is\_external\_auth': False\}, '\_session\_csrf\_secret\_token': '123960240672537899833174713479131300259'\}

                paste.registry: <tg.support.registry.Registry object at 0x7f94328e2b00>

                pylons.routes\_dict: \{'repo\_name': 'ESW/STC-B2M/BEO-UT556', 'revision': 'tip', 'f\_path': '', 'action': 'index', 'controller': 'files'\}

                routes.route: <routes.route.Route object at 0x7f949bb502b0>

                routes.url: <routes.util.URLGenerator object at 0x7f9431845390>

                tg.locals: <tg.wsgiapp.RequestLocals object at 0x7f9446c61978>

                tg.routes\_dict: \{'repo\_name': 'ESW/STC-B2M/BEO-UT556', 'revision': 'tip', 'f\_path': '', 'action': 'index', 'controller': 'files'\}

                webob.\_parsed\_query\_vars: \(GET\(\[\]\), ''\)

                webob.adhoc\_attrs: \{'authuser': <AuthUser 43: 'victor'>, 'ip\_addr': '152.28.10.144', 'needs\_csrf\_check': False, 'routes\_local': \{'mapper': <kallithea.config.routing.Mapper object at 0x7f949c218860>, 'host': 'kallithea', 'protocol': 'http', 'redirect': <function redirect at 0x7f94ec790510>\}\}

                wsgi.errors: <\_io.TextIOWrapper name='<stderr>' mode='w' encoding='UTF-8'>

                wsgi.file\_wrapper: <class 'waitress.buffers.ReadOnlyFileBasedBuffer'>

                wsgi.input: <\_io.BytesIO object at 0x7f943298a6d0>

                wsgi.input\_terminated: True

                wsgi.multiprocess: False

                wsgi.multithread: True

                wsgi.run\_once: False

                wsgi.url\_scheme: 'http'

                wsgi.version: \(1, 0\)

                wsgiorg.routing\_args: \(<routes.util.URLGenerator object at 0x7f9431845390>, \{'repo\_name': 'ESW/STC-B2M/BEO-UT556', 'revision': 'tip', 'f\_path': '', 'action': 'index', 'controller': 'files'\}\)

 

‌




More information about the kallithea-general mailing list