2

This problem is getting weirder.

My original post follows, but here is the new thing I discovered:

I executed

git push

and it gave me its usual error:

Counting objects: 9, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 588 bytes, done.
Total 5 (delta 4), reused 0 (delta 0)
remote: error: unable to create temporary file: No such file or directory
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To USER@REMOTE:/git/PROJECT.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'USER@REMOTE:/git/PROJECT.git'

So being overly optimistic, I thought maybe the "--verbose" option would give me some details, so I immediately tried again:

git push --verbose

and this time it worked:

Pushing to USER@REMOTE:/git/PROJECT.git
Counting objects: 9, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 588 bytes, done.
Total 5 (delta 4), reused 0 (delta 0)
To USER@REMOTE:/git/PROJECT.git
    87d6996..1cae8b3  master -> master
updating local tracking ref 'refs/remotes/origin/master'

so it's just totally flaky. I'm starting to suspect that git just doesn't like LDAP.

Original post:

We're transitioning from cvs to git, and I have a test setup where I have a git server that authenticates users with LDAP, let's call it REMOTE, and then my personal machine, let's call it LOCAL. Both machines are Macs. All employees of the company (including me) are members of a group I'll cleverly call GROUP.

I ssh'd to REMOTE as me and created a git repository there in a folder named /git/PROJECT.git using cvs2git.

Then, back on LOCAL, I did:

git clone USER@REMOTE:/git/PROJECT.git

which was fine. On my Mac ("LOCAL") I then edited a few files, deleted a couple, and did

git -a FILES
git rm FILES
git commit -m 'COMMENT'

and life was good.

Then (still on LOCAL) I executed:

git push

to push my changes from LOCAL back to REMOTE and got this:

Counting objects: 19, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (10/10), 1.46 KiB, done.
Total 10 (delta 8), reused 0 (delta 0)
remote: error: unable to create temporary file: No such file or directory
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To USER@git-server-co.local:/git/PROJECT.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'USER@git-server-co.local:/git/PROJECT.git'

I researched this problem and it sounded like it might be that might $TMPDIR is wrong, so I ssh'ed to REMOTE, created a directory named /git/tmp, made sure it had write permissions, edited my .bashrc, and set $TMPDIR to /git/tmp.

Back on LOCAL, if I execute

ssh USER@REMOTE echo \$TMPDIR

I correctly see the response

/git/tmp

If I ssh to REMOTE and check file permissions, here's what I see:

ls -l /git
drwxrwxrwx  USER GROUP   tmp
drwxrwsr-x  USER  GROUP   PROJECT.git

ls -l /git/PROJECT.git

all files are rw for owner (me) and group

What else could be causing this error?

p.s. As is the standard on Macs, if I execute:

ssh ADMIN@REMOTE
cd /
ls -l

I see symbolic links: tmp -> /private/tmp, var -> /private/var, and etc -> /private/etc. I adjusted the permissions and ownership so now they are set to:

lrwxr-xr-x   USER   GROUP   etc -> /private/etc
lrwxr-xr-x   USER   GROUP   tmp -> /private/tmp
lrwxr-xr-x   USER   GROUP   var -> /private/var

I also updated the permissions of the actual folders, so if I execute:

cd /private
ls -al

I see:

drwxr-xr-x   USER   GROUP   etc
drwxrwxrwt   USER   GROUP   tmp
drwxr-xr-x   USER   GROUP   var

And finally, if I :

cd /private/var
ls -al

I see:

drwxrwxrwt    USER   GROUP   tmp

migrated from serverfault.com Dec 15 '13 at 16:07

This question came from our site for system and network administrators.

1

First, I would check why you've got the "error: unable to create temporary file: No such file or directory" at the first attempt. What was the initial $TMPDIR? Was it different from /tmp or /var/tmp? Could you check permissions for these two directories? Have you considered adding "-v" to git's commands, to see the details? If you really would like to use different TMPDIR, consider adding this variable to some other "dot file", like .profile.

  • Intially, TMPDIR is not set to anything. If I set it to /tmp in my .bashrc, the error message is the same. – Betty Crokker Dec 10 '13 at 15:30
  • I've also added a "p.s." to my original post with details about the various /tmp directories on my Mac. – Betty Crokker Dec 10 '13 at 15:54
  • And typing "git push --verbose" inserts one additional line at the top of the output: "Pushing to USER@REMOTE:/git/PROJECT.git" – Betty Crokker Dec 10 '13 at 16:01
1

I also got this error: error: unable to create temporary file: Not a directory. while adding a file. (git add filename.ext)

I checked in .git folder and found a suspicious file e4(maybe corrupted). e4 should be a directory but it wasn't. So, I removed the file (named e4 in my case) from .git/objects/

rm -rf .git/objects/e4

Then error didn't happen again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy