Project

General

Profile

"The entry or revision was not found in the repository." when browsing repository after Git Push

Added by angelsl . over 13 years ago

Immediately after a Git Push, Redmine fails to show the repository tree (clicking on the repository tab).

It fails with this error "The entry or revision was not found in the repository.".

Doing a manual git gc fixes the problem, but it has to be done each time someone pushes.

I checked my error logs and it showed this:
fatal: Failed to resolve HEAD as a valid ref.
fatal: Not a valid object name HEAD:

Browsing the source, I pinpointed the method 'entries' in lib/redmine/scm/adapters/git.rb.
It called "git --git-dir <path> ls-tree -l HEAD:" which worked fine when I tried it out on the command line myself. I'm kinda confused.

Everything was fixed after a git gc, as stated above.

Help?


Replies (4)

RE: "The entry or revision was not found in the repository." when browsing repository after Git Push - Added by Felix Schäfer over 13 years ago

Make sure the git call works as the user running redmine. I don't know gitolite any better than before though, so I won't be able to give you better advice than what is in the other thread.

RE: "The entry or revision was not found in the repository." when browsing repository after Git Push - Added by angelsl . over 13 years ago

I have found the problem, it lies in git itself:

By default git will set permissions to whatever is given by 'umask', which by default is 0022 (600, i.e owner RW, group and world NIL)

The fix is to set core.sharedRepository to say, 740, so that those in git's group can read it.

Then you can simply dump redmine's user into git's group, and there will be no need to use the git user to run redmine. (I worked around my problem via suexec)

RE: "The entry or revision was not found in the repository." when browsing repository after Git Push - Added by angelsl . over 13 years ago

I forgot to include this:

git config core.sharedRepository 0740

    (1-4/4)