2

I am new to git and have been following various tutorials on setting up a centralized git server. For the past few days, I have been having trouble with the following error message:

Counting objects: 59, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (59/59), done.
Writing objects: 100% (59/59), 525.33 KiB | 0 bytes/s, done.
Total 59 (delta 15), reused 0 (delta 0)
remote: fatal: failed to read object 24e3826fe4be7dbaddbfcd698e943b5b8f9598ec : Bad file descriptor
error: unpack failed: unpack-objects abnormal exit
To ssh://git@[server url]/volume1/git/[project name]
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'ssh://git@[server url]/volume1/git/[project name]'

Initially, I used GitEye on my client side to manage git repository, but I encountered the problem when I tried to push my first commit to my linux server. So I played around with the permission and set the ownership of the whole git directory recursively to user "git". Nothing works. So I tried cloning a bare repository from the server and then try the push, but that didn't work either...returning me with unpacker error.

So I switch my software to Git Extensions and also trying the push on Git Bash...still the same error. Oh, forgot to mention that in the process, I deleted my local and remote git repository various times.

While one may argue that this may be a duplicate of git push over sshfs failing with “error when closing sha1 file: Bad file descriptor”, but I don't use sshfs and I am running Windows on my client side.

This may be a duplicate of Git push error - fatal: file '' write error: Bad file descriptor, but the push never works before.

UPDATE: With mentioning about the version, I wonder if the version mismatch between the server and the client is the source of the problem. So I downgrade my client git version from 1.9.4 to 1.8.4.msysgit.0, but still found the problem after deleting and recreating a new git repository.

What interesting though is that I also tried to copy manually the git repository from the client to the server and do a git status on the remote side. As a result, I encounter the bad file descriptor, but that error didn't appear on the client side.

Community
  • 1
  • 1
Ice Drake
  • 89
  • 1
  • 13
  • Any time you see `remote:` in front of an error, it's coming from the "other end" (the central server in this case). This particular error implies that there is a bug in the version of git on the server. That bug might only be triggered by your particular client and I have no idea what the real bug is (incorrect unpack, or failure to notice a problem in the pack file, are the two obvious candidates). I can't guess more from here, perhaps someone else can; identifying the server git version might help (or might not). – torek Sep 30 '14 at 09:46
  • My remote server is running git version 1.8.4.2 if it helps. – Ice Drake Sep 30 '14 at 09:56
  • This looks relevant: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735336 – torek Sep 30 '14 at 16:42
  • I took a look at the link to the bug. It may seem to be a different problem than what I have. It is encountering a missing tree while mine is just a bad file descriptor. – Ice Drake Oct 01 '14 at 01:25
  • It might be different, but I can see how it would give rise to the same behavior, something is missing from a thin pack and some code tries to use the missing item assuming it's not missing and depending on error checking you get "missing tree" (they checked the return value of open()) or "bad file descriptor" (they didn't). But I don't actually know. – torek Oct 01 '14 at 03:03

1 Answers1

2

I found the source of the problems. I tried to do a first commit on my remote side and I got "not a valid object" error. Thus, I have a bad git build on my remote side. Thanks for your guidance. It points me the right path to look.

Now I have to figure how to get a newer (or different) version of git for my remote platform without having to use ipkg.

Ice Drake
  • 89
  • 1
  • 13