kubitron/redmine_git_hosting — Issue #16: update_repositories() failed
Author: Lncn
Created: 2012-02-18 05:35:52+00:00
State: open

I discovered a problem today with my installation when a user who was trying to register and clone a Git repo. It's hard to say how long this may have not worked as this is probably the first person to register in a week or so (we just use this on our internal network at work... maybe a 20 person or so operation)

Anyways, she was complaining that her git clone was getting rejected because she didn't have permissions. I checked her sshkey and it was loaded in the Redmine database, but when I checked the gitolite-admin repo, I didn't see the public key. I tried it myself and it didn't work again.

It looks like the plugin is having trouble with accessing the gitolite-admin repository and updating the keys. I checked the redmine production.log and saw that the access just suddenly stopped working last night at 3:34 am. I have the fetch_changesets running every minute on the crontab:

$ cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

* * * * * apache cd /var/www/redmine && /usr/bin/ruby script/runner "Repository.fetch_changesets" -e production 2&>1 | tee -a /var/www/redmine/log/repository.log

In the middle of the night, I just started getting this error:

Executing RESYNC_ALL operation on gitolite configuration
Fetching changes from gitolite-admin repository to /tmp/redmine_git_hosting/git/gitolite-admin
***> Command failed (return 128): env GIT_SSH=/var/www/redmine/vendor/plugins/redmine_git_hosting/bin/gitolite_admin_ssh git --git-dir='/tmp/redmine_git_hosting/git/gitolite-admin/.git' --work-tree='/tmp/redmine_git_hosting/git/gitolite-admin' merge FETCH_HEAD
***> error: Could not read 65cd0537d541169a217dd6831f7a7d62c89bc733
***> error: Could not read 65cd0537d541169a217dd6831f7a7d62c89bc733
***> fatal: unable to read tree 8fb3e85c975a610a84cc8c66cb17aad7f862a467
***> Failure to access gitolite-admin repository. Attempting to fix...
Reestablishing gitolite key
***> Command failed (return 1): /var/www/redmine/vendor/plugins/redmine_git_hosting/bin/run_as_git_user 'gl-setup ~/id_rsa.pub'
***> gl-setup: Command not found.
***> Failure again. Probably requires human intervention
***> git_hosting: update_repositories() failed

This may not be specifically related to the original problem, but I honestly don't really know where to begin debugging this. The "Could not read" and "unable to read tree" just looks like a problem with Git, but I can't seem to find much information on it. Any ideas on what could be going on here?

I'm using Redmine 1.3 (stable)