15

I'm not sure how I have got myself into this mess. But I am running into error: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null when trying to push my repository to GitHub. The full push:

[ashinn@puppet1 puppet]$ git push
Counting objects: 27, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (16/16), 5.67 KiB, done.
Total 16 (delta 6), reused 14 (delta 4)
error: object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22:contains entries pointing to null sha1
fatal: Error in object
error: unpack failed: index-pack abnormal exit
To git@github.com:andyshinn/puppet.git
 ! [remote rejected] ganglia -> ganglia (unpacker error)
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'git@github.com:andyshinn/puppet.git'
Everything up-to-date

Git ls-tree shows that my sudo module is a null sha1:

[ashinn@puppet1 puppet]$ git ls-tree 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22
...
160000 commit 2cc9d02b3cf27d6a06d85612c03710aa0d90149c  ssh
160000 commit 6961179007dce76d7fb9bd1fc361273acb4129a7  stdlib
160000 commit 0000000000000000000000000000000000000000  sudo
040000 tree 2bd16a8fab440081a876f64d720b5b4d9d119bc9    sysctl
040000 tree 01439b5a20363dccdf3f7103aab701fa7f4b3cd9    template
...

The listed ssh, stdlib, and sudo are submodules of external git repos. Folders sysctl and template are folders in the repo.

I have tried removing the module and re-adding it and can't seem to push any commit now. I've done some searching and found little on the error. How can I resolve this error?

Andy Shinn
  • 26,561
  • 8
  • 75
  • 93
  • looks like your repo is screwed up, try to fsck or I hope you have a backup or another clone to start over – CharlesB Sep 30 '12 at 11:32
  • When I run `git fsck --full` it doesn't return anything. I assume there is nothing to fsck. – Andy Shinn Oct 01 '12 at 17:39
  • It's hosted on GitHub. Am I suppose to just wipe it, create a new one, and push my current repo? Are you saying the destination is corrupt or the local copy? – Andy Shinn Oct 01 '12 at 19:22
  • I would take a guess and say the local repo is broken, but see my answer for the complete troubleshooting process. – JonnyJD Dec 23 '12 at 12:34
  • So it looks like the local repo is broken. Any way to repair the tree? Google doesn't come up with much information on the git tree. – Andy Shinn Feb 06 '13 at 18:09

2 Answers2

10

I was able to finally solve this issue. Here is what I did to solve it:

In article https://help.github.com/articles/remove-sensitive-data there is a heading for Purge the file from your repo. I following their example for removing the Rakefile but used the problematic folder instead:

git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch modules/sudo' --prune-empty --tag-name-filter cat -- --all

Since the problematic tree was a folder I added -r to the command. The result was a cleanup of all the commits for the sudo modiles and thus, object 15abe3addde5ad5f7d25e8f0f220d2e9faf3cb22 disappeared! After a commit of the changes, the push was successful. I was able to later re-add the broken module without issue.

Andy Shinn
  • 26,561
  • 8
  • 75
  • 93
0

Try cloning the github repo (bare) to another local directory. Then add this as a remote and try to push to that remote. If this fails, then your problem is probably local. (This would be my guess)

If not, I would still try to clone your "working repo" and try pushing from that clone to the local remote you added previously.

If this doesn't help, you either have rename/backup your github repo and create a new one or have to contact the github support.

JonnyJD
  • 2,593
  • 1
  • 28
  • 44
  • 1
    I'll accept this as it contained what I ultimately had to do, which was kill the GitHub repo and create it again and then push to it. It was a problem on the GitHub remote. I contacted GitHub support but didn't get very far with them. It was easiest just to blow it away and create it again. – Andy Shinn Jan 10 '13 at 17:44
  • I ran into this error again and tried this. But the same issue happens. the sudo commit has a null sha1. I killed the existing GitHub repo and tried to push to a new remote and get the same issue. Is it possible to repair the local repo? – Andy Shinn Feb 06 '13 at 18:08