git fetch: "inflate: data stream error" and "SHA1 COLLISION FOUND WITH"

11

I have on my machine a copy of the repository for work, another for maintenance, and a third for resolving merge requests conflicts. The external repository is located at link

In the conflict resolution copy, I got the following while giving git fetch :

$ git fetch
remote: Counting objects: 4339, done.
remote: Compressing objects: 100% (2008/2008), done.
error: inflate: data stream error (unknown compression method)
error: unable to unpack e68ba06d6fc973e561ea7663cd46a6563e4db00a header
fatal: SHA1 COLLISION FOUND WITH e68ba06d6fc973e561ea7663cd46a6563e4db00a !
fatal: index-pack failed

Has anyone ever had this SHA1 COLLISION FOUND problem? Does running a more aggressive GC solve? Or should I give a fetch forced (if it exists)? And why do I get this inflate error: data stream error (unknown compression method)?

In my other two copies git fetch simply works.

I followed the tip of @ Wéllingthon M. de Souza and I went after the answers to this question in SOen .

I tried to follow the two highest scoring answers right now ( 1 and 2 ).

The first thing I did was to follow the question, fsck :

$ git fsck --full
error: inflate: data stream error (unknown compression method)
error: unable to unpack 0df41c704c7ab987a2a87f5487ba94b11fee5651 header
error: inflate: data stream error (unknown compression method)
fatal: loose object 0df41c704c7ab987a2a87f5487ba94b11fee5651 (stored in .git/objects/0d/f41c704c7ab987a2a87f5487ba94b11fee5651) is corrupt

I could not even follow the first steps of the solutions, which involve moving the files stored in .git/objects/pack :

