Project

General

Profile

Redmine not getting all info from Git repositories

Added by Andrew Vit over 13 years ago

Hi all,

My Redmine is set up with the redmine-gitosis plugin, and everything seems to be working correctly for setting up new repositories, commit access, etc.

Redmine can see the files, but it's missing some information: I'd like to troubleshoot this and hopefully offer a fix if I can figure out what's happening.

1. When I view a repository I get the file list with the name and size columns. The revision, age, author, and comment columns are blank. I can browse through folders and see all the files.
2. When I select a file:
a. Nothing shows up under "History".
b. Under "View", I get "The entry or revision was not found in the repository."
c. "Annotate" looks fine.
d. "Download" returns a blank page with status 406 Not Acceptable

The odd thing is, I think this was working when I first installed my Redmine. Obviously it's connecting to git if it can see the files and get the author info that shows up under "Annotate". Is this a known issue, or any idea what's wrong?

Thanks,
Andrew


Replies (10)

RE: Redmine not getting all info from Git repositories - Added by Andrew Vit over 13 years ago

Sorry, missed the specifics:

host os: debian-etch
git: 1.7.3.2

Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.3.7
Rack version 1.0
Rails version 2.3.5
Active Record version 2.3.5
Active Resource version 2.3.5
Action Mailer version 2.3.5
Active Support version 2.3.5
Application root /home/avitsys/redmine
Environment production
Database adapter mysql
Database schema version 20101101232409

About your Redmine plugins
Redmine Tagging plugin 0.0.1
Redmine Backlogs master branch (unstable)
Redmine Checkout plugin 0.5
Markdown formatter 0.0.1
Redmine Gitosis plugin 0.0.5alpha

RE: Redmine not getting all info from Git repositories - Added by Andrew Vit over 13 years ago

Hmm, that didn't include the redmine version... it's 1.0.3

RE: Redmine not getting all info from Git repositories - Added by Felix Schäfer over 13 years ago

Mmh, there were issues with the git adapter, but they should be fixed in 1.0.3, see source:/trunk/lib/redmine/scm/adapters/git_adapter.rb for an overview… Could you try to find out what all the failing files have in common? (funny filename, file permissions, …)

RE: Redmine not getting all info from Git repositories - Added by Andrew Vit over 13 years ago

I noticed the `no-color` option was added to the git commands in the diff from 1.0.2..1.0.3.

I'm not sure it's a problem with only some files: all of the files are affected. My file naming is strict. What permissions should I be looking for? Do you mean in the bare git repository?

RE: Redmine not getting all info from Git repositories - Added by Felix Schäfer over 13 years ago

Andrew Vit wrote:

What permissions should I be looking for? Do you mean in the bare git repository?

Make sure the user redmine is run as (probably not the apache user if using passenger) has read permissions on the repo.

RE: Redmine not getting all info from Git repositories - Added by Andrew Vit over 13 years ago

It does:

$ ps aux | grep redmine
avitsys  32199  5.5 11.9 196292 126932 ?       S    10:04   0:00 Rails: /home/avitsys/redmine                                                                                                                

$ ls -l | grep repositories
drwxr-xr-x  7 avitsys pg607232  4096 Nov  3 21:19 repositories

It's reading some of the info (file name & size), but not showing the author & other columns so I assume it must have access...

RE: Redmine not getting all info from Git repositories - Added by Felix Schäfer over 13 years ago

Mmh, I don't have any ideas left, can you deactivate your plugins to make sure it's not related to them, or maybe even get a "fresh" redmine and import one of your git repos into there? What does git --git-dir /path/to/repo log --no-color --date=iso --pretty=fuller --no-merges -n 1 -- any_file give you?

RE: Redmine not getting all info from Git repositories - Added by Andrew Vit over 13 years ago

Ok, I tried running it using script/server on :3000 (instead of passenger), and there it works fine! So, you must be right about some permissions somewhere...

RE: Redmine not getting all info from Git repositories - Added by Andrew Vit over 13 years ago

Just to follow up, I identified my problem:

I have 2 versions of git installed on my server: /usr/local/bin/git and an older one in /usr/bin/git

I had a --pretty option set up in my .gitconfig that wasn't working with the older version of git. So, when I ran script/server, it was using the newer version of git in my PATH and worked fine there, but passenger would try to use the old one instead...

    (1-10/10)