jonashaag / klaus

docker run klaus / pip install klaus — the first Git web viewer that Just Works™.
http://klausdemo.lophus.org
Other
685 stars 102 forks source link

AttributeError: 'FancyRepo' object has no attribute 'object_store' #326

Closed rbeerster closed 6 months ago

rbeerster commented 6 months ago

Here is an error from trying to clone a repository using klaus:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/sync.py", line 183, in handle_request
    for item in respiter:
  File "/usr/local/lib64/python3.9/site-packages/dulwich/web.py", line 231, in get_info_refs
    handler.handle()
  File "/usr/local/lib64/python3.9/site-packages/dulwich/server.py", line 379, in handle
    self.repo.object_store,
AttributeError: 'FancyRepo' object has no attribute 'object_store'

Python version 3.9.18 and klaus installed using pip. Here is how klaus was instantiated:

/usr/local/bin/klaus --smarthttp /var/lib/git/repo.git/

It seems object_store, self.repo.get_peeled, and self.repo.refs.get_symrefs are all undefined. This is on Rocky Linux 9.3.

jonashaag commented 6 months ago

Can you please check what number of Dulwich that uses. Maybe Python 3.9 is too old

rbeerster commented 6 months ago

The version is dulwich-0.22.1, which appears to support Python 3.7 and newer.

jonashaag commented 6 months ago

@rbeerster I tried reproducing locally but your traceback does not match the line numbers in 0.22.1. Are you sure that's the version you are using?

rbeerster commented 6 months ago

Here is what I see:

[root@git ~]# ls -l /usr/local/lib64/python3.9/site-packages/
total 4
drwxr-xr-x. 6 root root 4096 May 12 19:54 dulwich
drwxr-xr-x. 2 root root  143 May 12 15:33 dulwich-0.22.1.dist-info
jonashaag commented 6 months ago

Thank you for reporting this. I looks like cloning and pushing has been broken for a long time. I will make a new release soon.