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

Asked

Viewed 655 times

11

I have on my machine a copy of the repository for work, another for maintenance and a third just to resolve conflicts of merge request. The external repository is in the https://gitlab.com

In the conflict resolution copy, I got the following by giving a 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 been through this problem of SHA1 COLLISION FOUND? Running a more aggressive GC solves? Or should I give one fetch forced (if there is such a thing)? And why do I get this error of inflate: data stream error (Unknown Compression method)?

In my other two copies the git fetch just works.


I followed the tip from @Wéllingthon M. de Souza and went after the answers to that question on Soen.

I tried to follow the two answers with the highest score now (1 and 2).

The first thing I did was follow up as 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 couldn’t 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 tried to simply copy the files, which worked, and then call the git unpack-objects -r for each copied file. It took some time, but the git returned saying it was a success. However, rotate git fsck keeps making the same mistake.

I can’t spin one either 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
  • 1

    Have you seen this reply down in the Soen ? Maybe it’ll help solve the problem

  • @Let me take a look, I hadn’t gotten there yet

  • 1

    Have you solved the problem ? There’s this other one question down in the Soen.

  • You did something out of the ordinary in your repository before you made this mistake?

  • Not that I’m aware of it. But I was open with Sourcetree and Eclipse. And I know that Eclipse has the egit of him who turns and moves makes some nonsense, while Sourcetree keeps trying to get the information from the remote once in a while

  • @wmsouza, I had a similar problem today. I decided to read calmly the answer that removes one of the references (this) and it worked. I’ll see if repeating the same done in the repository that gave the original bug I can also heal

Show 1 more comment

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 altered it a bit, but I took a backup after a few attempts to try to study the problem.

So much of the errors initially reported continue to happen:

$ 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

No longer has the problem of SHA1 COLLISION FOUND WITH, meanwhile.

The first thing I did was to close any application that could require blocking any git object (such as 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 do some tree pruning, but also without success:

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

Without more alternatives in view to try to solve via pure git, I decided to remove the broken reference and see if I can give a 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, what 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 the fsck to make sure everything’s okay...

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

Confirming that you’re back on balance Picking things up 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 especially thank @wmsouza for having given several references that, during this time, served so that I could understand what was happening and finally manage to recover from the problem in an elegant way

Recapping

  1. removal of references corrupt:

    $ rm rm .git/refs/remotes/origin/hotfix-{branch-1}
    
  2. garbage collection/Garbage Collector aggressive to collect all the objects corrupted:

    $ git gc --aggressive
    
  3. check that everything is functional, just in case?

    $ git fsck --full
    

Browser other questions tagged

You are not signed in. Login or sign up in order to post.