Closed lutinwood closed 12 years ago
do you have 'Automatically fetch changes' setting in your redmine's repository settings?
Yes I do . in fact it does update the repository but not instanateously anyone got a clue
What if you run manually
ruby /var/www/redmine/script/runner Repository.fetch_changesets -e production
?
It strange . ...It say 's /var/lib/gems/1.8/gems/rails-2.3.14/lib/commands/runner.rb:48: /usr/share/redmine/vendor/plugins/redmine_git_hosting/lib/git_hosting.rb:291:in `initialize': Permission non accordée - /usr/share/redmine/vendor/plugins/redmine_git_hosting/bin/gitolite_admin_ssh (Errno::EACCES) but It does say that on two distinct system one is doing the update allright and the other one only sometime .. I've no crontab
Try reinstalling redmine from scratch and plugin. Use 1.3-stable branch for redmine otherwise plugin wouldn't work.
Any progress on this problem? It should work properly. I sounds like perhaps you have an installation problem.
Hi ,
Sorry i've been away for a week .. SO we sort the problem by modifing the plugin's setting "Git cache parameters" --> Max Cache Time from "until next commit " to "1 minute or until next commit" we thingk it could be a trouble with next commit action ..
Weird. Can't say that I've ever had to do that...
Can you tell me more about your configuration? I see you mention 2 systems above. Tell me about them:
I have to ask -- I am assuming that gitolite and redmine are running on the same system? If not, this plugin doesn't work well... (i.e. Do you have gitolite running on a separate system from redmine for at least on of your systems?) If so, I'm not sure that I'd expect things to be updated on the detached redmine.
Alternatively, assuming that you have two systems, each with redmine and gitolite, only one of which works consistently, I think that the permission denied problem is indicative of something. Is it possible that you have either a bad sudoers file or perhaps /tmp/redmine_git_hosting is owned by root instead of your web user (in that case, you could try deleting and restarting).
Most likely it's due your configuration.. Either redmine is not pulling updates or some permissions problem..
Did you look into ~/log/production.log or /var/log/syslog /var/log/messages? (there should be messages about sudo when you're updating or adding keys).
Ok i've check everything you've said : gitolite is running on the same system as redmine /tmp/redmine_git_hosting is owned by the web user the only thing than changed form one system to the other it's the way i've installed ruby .. One is using rvm and the other one not (the systeme where everything is working fine) .. I going to performed other test to clarify this I will let you know as soon as I find the origin opf the problem.
most likely redmine_git_hosting doesn't see path to rake
check if you can successfully execute rake from the console under user which redmine's running.
@gituser: His update path doesn't have to execute rake under normal operation. Thus, I suspect that isn't the problem. However, a path to ruby may actually be the problem.
@lutinwood, is the problem with the rvm system? In that case, I suspect that you need to install rvm for the git user (since the update code is a ruby script run by git when changes get pushed). Log in as the git user and see if you can run ruby...
@kubitron Yeah, you're right most likely git user can't execute needed script, because he doesn't know anything about rvm environment.
I'm going to close this out since I haven't heard anything further from you. If you want, you can reopen it. (last query was whether the git user has access to ruby -- it wouldn't if you install rvm for a different user).
HI,
I know I've been really silent those week ..
I did try to set up a new environement with everything clean ( redmine 1.3 stable - rvm system wide install -- ruby 1.8.7 - rake 0.9.2. net-ssh 2.5.2, 2.1.4 , lockfile 2.10, 1.4.3)
The all of it an a ubuntu 10.4 ( I'me using the development environement of redmine with postgres database)
I did create a web user ( is define by passenger in apache2 by PasengerUser directive) I did create a git user than keep in is home ( gitolite v3 ) I've tried with the version 2 but still have the same problem.
I 've followed you install guide . I've been trying with multiple version of the plugin (0.4.5x) || (master) || (0.4.5x)+ comit Thu May 31 (1aec25415cd) And I always got the same problem is the reason why I hope you see why !
I've setup the plugin to create repository automaticaly and delete it automaticaly Now the behaviour is completly different.. Wired behavior :
-c eval cat > ~/.ssh/gitolite_admin_id_rsa COMMAND=/bin/bash -c eval cat > ~/.ssh/gitolite_admin_id_rsa.pub COMMAND=/bin/bash -c eval chmod 600 ~/.ssh/gitolite_admin_id_rsa COMMAND=/bin/bash -c eval chmod 644 ~/.ssh/gitolite_admin_id_rsa.pub COMMAND=/bin/bash -c eval cd ~ ; pwd COMMAND=/bin/bash -c eval echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3/o7aWBkwqeAYYBKLdlVPlKm9NcscXDLKLxCEo2nZFNjRCU5Y8D9rOQzeHlTb0S8/cCVAZ5IbmXhqP/z1kBu7RlzRjWpmq9v37zuBTPLinqOxRPjeqd+STEa9zvq6GZtPexEZ8NK8ZXf1M4ebKHTKipPGXftRKID3RpK96usdtwWByF/oiPkNpgWaIDtoXPeh5qa2rG6ADSbFCrlNBa0jUOhSrdI1yBMm9wi6i54pjxfbS9sGyrfyVvS313bHAYnBUhUMTRE0F9YDyzCcjDADRfJ+9ERjJ8VqOMomAVFb0PC91TjNGazdf6nSxCA4540tp4WGfzGGKOpATtDXnf+4w== etud@test-vm-64b" > ~/.ssh/gitolite_admin_id_rsa.pub -c eval cat > ~/.ssh/run_gitolite_admin_ssh bash -c eval cat >> ~/.ssh/run_gitolite_admin_ssh bash -c eval chmod 644 ~/.ssh/gitolite_admin_id_rsa.pub bash -c eval chmod 600 ~/.ssh/gitolite_admin_id_rsa bash -c eval chmod 700 ~/.ssh/run_gitolite_admin_ssh
instead of
COMMAND=/bin/bash -c eval test -r ~/.gitolite/hooks/common/post-receive bash -c eval bash bash -c eval cat ~/.gitolite/hooks/common/post-receive bash -c eval find repositories/ -type d -name "_.git" -prune -print bash -c eval find recycle_bin/ -type d -regex recycle_bin/[0-9]+__msb.git -prune Accepted publickey for git from 172.20.41.8 port 38396 ssh2 pam_unix(sshd:session): session opened for user git by (uid=0) Received disconnect from 172.20.41.8: 11: disconnected by user pam_unix(sshd:session): session closed for user git bash -c eval git \"config\" \"-f\" \".gitconfig\" \"--get-regexp\" \"hooks.redminegitolite\" /bash -c eval find repositories/ -type d -name ".git" -prune -print -exec git config -f {}/config --get-regexp hooks.redmine_gitolite "\;" bash -c eval git \"--git-dir=repositories/msb.git\" \"config\" \"hooks.redmine_gitolite.key\" \"RLKWRTMPDUBQNMSWSQCXVSGPJIKRVMXMDGFHRCDTWXTLCSLEJCREHHWCVUCOWBFICELPUSQQRFKLHNLHDQDVYYGYLEN\"
In clear language it doesn' create the repository as it should ...
But Once the repository is created the key isnever added to the authorized key file of the dit user ..
And Nox I got some questions
I setup gitolite with the ssh key of my web user .. And some script create gitolite_admin_id_rsa keys in the git user home folder. (.ssh)
{ Git Repository Base Path, Subdirectory for Redmine-managed Repos , Git Recycle Bin Base Path, Subdirectory for HTTP access } all those fields get incremented by "./" ???
I know It could seem a bit messy I hope to being clear enought , I've been looking all way around but maybe the solution is in front of my noose but so big than I can't see it .
hope you could help .. thanks
did you add your user to the project?
you need to add it in the redmine settings for the particular project (even if it's an admin user).
I'm not entirely sure what problems you are seeing here. I would like to take them slowly.
I'm going to reopen this bug, but mark it as a configuration problem for now.
By the way: the trace that you are giving when you try to create a repository is an attempt by the plugin to "fix" the key, since it cannot access the gitolite repository for some reason.
If you look into the redmine log (again, log/production.log), you will probably see errors that indicate that it fails trying to access gitolite, then goes into a recovery mode, then gives up.
Can you show me your log? Grab the portion that occurs when you request a new repository.
@gituser
did you add your user to the project?
you need to add it in the redmine settings for the particular project (even if it's an admin user).
==> The admin is automaticaly added to the project as manager .. Manager got all right on project on my default config.. I got to clear that part ... ..
@kubitron
What does the redmine log say when you create a project?
If I use Logger::INFO level I get from my production ( my development .log for my case) ==>
Processing ProjectsController#create (for 172.20.41.149 at 2012-07-20 08:39:32) [POST] Parameters: {"action"=>"create", "controller"=>"projects", "authenticity_token"=>"sx6k9MmqwkQzBNOhXgCadYtCYvQVPpidl0LyPFhb1/I=", "project"=>{"is_public"=>"1", "identifier"=>"eighth", "name"=>"eighth", "description"=>"", "enabled_module_names"=>["repository", ""], "parent_id"=>"", "tracker_ids"=>["1", "2", "3", ""], "homepage"=>""}, "commit"=>"Create"} Redirected to http://xxxxxxx/projects/eighth/settings Completed in 1516ms (DB: 79) | 302 Found [http://xxxxxx/projects]
Processing ProjectsController#settings (for 172.20.41.149 at 2012-07-20 08:39:35) [GET] Parameters: {"action"=>"settings", "controller"=>"projects", "id"=>"eighth"} Rendering template within layouts/base Rendering projects/settings Completed in 3930ms (View: 3843, DB: 29) | 200 OK [http://xxxxxxxx/projects/eighth/settings]
==.. Did you remember to select the option to automatically create a new repository when you create a project? ==> I've set up that stright from the init.rb file and I did verify from the setting page
How do you know that the project is not created? ==> I check in the $home directory of my git user where repositories are stored ..; The project.git don't appear there! ($gituserhome/repositories) ==.. (I realize that you sent me a bunch of commands, but I am more curious about what the log/production.log file says from Redmine). ==> I've check the log/development.log but the /var/log/auth.log give me more information than the redmine log than provide to much information from the bd in debug mode and not enought for the info level. ==..
Note that some of the commands you are showing me seem to be about adding hooks to a project, not creating one. ==> The repository project is only created when I get into the setting page repository tab and save it .. (Output from the log/development.log (logger.level = logger::INFO)) Processing RepositoriesController#edit (for 172.20.41.149 at 2012-07-20 09:07:40) [POST] Parameters: {"action"=>"edit", "controller"=>"repositories", "id"=>"tenth", "extra"=>{"git_http"=>"0", "git_daemon"=>"0", "notify_cia"=>"0"}, "commit"=>"Save", "authenticity_token"=>"83662SimNzJp0YO5Ufbzt4l6XqWPvmg3AoI3Ba9Qdcw="} Fetching changes from gitolite-admin repository to /tmp/redmine_git_hosting/git-etud/gitolite-admin Our hook is already installed Creating new entry 'tenth' in gitolite.conf Letting gitolite create empty repository: 'repositories/tenth.git' Committing changes to gitolite-admin repository Setting up hooks for project 'tenth' (in gitolite repository at 'repositories/tenth.git') Completed in 7005ms (View: 2946, DB: 22) | 200 OK [http://xxxxxx/projects/tenth/repository/edit]
==.. Don't you have a bunch of test script than could be run to find where the problem could come from ? thanks anyway
@kubitron
When I try to update repositories from the command line is looking for recycle_bin ( set ./recycle_bin/ in the setting page ..) Should I create it by hand should it be created automaticaly ? rake redmine_git_hosting:update_repositories
Please install RDoc 2.4.2+ to generate documentation. DEPRECATION WARNING: Rake tasks in vendor/plugins/redmine_git_hosting/tasks, vendor/plugins/redmine_git_hosting/tasks, and vendor/plugins/redmine_git_hosting/tasks are deprecated. Use lib/tasks instead. (called from /usr/local/rvm/gems/ruby-1.8.7-p370@redmine/gems/rails-2.3.14/lib/tasks/rails.rb:10) [Performing manual update_repositories operation... find: "recycle_bin/": Aucun fichier ou dossier de ce type find: "recycle_bin/": Aucun fichier ou dossier de ce type DONE.]
Changes (deleting repositories after destroying project) are only performed when I run the command line script : rake redmine_git_hosting:update_repositories I've setup as enabled in the setting parameter + i've tick the checkbox when confirm is asked (? could it be ok in db and not performing in the code ?)
In the documetation guide it said "phantom synchronization problems, it is recommended that you execute fetch_changesets() regularly (every 15 to 30 minutes)."" This method is in /patches/sys_controller_patch.rb and /patches/git_repository_patch.rb
which one should be run when I delete a new project from redmine ?
Thanks,
--Tests Performed --
Create a project (public) from redmine with a repository SAVE
Observable ==> not any repository in $home_git_user/repository
run rake redmine_git_hosting:update_repositories
obs ==> the repository appear in $home_git_user/repository
from redmine nothing with deleted tick box obs ==> nothing happen in $home_git_user/repository
rake redmine_git_hosting:update_repositories or rake redmine_git_hosting:fetch_changesets
obs ==> nothing happen in $home_git_user/repository
I've reiinstall everythings.. gitolite v3 (latest) redmine_git_hosting (master) I'm using ruby 1.8.7 with rvm --- my git user don't have acces to the gem list of my web user could it be a problem
I've installed gitolite with the public key of my web user .
I've set up from the init.rb (git for every project , deleted repo when project deleted)
BEHAVIOR (Nothing special appear in the log/production.log)
when I create a project the project (project.git == git bare rpository) appear in the $git_home/repositories folder only once I've save from the repository's TAb setting of the project (Ps: I used to have it created automaticaly as I create the project)
revision are not update automatically
rake redmine_git_hosting:fetch_changesets RAILS_ENV=test
don't change anything
finnally I think my Rvm config could be a part of the problem .. I'll try without
thanks
Hello. Can I ask a simple question:
Do you have one server working properly? (I seem to remember that you have two different servers). The reason I ask is because that would allow you to see how the plugin is supposed to behave.
Here is some observations:
Ping! Are you still around?
I'm going to assume that this issue is closed for now. Please feel free to re-open it if you still have issues.
Hi , I'm getting a problem with the updating of the changeset table .. I'm using redmine 1.3.2 ruby 1.8.7 with rvm installed for the web user . gitolite 2 is installed ..
gitolite is working redmine browse the git repository correctly .
But I can't get any information about branch information changeset table is never updated ..
Do you have any clue how i can fixed that , where to look ?
Thanks ,
Jerry