14
votes

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 [email protected]:andyshinn/puppet.git
 ! [remote rejected] ganglia -> ganglia (unpacker error)
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to '[email protected]: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?

2
looks like your repo is screwed up, try to fsck or I hope you have a backup or another clone to start overCharlesB
When I run git fsck --full it doesn't return anything. I assume there is nothing to fsck.Andy Shinn
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
I would take a guess and say the local repo is broken, but see my answer for the complete troubleshooting process.JonnyJD
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

2 Answers

8
votes

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.

0
votes

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.