arthaud / git-dumper

A tool to dump a git repository from a website
MIT License
1.69k stars 235 forks source link

struct.error: unpack requires a buffer of 8 bytes #30

Open drkbllo opened 2 years ago

drkbllo commented 2 years ago

struct.error: unpack requires a buffer of 8 bytes how to fix this

drkbllo commented 2 years ago

hello ?

arthaud commented 2 years ago

Hi @drkbllo,

Could you share a way to reproduce the error you are getting?

Also: please remember that this is open source, developed on my spare time and that no one owes you a timely answer on a Github issue. Your previous comment feels really off. That and the fact you opened a one line issue without any greetings and any way to reproduce the issue.

Best regards.

drkbllo commented 2 years ago

i'm sorry didn't mean anything bad it was an urgence have a nice day sir

arthaud commented 2 years ago

No worries.

Now, do you have a way to reproduce this? Can you send the full output of the tool? Right now I have no way of knowing what goes wrong. We don't call struct directly so this must be in one of our dependencies.

Paradioss commented 2 years ago

fatal: index file corrupt Traceback (most recent call last): File "git-dumper.py", line 736, in main() File "git-dumper.py", line 730, in main http_headers, File "git-dumper.py", line 460, in fetch_git subprocess.check_call(["git", "checkout", "."]) File "/usr/lib64/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['git', 'checkout', '.']' returned non-zero exit status 128.

ajmeese7 commented 10 months ago

I have reproduced this error as well:

