Cannot create git repository by cloning from GitHub

Issue #365 resolved
vyom created an issue

Wanted to create a repository of upstreak Flask Project and an error occured. It seems to be front-end error, the repository URL is correct.

Comments (9)

  1. vyom reporter

    I used the latest code it still has the same error. In Logs the error is:

    2020-03-11 22:10:47.115 WARNI [kallithea.model.validators] validation of clone URL 'https://github.com/pallets/flask.git' failed: URI https://github.com/pallets/flask.git URLError: <urlopen error [https://:*****@github.com/pallets/flask.git] org_exc: <urlopen error unknown url type: b'https>>
    

  2. Mads Kiilerich

    Right. That was another problem with similar symptom.

    Can you confirm it works with

    --- kallithea/lib/vcs/backends/git/repository.py
    +++ kallithea/lib/vcs/backends/git/repository.py
    @@ -190,7 +190,7 @@ class GitRepository(BaseRepository):
    
             req = urllib.request.Request(
                 "%s?%s" % (
    -                test_uri,
    +                safe_str(test_uri),
                     urllib.parse.urlencode({"service": 'git-upload-pack'})
                 ))
    

  3. vyom reporter

    After applying this change get following error:

    Traceback (most recent call last):
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/tg/appwrappers/session.py", line 71, in __call__
        response = self.next_handler(controller, environ, context)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/tg/appwrappers/i18n.py", line 71, in __call__
        return self.next_handler(controller, environ, context)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/tg/wsgiapp.py", line 243, in _dispatch
        return controller(environ, context)
      File "/home/kallithea/projects/hg/kallithea/kallithea/lib/base.py", line 536, in __call__
        return super(BaseController, self).__call__(environ, context)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/tg/controllers/dispatcher.py", line 118, in __call__
        response = self._perform_call(context)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/tg/controllers/dispatcher.py", line 107, in _perform_call
        r = self._call(action, params, remainder=remainder, context=context)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/tg/controllers/decoratedcontroller.py", line 129, in _call
        output = controller_caller(context_config, bound_controller_callable, remainder, params)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/tg/controllers/decoration.py", line 21, in _decorated_controller_caller
        return application_controller_caller(tg_config, controller, remainder, params)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/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 "/home/kallithea/projects/hg/kallithea/kallithea/lib/auth.py", line 637, in __wrapper
        return func(*fargs, **fkwargs)
      File "<decorator-gen-39>", line 2, in index
    
      File "/home/kallithea/projects/hg/kallithea/kallithea/lib/auth.py", line 680, in __wrapper
        return func(*fargs, **fkwargs)
      File "/home/kallithea/projects/hg/kallithea/kallithea/controllers/summary.py", line 153, in index
        return render('summary/summary.html')
      File "/home/kallithea/projects/hg/kallithea/kallithea/lib/base.py", line 63, in render
        return render_template({'url': url}, 'mako', template_path)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/tg/render.py", line 208, in render
        kwargs['result'] = render_function(template_name, tg_vars, **kwargs)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/tg/renderers/mako.py", line 134, in __call__
        cache_type=cache_type, cache_expire=cache_expire)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/tg/render.py", line 274, in cached_template
        return render_func()
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/tg/renderers/mako.py", line 131, in render_template
        return Markup(template.render_unicode(**template_vars))
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/mako/template.py", line 482, in render_unicode
        self, self.callable_, args, data, as_unicode=True
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/mako/runtime.py", line 883, in _render
        **_kwargs_for_callable(callable_, data)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/mako/runtime.py", line 920, in _render_context
        _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/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 "summary_summary_html", line 322, in render_main
    
      File "_changelog_changelog_table_html", line 44, in render_changelog
    
      File "/home/kallithea/projects/hg/kallithea/kallithea/lib/vcs/utils/lazy.py", line 41, in __get__
        value = self._func(obj)
      File "/home/kallithea/projects/hg/kallithea/kallithea/lib/vcs/backends/git/changeset.py", line 176, in parents
        for parent_id in self._commit.parents]
      File "/home/kallithea/projects/hg/kallithea/kallithea/lib/vcs/backends/git/changeset.py", line 176, in <listcomp>
        for parent_id in self._commit.parents]
      File "/home/kallithea/projects/hg/kallithea/kallithea/lib/vcs/backends/git/repository.py", line 479, in get_changeset
        return GitChangeset(repository=self, revision=self._get_revision(revision))
      File "/home/kallithea/projects/hg/kallithea/kallithea/lib/vcs/backends/git/changeset.py", line 27, in __init__
        commit = self.repository._repo[ascii_bytes(revision)]
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/dulwich/repo.py", line 677, in __getitem__
        return self.object_store[name]
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/dulwich/object_store.py", line 122, in __getitem__
        type_num, uncomp = self.get_raw(sha)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/dulwich/object_store.py", line 477, in get_raw
        return pack.get_raw(sha)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/dulwich/pack.py", line 2036, in get_raw
        obj_type, obj = self.data.get_object_at(offset)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/dulwich/pack.py", line 1298, in get_object_at
        unpacked, _ = unpack_object(self._file.read)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/dulwich/pack.py", line 776, in unpack_object
        include_comp=include_comp)
      File "/home/kallithea/projects/kallithea/venv3/lib/python3.6/site-packages/dulwich/pack.py", line 241, in read_zlib_chunks
        decomp = decomp_obj.decompress(add)
    zlib.error: Error -3 while decompressing data: incorrect header check
    

  4. Mads Kiilerich

    That looks like something else: A network problem or the remote server closing the connection prematurely. Can you reproduce it?

  5. vyom reporter

    Ok with other repository it did not give me this error. So I will mark as resolved with the patch by @Thomas De Schampheleire

  6. Log in to comment