redmine unable to find git even though it's installed

Added by Del Elson about 8 years ago

Hi all,

I'm facing a problem that I really don't know how to solve despite some days of digging and trying things out.


I installed Redmine v 2.3.0 stable on CentOS v6.4 along with git v1.7.1. Most of what is installed on the machine comes from the standard CentOS repositories -- there is almost nothing on the system other than redmine, apache, MySQL and git.

Ruby is version 1.8.7 (x86_64-linux) and Rails is version 3.2.13

I have a remote git repository (hosted on codesion) but I have set up an account on the system that periodically does a git pull from codesion (via cron) and stores the pulled repo in /home/redmine/myproject. Under project->repositories I have set up a repository as follows:

SCM = git
identifier = myproject-git
path to repo = /home/redmine/myproject/.git
report last commit = checked

Everything worked fine and has been working fine until yesterday. I could, until then, browse the repo in project->repositories, git commits have been appearing in the log of commits for the referenced tickets, git commits with a "fixes" log entry in them have been appropriately changing the status of tickets, time log entries have been appearing in tickets, etc. Everything working as well as could possibly be expected, much better than the previous ticketing system that I had been lumbered with.

Then, suddenly, mid afternoon yesterday, without anything changing on the system, it all stopped. If I go into the project repository from the redmine menu I see:

The entry or revision was not found in the repository.

Furthermore if I now go to Administration->Settings->Repositories it tells me that the git command is not found. Git is definitely installed in /usr/bin/git and I can run it from the command line as any user.

I have tried a bunch of stuff. I have created a config/configuration.yml file and set up the git command as /usr/bin/git and still Administration->Settings->Repositories now tells me that /usr/bin/git is not found. I even edited the /var/www/redmine/lib/redmine/scm/adapters/git_adapter.rb file and hard coded /usr/bin/git as the GIT_BIN command but it still tells me that /usr/bin/git is not installed. I have sym linked /usr/bin/git to /usr/local/bin/git just in case it was looking there but no luck.

I can't see anything in the logs of interest. Just for interest I cleared the log files in /var/www/redmine/log but I don't see anything there that reports that /usr/bin/git is missing or not found.

Next thing -- suddenly a few hours later, it all started working again, with no other changes from me. Then, another hour later it stopped, with the same messages and errors. It hasn't worked since, again with no errors in the log and no other explanation.

Is there anything I can add in here to explain why redmine periodically doesn't find /usr/bin/git even though it's installed, appears in the search path, and is working for every other user of the system but not for redmine?