$ mv ../.git/objects/pack/* ./
mv: cannot move ‘../.git/objects/pack/pack-2ef12a374f233953f4fd8a15aa389cd156ee21ab.pack’ to ‘./pack-2ef12a374f233953f4fd8a15aa389cd156ee21ab.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-31eb069000dfed9dc33627cf36ee2197458ad82e.pack’ to ‘./pack-31eb069000dfed9dc33627cf36ee2197458ad82e.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-3b3cf3cbadf5413a348678edcd3ad5aae1dc2c16.pack’ to ‘./pack-3b3cf3cbadf5413a348678edcd3ad5aae1dc2c16.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-635a59f8711f44b67a4507a411a0a0c0285c0ca7.pack’ to ‘./pack-635a59f8711f44b67a4507a411a0a0c0285c0ca7.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-6886cb0119bfd4643b98c4f501f10e629ab74e9c.pack’ to ‘./pack-6886cb0119bfd4643b98c4f501f10e629ab74e9c.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-6e052067c769830ca129a0e8c7bfc4d44764fe15.pack’ to ‘./pack-6e052067c769830ca129a0e8c7bfc4d44764fe15.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-752d7c35962f8a2ea4e822513fb2c556905c00d7.pack’ to ‘./pack-752d7c35962f8a2ea4e822513fb2c556905c00d7.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-7f33b3a5474a3e1e6fe6aaa803b6350d2e042eb4.pack’ to ‘./pack-7f33b3a5474a3e1e6fe6aaa803b6350d2e042eb4.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-a80982d4620dd4cef6f81e3be901cae4c69fde35.pack’ to ‘./pack-a80982d4620dd4cef6f81e3be901cae4c69fde35.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-b434b91b1a0a7320412e2cbca96037f8299ef2ac.pack’ to ‘./pack-b434b91b1a0a7320412e2cbca96037f8299ef2ac.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-ba586b682318e5d28720392029682881c15a94bc.pack’ to ‘./pack-ba586b682318e5d28720392029682881c15a94bc.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-bbf1e8e462d030724464eda227311152a1514afd.pack’ to ‘./pack-bbf1e8e462d030724464eda227311152a1514afd.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-c01218c7abd55796907a9d3bc495a181bde71eaf.pack’ to ‘./pack-c01218c7abd55796907a9d3bc495a181bde71eaf.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-c1a7902d592bd9fd1aea549bbd005caaffbee33f.pack’ to ‘./pack-c1a7902d592bd9fd1aea549bbd005caaffbee33f.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-c91ad861113299d4dab0881b1d6486f30e9bf1b4.pack’ to ‘./pack-c91ad861113299d4dab0881b1d6486f30e9bf1b4.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-d48093c898ed05e058c3a9c892ec0609069ad60d.pack’ to ‘./pack-d48093c898ed05e058c3a9c892ec0609069ad60d.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-da0630673a62d977df8ffbbc50fd61df1569e6a3.pack’ to ‘./pack-da0630673a62d977df8ffbbc50fd61df1569e6a3.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/pack-eda963306885c442497749083b08dc217a91567a.pack’ to ‘./pack-eda963306885c442497749083b08dc217a91567a.pack’: Device or resource busy
mv: cannot move ‘../.git/objects/pack/tmp_pack_TnUODc’ to ‘./tmp_pack_TnUODc’: Device or resource busy

I just tried to copy the files, which worked, and then call the git unpack-objects -r for each file copied. It took a while, but git returned saying it was a success. However, running git fsck still gives the same error.

I also can not run a git gc ...

$ git gc
error: bad ref for refs/remotes/origin/hotfix-{nome-do-branch 3}
error: refs/remotes/interno/feateure-{nome do branch 2} does not point to a valid object!
error: refs/remotes/interno/rc-4.12 does not point to a valid object!
error: refs/remotes/origin/feateure-{nome do branch 2} does not point to a valid object!
error: refs/remotes/origin/feature-{nome do branch 1} does not point to a valid object!
error: refs/remotes/origin/rc-4.12 does not point to a valid object!
error: refs/tags/v4.12.0 does not point to a valid object!
error: refs/tags/v4.12.0-RC5 does not point to a valid object!
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 265cde674ee719afc8b113702111a2daff917bf4
error: Could not read 9949bd269ca9a170d63bb7a966f61f0ba2fa8bbf
error: Could not read a3c9b85a5edbafcb21b9bc545235563696e9b0a7
error: Could not read dd0511454dbb98fe63245c8b892e6f0598896ed7
error: Could not read 7dc587d4ac10c48d3b104c32eb3a5c6b46d2c3d3
error: Could not read d44b9b39c8a1780debb2e4eaebfe3183eda5822d
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+17 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+2 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+5 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+4 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+3 linhas idênticas)
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+8 linhas idênticas)
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 9949bd269ca9a170d63bb7a966f61f0ba2fa8bbf
(+1 linhas idênticas)
error: Could not read a3c9b85a5edbafcb21b9bc545235563696e9b0a7
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read dd0511454dbb98fe63245c8b892e6f0598896ed7
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 7dc587d4ac10c48d3b104c32eb3a5c6b46d2c3d3
(+1 linhas idênticas)
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 7dc587d4ac10c48d3b104c32eb3a5c6b46d2c3d3
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 7dc587d4ac10c48d3b104c32eb3a5c6b46d2c3d3
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+29 linhas idênticas)
error: Could not read d44b9b39c8a1780debb2e4eaebfe3183eda5822d
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+86 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+6 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+9 linhas idênticas)
error: Could not read d44b9b39c8a1780debb2e4eaebfe3183eda5822d
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+2 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+2 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+5 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+4 linhas idênticas)
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read dd0511454dbb98fe63245c8b892e6f0598896ed7
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+8 linhas idênticas)
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 9949bd269ca9a170d63bb7a966f61f0ba2fa8bbf
(+1 linhas idênticas)
error: Could not read a3c9b85a5edbafcb21b9bc545235563696e9b0a7
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read dd0511454dbb98fe63245c8b892e6f0598896ed7
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 7dc587d4ac10c48d3b104c32eb3a5c6b46d2c3d3
(+1 linhas idênticas)
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 7dc587d4ac10c48d3b104c32eb3a5c6b46d2c3d3
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 7dc587d4ac10c48d3b104c32eb3a5c6b46d2c3d3
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read 4399cd6fbed8a44b269a60b63abf1dcd599312ad
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+4 linhas idênticas)
error: Could not read dbbfbdf73be8a9f38e26b85e74db1847cfd05bf4
(+2 linhas idênticas)
error: Could not read dd0511454dbb98fe63245c8b892e6f0598896ed7
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+33 linhas idênticas)
error: Could not read d44b9b39c8a1780debb2e4eaebfe3183eda5822d
error: Could not read 25085f5de31daf24cb5313259f4a8141377b8f92
(+19 linhas idênticas)
fatal: bad object refs/remotes/interno/feateure-{nome-branch-4}
error: failed to run repack
    
asked by anonymous 08.11.2017 / 18:39

1 answer

1

I tried to recover the repository that had given problem at the time of the opening of the call. It turned out that I had changed it a bit, but I did a backup after a few attempts to try to study the problem.

Here's a good deal of the errors reported initially:

$ git fetch
remote: Counting objects: 84379, done.
remote: Compressing objects: 100% (32363/32363), done.
error: inflate: data stream error (unknown compression method)
error: unable to unpack e68ba06d6fc973e561ea7663cd46a6563e4db00a header
fatal: cannot read existing object info e68ba06d6fc973e561ea7663cd46a6563e4db00a
fatal: index-pack failed

You no longer have the problem of SHA1 COLLISION FOUND WITH , however.

The first thing I did was close any application that might require blocking any git object (like Eclipse or SourceTree).

Then I tried to collect garbage:

$ git gc --aggressive
error: bad ref for .git/logs/refs/remotes/origin/hotfix-{branch-1}
fatal: bad object refs/remotes/origin/hotfix-{branch-1}
error: failed to run repack

Without GC, I tried to prune the tree, but also to no avail:

$ git prune
fatal: unable to parse object: refs/remotes/origin/hotfix-{branch-1}

With no more alternatives in sight to try to solve via pure git, I have decided to remove the broken reference and see if I can give prune :

$ rm .git/refs/remotes/origin/hotfix-{branch-1}
$ git prune
error: inflate: data stream error (unknown compression method)
error: unable to unpack e68ba06d6fc973e561ea7663cd46a6563e4db00a header
fatal: loose object e68ba06d6fc973e561ea7663cd46a6563e4db00a (stored in .git/objects/e6/8ba06d6fc973e561ea7663cd46a6563e4db00a) is corrupt

Hmmm, how about GC?

$ git gc --aggressive
Counting objects: 288960, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (222462/222462), done.
Writing objects: 100% (288960/288960), done.
Total 288960 (delta 122354), reused 164323 (delta 0)
Checking connectivity: 288960, done.
$ git prune
Checking connectivity: 288960, done.

Checking fsck to see if everything is fine ...

$ git fsck --full
Checking object directories: 100% (256/256), done.
Checking objects: 100% (288960/288960), done.

Confirming that you are back to balance by getting things from the remote ...

$ git fetch
remote: Counting objects: 84486, done.
remote: Compressing objects: 100% (32403/32403), done.
remote: Total 84486 (delta 32338), reused 81967 (delta 31026)
Receiving objects: 100% (84486/84486), 14.67 MiB | 563.00 KiB/s, done.
Resolving deltas: 100% (32338/32338), done.

From {endereço do origin}
 * [new branch]            {branch}            -> origin/{branch}
[... diversos outros branches e tags que entraram no projeto depois de 6 meses ...]

So, success.

  

I am especially grateful to @wmsouza for giving me a number of references that during this time were used to help me understand what was happening and finally to be able to recover from the problem in an elegant way.

Recapping

  • Removal of corrupted references :

    $ rm rm .git/refs/remotes/origin/hotfix-{branch-1}
    
  • garbage collection / garbage collector aggressive to collect all corrupted objects

    :

    $ git gc --aggressive
    
  • Check if everything is functional, just in case?

    $ git fsck --full
    
  • 19.04.2018 / 21:25