Project

General

Profile

automatic refresh of repositories is not working

Added by Marc Richter over 9 years ago

Following this guide , I cannot confirm it is working.
There is only one repository in my RedMine, but multiple Projects.

When I do not set an id explicitly with https://rm.marc-richter.info/sys/fetch_changesets?key=XXXXXXXXXXXXXXXX, I get this error:

==> unicorn.stderr.log <==
fatal: Not a git repository: 'project1'

When I select the Project associated with the repo like this: https://rm.marc-richter.info/sys/fetch_changesets?key=XXXXXXXXXXXXXXXX&id=sysadmin-repo&, the following is writen to logs:

Started GET "/sys/fetch_changesets?key=XXXXXXXXXXXXXXXX&id=sysadmin-repo&" for 92.50.110.226 at 2014-12-19 10:43:22 +0000
Processing by SysController#fetch_changesets as HTML
  Parameters: {"key"=>"XXXXXXXXXXXXXXXX", "id"=>"sysadmin-repo"}
  Rendered text template (0.0ms)
Completed 404 Not Found in 3.2ms (Views: 0.6ms | ActiveRecord: 0.4ms)

Currently, I fetch the updates on the shell with a cronjob like this, which is working:

cd /home/redmine/data/repos/git
for x in * ; do
  cd ${x}
  git fetch -q
  cd /home/redmine/data/repos/git
done

What am I missing to get the remotely triggered update by Hooks working?


Replies (5)

RE: automatic refresh of repositories is not working - Added by Krishna Gollamudi over 9 years ago

Marc I just configured redmine with each project having its own respository but with different modules and created a rake tasks. Found it to be working fine without any issue. I didnt use Hooks though.

RE: automatic refresh of repositories is not working - Added by Marc Richter about 9 years ago

Hi Krishna,

thanks for your reply and sorry for my late answer.

What does your rake task look like?

RE: automatic refresh of repositories is not working - Added by Krishna Gollamudi about 9 years ago

here it is

rake -f /abc/def/redmine/Rakefile RAILS_ENV=production redmine:fetch_changesets

RE: automatic refresh of repositories is not working - Added by Marc Richter about 9 years ago

When I do so, I get the same error as when called by WebService:

root@afc9483ad8b6:/home/redmine/redmine# bundle exec rake -f $(readlink -f Rakefile) RAILS_ENV=production redmine:fetch_changesets
fatal: Not a git repository: 'pypobot'
root@afc9483ad8b6:/home/redmine/redmine#

I've found the solution to this error: 'pypobot' is a project, which has Repository Module activated, but no repository associated yet. That's why this error occours. When I disable the Repository Module from the project, this error is not shown anymore.
But my Repositories aren't updated, too.

This is what I have done to test it:

1. Created basic, publically available Git Repository at https://Judge82@bitbucket.org/Judge82/test4redmine.git

2. Then I have cloned it in bare mode on my Redmine server:

root@afc9483ad8b6:/home/redmine/data/repos/git# git clone --bare https://Judge82@bitbucket.org/Judge82/test4redmine.git
Cloning into bare repository 'test4redmine.git'...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
Checking connectivity... done.
root@afc9483ad8b6:/home/redmine/data/repos/git#

3. Added the repository in an existing Project of Redmine like this:

Main repo: no
Path to repo: /home/redmine/data/repos/git/test4redmine.git
Report last commit for files and directories: Yes

I can see and browse it in the "Repository" Tab now.

4. I then made a second commit (c8ecefb , see https://bitbucket.org/Judge82/test4redmine/commits/all).

5. Ran the Rake task like this: bundle exec rake -f $(readlink -f Rakefile) RAILS_ENV=production redmine:fetch_changesets ; it ran OK without any output.

But I still cannot see that second commit in Redmine. I still have to fetch this manually:

root@afc9483ad8b6:/home/redmine/data/repos/git/test4redmine.git# git fetch
From https://bitbucket.org/Judge82/test4redmine
 * branch            HEAD       -> FETCH_HEAD
root@afc9483ad8b6:/home/redmine/data/repos/git/test4redmine.git#

RE: automatic refresh of repositories is not working - Added by Kirill Rodin over 7 years ago

Have same problem. No logs, no errors. Webhook and rake command doesn't work. Do any body fix this?

    (1-5/5)