$ git-dumper https://www.mysite.com/.git
[-] Testing https://www.mysite.com/.git/HEAD [200]
[-] Testing https://www.mysite.com/.git/ [200]
[-] Fetching common files
[-] Fetching https://www.mysite.com/.gitignore [200]
[-] Fetching https://www.mysite.com/.git/hooks/commit-msg.sample [200]
[-] Fetching https://www.mysite.com/.git/description [200]
[-] Fetching https://www.mysite.com/.git/hooks/pre-commit.sample [200]
[-] Fetching https://www.mysite.com/.git/hooks/applypatch-msg.sample [200]
[-] Fetching https://www.mysite.com/.git/COMMIT_EDITMSG [200]
[-] Fetching https://www.mysite.com/.git/hooks/pre-applypatch.sample [200]
[-] Fetching https://www.mysite.com/.git/hooks/post-update.sample [200]
[-] Fetching https://www.mysite.com/.git/hooks/post-receive.sample [404]
[-] https://www.mysite.com/.git/hooks/post-receive.sample responded with status code 404
[-] Fetching https://www.mysite.com/.git/hooks/post-commit.sample [404]
[-] https://www.mysite.com/.git/hooks/post-commit.sample responded with status code 404
[-] Fetching https://www.mysite.com/.git/hooks/prepare-commit-msg.sample [200]
[-] Fetching https://www.mysite.com/.git/hooks/pre-push.sample [200]
[-] Fetching https://www.mysite.com/.git/hooks/pre-rebase.sample [200]
[-] Fetching https://www.mysite.com/.git/info/exclude [200]
[-] Fetching https://www.mysite.com/.git/hooks/update.sample [200]
[-] Fetching https://www.mysite.com/.git/hooks/pre-receive.sample [200]
[-] Fetching https://www.mysite.com/.git/objects/info/packs [404]
[-] https://www.mysite.com/.git/objects/info/packs responded with status code 404
[-] Fetching https://www.mysite.com/.git/index [200]
Task .git/index raised exception:
Traceback (most recent call last):
  File "/home/ajmeese/.local/lib/python3.11/site-packages/urllib3/response.py", line 438, in _error_catcher
    yield
  File "/home/ajmeese/.local/lib/python3.11/site-packages/urllib3/response.py", line 764, in read_chunked
    self._update_chunk_length()
  File "/home/ajmeese/.local/lib/python3.11/site-packages/urllib3/response.py", line 694, in _update_chunk_length
    line = self._fp.fp.readline()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 706, in readinto
    return self._sock.recv_into(b)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ssl.py", line 1278, in recv_into
    return self.read(nbytes, buffer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ssl.py", line 1134, in read
    return self._sslobj.read(len, buffer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2576)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ajmeese/.local/lib/python3.11/site-packages/git_dumper.py", line 153, in run
    result = self.do_task(task, *self.args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ajmeese/.local/lib/python3.11/site-packages/git_dumper.py", line 262, in do_task
    for chunk in response.iter_content(4096):
  File "/home/ajmeese/.local/lib/python3.11/site-packages/requests/models.py", line 753, in generate
    for chunk in self.raw.stream(chunk_size, decode_content=True):
  File "/home/ajmeese/.local/lib/python3.11/site-packages/urllib3/response.py", line 572, in stream
    for line in self.read_chunked(amt, decode_content=decode_content):
  File "/home/ajmeese/.local/lib/python3.11/site-packages/urllib3/response.py", line 752, in read_chunked
    with self._error_catcher():
  File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/home/ajmeese/.local/lib/python3.11/site-packages/urllib3/response.py", line 449, in _error_catcher
    raise SSLError(e)
urllib3.exceptions.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2576)
[-] Finding refs/
[-] Fetching https://www.mysite.com/.git/HEAD [200]
[-] Fetching https://www.mysite.com/.git/config [200]
[-] Fetching https://www.mysite.com/.git/logs/refs/heads/master [200]
[-] Fetching https://www.mysite.com/.git/FETCH_HEAD [200]
[-] Fetching https://www.mysite.com/.git/ORIG_HEAD [200]
[-] Fetching https://www.mysite.com/.git/logs/refs/stash [200]
[-] Fetching https://www.mysite.com/.git/logs/refs/remotes/origin/HEAD [200]
[-] Fetching https://www.mysite.com/.git/logs/HEAD [200]
[-] Fetching https://www.mysite.com/.git/packed-refs [200]
[-] Fetching https://www.mysite.com/.git/refs/heads/master [200]
[-] Fetching https://www.mysite.com/.git/info/refs [404]
[-] https://www.mysite.com/.git/info/refs responded with status code 404
[-] Fetching https://www.mysite.com/.git/logs/refs/remotes/origin/master [404]
[-] https://www.mysite.com/.git/logs/refs/remotes/origin/master responded with status code 404
[-] Fetching https://www.mysite.com/.git/refs/remotes/origin/HEAD [200]
[-] Fetching https://www.mysite.com/.git/refs/stash [200]
[-] Fetching https://www.mysite.com/.git/logs/refs/heads/dev_yii_update [200]
[-] Fetching https://www.mysite.com/.git/refs/heads/dev_yii_update [200]
[-] Fetching https://www.mysite.com/.git/refs/wip/index/refs/heads/master [404]
[-] https://www.mysite.com/.git/refs/wip/index/refs/heads/master responded with status code 404
[-] Fetching https://www.mysite.com/.git/refs/wip/wtree/refs/heads/master [404]
[-] https://www.mysite.com/.git/refs/wip/wtree/refs/heads/master responded with status code 404
[-] Fetching https://www.mysite.com/.git/refs/remotes/origin/master [404]
[-] https://www.mysite.com/.git/refs/remotes/origin/master responded with status code 404
[-] Finding packs
[-] Finding objects
Traceback (most recent call last):
  File "/home/ajmeese/.local/bin/git-dumper", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/ajmeese/.local/lib/python3.11/site-packages/git_dumper.py", line 724, in main
    fetch_git(
  File "/home/ajmeese/.local/lib/python3.11/site-packages/git_dumper.py", line 581, in fetch_git
    index = dulwich.index.Index(index_path)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ajmeese/.local/lib/python3.11/site-packages/dulwich/index.py", line 307, in __init__
    self.read()
  File "/home/ajmeese/.local/lib/python3.11/site-packages/dulwich/index.py", line 332, in read
    for name, entry in read_index(f):
  File "/home/ajmeese/.local/lib/python3.11/site-packages/dulwich/index.py", line 227, in read_index
    yield read_cache_entry(f, version)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ajmeese/.local/lib/python3.11/site-packages/dulwich/index.py", line 134, in read_cache_entry
    ctime = read_cache_time(f)
            ^^^^^^^^^^^^^^^^^^
  File "/home/ajmeese/.local/lib/python3.11/site-packages/dulwich/index.py", line 105, in read_cache_time
    return struct.unpack(">LL", f.read(8))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: unpack requires a buffer of 8 bytes

Any guidance on how to proceed here?