redmine_git_hosting
redmine_git_hosting copied to clipboard
Redmine Repository page is not updating correctly.
A project's Repository page does not seem able to track the project's repository. The repository itself seems to working fine, multiple users are able to push and pull from the repository, just the web view of the repository seems to be broken. This is what it looks like:
VM that has Redmine with redmine_git_plugin installed: http://i.imgur.com/8P7tE.png VM that has Redmine without redmine_git_plugin: http://i.imgur.com/8NEg0.png
The Redmine server is the WEBrick server that comes with Redmine, I've installed the plugin according to the instructions given, and gitolite was installed following this installation example under a user named 'gitolite'.
I'm using the following: Redhat Enterprise Linux 5 Redmine v1.2 Redmine_git_hosting v0.4.1
I'm not particularly familiar with Redmine, Ruby or Linux to figure out what might be going wrong here, and I didn't see any previous issues that were similar to this problem. Any help with this would be greatly appreciated, thank you.
This was a compatibility issue with Redmine Trunk. This should be fixed now, in the latest version (0.4.2), released today.
I've updated to version 0.4.2, and this problem still exists. I've tested with a clean install of Redmine as well, problem seems to still exist. Could it be something I'm doing in the installation process, or something else?
Try to enable the Redmine "Report last commit for files and directories" option. Many times, this option doesn't get enabled. By the way, make sure that your permissions are correct and whatnot. Your post-receive hook may not be working correctly (you can also check this in the plugin configuration panel).
Can you specify which svn revision of redmine you're using, specifically? I tested with latest trunk, and 1.2.1, it's possible there's somewhere in between where there is still a problem (or, there was a still newer commit than when I last tested and it broke again). Since I could replicate the problem, but only with redmine trunk (which I then fixed), I really need to know exactly what version you're working on before I can do any more to try to address this.
Is it possible this is related to my issue #80? I have Redmine Trunk, and one of the things I noticed was that when the mirrors didn't push was when the repository didn't update, although it always seems to update correctly for master. I'm on revision 7401.
I'm using 'Redmine 1.2.1.stable.7482 (MySQL)'. I obtained it with "svn co http://redmine.rubyforge.org/svn/branches/1.2-stable redmine-1.2".
'Autofetch commits' option is checked in the Administration > Repository page, if Roejames12's suggestion of enabling "Report last commit for files and directories" refers to the option mentioned here, http://www.redmine.org/issues/8365, I do not see that option anywhere.
As far as the plugin configuration panel, everything looks good as far as I can tell (http://i.imgur.com/6Amdb.png). What permissions might I be overlooking? What can I check for to see if the post-receive hook, or any hook, isn't functioning properly?
I don't know if this will be of any use, but here is the log immediately after creating a new project:
Processing ProjectsController#new (for 127.0.0.1 at 2011-09-28 08:44:00) [GET] Parameters: {"action"=>"new", "controller"=>"projects"} Rendering template within layouts/base Rendering projects/new Completed in 95ms (View: 46, DB: 31) | 200 OK [http://localhost/projects/new] remote: Counting objects: 22, done. remote: Compressing objects: 100% (17/17), done. remote: Total 22 (delta 3), reused 0 (delta 0) Receiving objects: 100% (22/22), done. Resolving deltas: 100% (3/3), done. Counting objects: 7, done. Compressing objects: 100% (3/3), done. Writing objects: 100% (4/4), 358 bytes, done. Total 4 (delta 1), reused 0 (delta 0) remote: remote: remote: Repository does not have "hooks.redmine_gitolite.key" set. Skipping hook. remote: remote: remote: creating blah2... remote: Initialized empty Git repository in /home/gitolite/repositories/blah2.git/ To gitolite@localhost:gitolite-admin.git e8b2d7f..948c5b1 master -> master
Processing ProjectsController#create (for 127.0.0.1 at 2011-09-28 08:44:07) [POST] Parameters: {"commit"=>"Save", "action"=>"create", "authenticity_token"=>"JxF9b3nL9BRO5lH47FzHpwvYATsVrXJkHzAYtM3wrxw=", "project"=>{"name"=>"blah 2", "tracker_ids"=>["1", "2", "3", ""], "homepage"=>"", "parent_id"=>"", "is_public"=>"1", "description"=>"", "identifier"=>"blah2", "enabled_module_names"=>["issue_tracking", "time_tracking", "news", "documents", "files", "wiki", > "repository", "boards", "calendar", "gantt", ""]}, "controller"=>"projects"} Redirected to http://localhost:3000/projects/blah2/settings Cloning gitolite-admin repository Our hook is already installed Our hook is already installed Setting up hooks for project blah2 Completed in 11922ms (DB: 278) | 302 Found [http://localhost/projects]
Processing ProjectsController#settings (for 127.0.0.1 at 2011-09-28 08:44:19) [GET] Parameters: {"action"=>"settings", "id"=>"blah2", "controller"=>"projects"} Rendering template within layouts/base Rendering projects/settings DEPRECATION WARNING: @repository will no longer be implicitly assigned to repository. (called from _run_rhtml_vendor47plugins47redmine_git_hosting47app47views47projects47settings47_repository46rhtml_locals_object_repository_tab at /home/vk/redmine-1.2/vendor/plugins/redmine_git_hosting/app/views/projects/settings/_repository.rhtml:56) DEPRECATION WARNING: @repository will no longer be implicitly assigned to repository. (called from _run_rhtml_vendor47plugins47redmine_git_hosting47app47views47projects47settings47_repository46rhtml_locals_object_repository_tab at /home/vk/redmine-1.2/vendor/plugins/redmine_git_hosting/app/views/projects/settings/_repository.rhtml:56) DEPRECATION WARNING: @repository will no longer be implicitly assigned to repository. (called from _run_rhtml_vendor47plugins47redmine_git_hosting47app47views47projects47settings47_repository46rhtml_locals_object_repository_tab at /home/vk/redmine-1.2/vendor/plugins/redmine_git_hosting/app/views/projects/settings/_repository.rhtml:56) DEPRECATION WARNING: @repository will no longer be implicitly assigned to repository. (called from _run_rhtml_vendor47plugins47redmine_git_hosting47app47views47projects47settings47_repository46rhtml_locals_object_repository_tab at /home/vk/redmine-1.2/vendor/plugins/redmine_git_hosting/app/views/projects/settings/_repository.rhtml:109) Completed in 654ms (View: 594, DB: 43) | 200 OK [http://localhost/projects/blah2/settings] fatal: Not a valid object name HEAD:
I tested with this svn revision of redmine, but I still haven't been able to reproduce your error. I figured out what was going on with the deprecation warnings you see in the log above (and fixed it), but that has nothing to do with repository display...
Additional info, hopefully of some use:
- The repository page will show the first commit, whether it's a single file or multiple files. If it's a single file on the first commit, I can view that first file, but commits there after are not shown, seemingly not tracked at all. On a few instances, while the second commit would not show up in the View page, it did appear in the Annotate page. Commits past the second do not appear anywhere.
- The Activity page does not pick up commits either, with the option to show Changesets checked.
Is there anyway that I can log what's occurring when Redmine or the plugin checks for new commits, or should be receiving a message of a new commit?
Some unrelated questions (not sure if these should be issues of their own):
- For the '/tmp/redmine_git_hosting/run_git_as_git_user', I've found it necessary to change "git $cmd" to "/usr/local/bin/git $cmd". Whenever an change is made in the plugin configuration panel, this change gets reverted. Is there a proper way to set this up that I missed?
- What's the proper method to update this plugin to a new version? Is it just deleting the redmine_git_hosting folder in vendor/plugins and replacing it with the updated version; or are there other/more steps involved?
Ah....
For the '/tmp/redmine_git_hosting/run_git_as_git_user', I've found it necessary to change "git $cmd" to "/usr/local/bin/git$cmd". Whenever an change is made in the plugin configuration panel, this change gets reverted. Is there a proper way to set this up that I missed?
That means git isn't in your PATH. Fix the problem with your environment PATH variable and try again.
Hi there,
First of all, thank you Eric for this great module ;)
I have exactly the same issue as discribe here, I can only see the first commit in the Redmine repository panel.
I have Redmine 1.2.1.stable (MySQL) and Redmine Git Hosting Plugin (v0.4.2). My PATH seems to be OK.
Best regards, Benoît.
Curious stuff. I found a way to make the Repository & Activity pages work, sort of. It seems that this problem revolves around the Max Cache Time parameter in the Git Cache Parameters section of the plugin configuration page. If it is set to 'until next commit', well, nothing seems to work. But if it's changed to '1 minute or until next commit', the Repository page will work.
Sort of. Or at least not how I expected it to work. I was expecting Redmine/the plugin to automatically detect new pushes, but that doesn't seem to be the case. I have to specifically refresh the Repository page of each individual project for any changes to show up in the Activity stream.
My initial test project for this was a single text file, that noted what I did each commit. I suppose I viewed the text file on the 3rd commit, when I tested the Max Cache Time toggling hypothesis, and did not attempt to view it until the 10th commit. But before I viewed the file a second time, I had changed Max Cache Time back to 'until next commit', and the file had not updated itself. Toggling back to '1 minute or until next commit', and going back to view the file, the file then updated to the current version.
When refreshing the Repository page, it takes a noticeable amount of time. between 6 and 10 seconds. I may add an edit to this on Monday, I think there's a minor detail or two I might be leaving out. Anyhow, these were the major findings of the day, hope it helps.
vkorapaty: it's not "Curious stuff." I told you, fix your PATH variable.
Git isn't in your path, so the code tries to access your repo, and can't because it can't access git. Then you go in and fix the code so that the exact path is in /tmp/redmine_git_hosting. But the wrong value is still cached... so when you edit it it doesn't fix the problem, but if you let the cache expire it starts working.
So... fix your PATH variables. Then try again.
bleleve: What tests have you performed to ensure that your path is ok? How do you know you don't have the same problem as vkorapaty?
git is in /usr/bin and this directory is in the root's PATH and the www-data's PATH too (Rails is loaded with the www-data user).
www-data@----:~$ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games www-data@----:~$ git --help usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [-c name=value] [--help] COMMAND [ARGS]
I'm still not convinced. Just because it's there when change to that user on the shell, doesn't mean it's accessible in rails/redmine. I just added a section in the plugin settings page to help debug path problems. Either install the latest repo code, or add the following code to app/views/settings/_redmine_git_hosting.html.erb:
<p>
<label>PATH Directories</label>
<%= (ENV['PATH']).gsub(/:/, "<br/>") %>
<br/>
</p>
Then let me know what the PATH Directories section shows in admin=>plugins=>redmine git hosting section of the web interface.
Git is installed to /usr/local/bin. I had edited the PATH to include that directory on both the Redmine and Gitolite users before starting the testing I did on Saturday. I did not have to edit the /tmp/redmine_git_hosting/run_git_as_git_user file, unlike before.
Added the code to the file and this is the result:
/usr/kerberos/bin /usr/local/bin /usr/bin /bin /usr/X11R6/bin /home/vk/bin
Redmine is installed under the user 'vk', and Gitolite is installed under the user 'gitolite'.
Here is the result :
PATH Directories /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /var/lib/gems/1.8/bin
Ok, you've convinced me it's not a PATH issue. Try running the following command as the redmine user, and let me know what the output is:
/tmp/redmine_git_hosting/run_git_as_git_user --git-dir="repositories/blah2.git" --work-tree="repositories/blah2.git" branch --no-color
This assumes you have a repository with id "blah2", as listed above by vkorapaty. If you have a repo named something else, substitute that in for blah2 above.
The output is : www-data@----:~$ /tmp/redmine_git_hosting/run_git_as_git_user --git-dir="repositories/myrepo.git" --work-tree="repositories/myrepo.git" branch --no-color
- master
Hmm.. that's the expected output, and it means you can run git just fine to access the repo. Which means whatever is going on is probably fairly subtle.
I'm going to try a couple more things to try to reproduce the problem. If I can actually get a system where this is happening I might be able to better figure out what's going on/ what's causing it.
[vk@localhost redmine-1.2]$ /tmp/redmine_git_hosting/run_git_as_git_user --git-dir="repositories/test.git" --work-tree="repositories/test.git" branch --no-color
- master
If it would help, I can upload a copy of the VMWare Player image I'm using, and instructions of the installation route I took. It would be a fairly large upload (4-6 gigs), so it might take a bit to get put up.
That would be very helpful, though you're going to have to find somewhere to upload it to -- I don't have anywhere with that much space available.
To clarify -- I don't have anywhere in the cloud with that much space currently available. I can download/test if you can specify somewhere I can download the image from.
I also have this issue. Live demo at https://dev.usoog.com/projects/viral-shift/repository (Yes the certificate is invalid)
Redmine 1.2.1 Redmine Git Hosting Plugin 0.4.2
Same issue here, the initial push (of an existing repo) went fine, but then subsequent pushes do not show up in the Repository page. When I access it, /var/log/httpd/error_log shows this the first time:
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /home/chili/.rvm/gems/ree-1.8.7-2011.03/gems/rails-2.3.14/lib/rails/gem_dependency.rb:21.
/home/chili/chiliproject/lib/redmine/scm/adapters/git_adapter.rb:21: warning: already initialized constant SCM_GIT_REPORT_LAST_COMMIT
/home/chili/chiliproject/lib/redmine/scm/adapters/git_adapter.rb:24: warning: already initialized constant GIT_BIN
And this every time after that:
fatal: Invalid object name '04'.
I use Chiliproject on CentOS 5.7 with Apache + mod_passenger. I got the plugin from git a few minutes ago.
btw Eric I can give you temporary access to this machine, it's not in production at all. Contact me privately for details. Thanks!
More info: git version 1.7.4, Ruby 1.8.7. I've tried with Ruby 1.9.2, but it doesn't help.
This message I see in httpd's (Apache) error log
fatal: Invalid object name '04'.
seems related, since it comes from git. Any easy way to debug all calls to git? Printing those to a logfile would be best. Thanks!
I'm seeing this issue as well. Comments and commits are missing from the Repository view, although the file tree displays properly otherwise.
Ubuntu 10.04.03 LTS Redmine 1.2.2 Redmine Git Hosting Plugin 0.4.2
A quick look at /var/log/apache2/error.log
and /usr/local/redmine/log/production.log
doesn't show anything out of the ordinary.
I'm just posting to say I'm seeing this too. Also, when creating blah2, I also got the message about 'remote: Repository does not have "hooks.redmine_gitolite.key" set. Skipping hook.' - is this important?
I was able to fix my problem by temporarily changing Max Cache Time to "1 minute or until next commit". After the cache was built, I changed that setting back to "until next commit" and things have been working fine since.
Same issue here. Changing the Max Cache Time only helps for one commit. After a commit the incommings only available when I click on repository tab. The push in hook debug returns:
$ git push Counting objects: 11, done. Delta compression using up to 2 threads. Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 500 bytes, done. Total 6 (delta 5), reused 0 (delta 0) remote: remote: remote: Repository does not have "hooks.redmine_gitolite.key" set. Skipping hook. remote: remote: To [email protected]:wwwproject.git 0abc00b..d42cb8d master -> master
Is there a way to fix it? Thank you.
I have a part of the solution. The problem was, that i have pushed a repository which not initialized by redmine. So, if you just have this problem, go, remove the remote repository in git (also in the file system), enable create repository for new project, check it out and add your sources to the repository, than push.