Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 1

"error: remote unpack failed: eof before pack header was fully read" (nothing helped so far)

Hi All


I have to admit I'm growing prety desperate at this point. Since there isn't much info about this error and what I managed to find didn't help. I do get it's kind of a generic error which doesn't tell what's wrong, and in all other cases I saw so far this error is accompanied with some other more specific error message. But in my case it isn't. I literally get:

$ git push --set-upstream origin master                                                                                                                                                                                                                                                  
Enumerating objects: 14403, done.                                                                                                                                                                                                                                                        
error: remote unpack failed: eof before pack header was fully read                                                                                                                                                                                                                       
error: failed to push some refs to 'ivan@server.lan:~/Git-Remote/Storage/Books.git'                                                                                                                                                                                                      

So any help will be appreciated! :)

I have to give you a good context of what I'm trying to do and what I've tried to fix the problem, so I'm sorry for the lenghtly post in advance.


The backup procedure.

So I use git both the standard way for source control and as a backup utility. I have a local git server set up which is on 24/7. In that server there are two 8TB hard drives.


I have multiple repos of binary data that I never modify, but only add new files to. That's pictures, music, software packages, movies etc... And the size of those repos varies between 20 to 100GB or bigger. Because of that I think it would be wasteful if the .git directory is in the repo itself. In some of the cases it's impossible, there isn't enough room in the HDD. So  before I execute:

git init

in the desired directory, I open cmd as administrator, go to the soon-to-be-repo and type something like:

mklink /D .git //HOME-SERVER/Git-Local/Storage/Books

This way, I create a symbolic link to a directory in the remote server named .git so when I type "git init" it fills up the remote directory instead of the local one it would've created if I didn't make the symlink. Then both "git add" and "git commit" involve network operations. Those take several hours.


All this data is sent into the 8TB hdd on the server mounted to the local machine as "Git-Local". Then I ssh the server and go to the other 8TB disk named "Git-Remote" where i create a directory named say "Books.git" and inside it I type:


git init --bare

Then back in the repo in the local machine I go:

git remote add origin ivan@server.lan:~/Git-Remote/Storage/Books.git

And finally:

git push --set-upstream origin master


You get the idea... I have done this procedure many times and It worked!


Only two repos failed to push to the remote so far with the above error message. As you can see this way I have three copies in three physical hard drives. One in the local machine and two in separate drives in the server. As you well know the .git can be cloned so it's a valid storage of data. So the repo in question "Books" has like ~30GB of pdf documents, *.doc, HTMLs, scanned books and techincal videos and courses in a large somewhat messy forlder structure. There are a lot of tini > 1kB files, that might be the issue.


I did the procedure several times from scratch. Wiping clean both the the .git and the Book.git directories starting the process from the beginning. It didn't help.

I tried


git fsck --full

but it didn't help too...


Thanks again for your patience reading through my post! :) I hope I explained the problem well. If you have any further questions feel free to ask.


P.S. For the record, I do know git isn't meant to be used like that but I like the commit history and traceability.