kubitron / redmine_git_hosting

A ChiliProject/Redmine plugin which makes configuring your own git hosting easy.
78 stars 15 forks source link

Can't create repository, because of missing slash in the front of $HOME #40

Closed drakontia closed 12 years ago

drakontia commented 12 years ago

Hi, i failed to install the plugin of bishop version, so change to this version. i think the reason that my redmine is 1.3.2.

but, i don't complete to install yet. i think i need only little try. the error in production.log is below

Processing ProjectsController#create (for 203.189.96.135 at 2012-04-05 04:24:35) [POST]
  Parameters: {"authenticity_token"=>"QYYbLP0tNS6iEH/4LEctSMS16ptGvNsGaApXSjhOXZY=", "commit"=>"作成", "action"=>"create", "project"=>{"parent_id"=>"", "tracker_ids"=>["2", "3", "1", "7", "6", ""], "homepage"=>"", "is_public"=>"0", "description"=>"", "enabled_module_names"=>["issue_tracking", "time_tracking", "wiki", "repository", "calendar", "gantt", "backlogs", "charts", "code_review", "commit_relation_editor", ""], "name"=>"test5", "identifier"=>"test5"}, "controller"=>"projects"}
Redirected to http://drakontia.com/redmine/projects/test5/settings
Cloning gitolite-admin repository to /tmp/redmine_git_hosting/gitolite/gitolite-admin
Our hook is already installed
Adding gitolite key: redmine_drakontia_1333555108_412174.pub
Creating new entry 'test5' in gitolite.conf
  Letting gitolite create empty repository: 'home/gitolite/repositories/test5.git'
Committing changes to gitolite-admin repository
Updating Hook URL: http://drakontia.com/redmine/githooks/post-receive
Setting up hooks for project 'test5' (in gitolite repository at 'home/gitolite/repositories/test5.git')
***> Command failed (return 255): /opt/Redmine/vendor/plugins/redmine_git_hosting/bin/run_git_as_git_user --git-dir='home/gitolite/repositories/test5.git' config hooks.redmine_gitolite.key "FYTUGHRMTPOPQVHHDDFTTURYBVRPADQRSJGWTBLXOJIYIDSUOJCWQYYYCBDKFJCEEEWUMWQDOEUXPXITXHCBIIMSYAOA"
***>   error: could not lock config file home/gitolite/repositories/test5.git/config: No such file or directory
***> setup_hooks_for_project(11) failed!
Completed in 1290ms (DB: 28) | 302 Found [http://drakontia.com/redmine/projects]

just write "home/gitolite", not "/home/gitolite". passenger missing slash in the front of home. i didn't touch the setting about gitolitehome. it's easy problem?

thanks.

kubitron commented 12 years ago

Hello. This looks to me like you have your "repositories" setting set to "home/gitolite/repositories" instead of "repositories" which is what it should be set to.... (this setting cannot be absolute -- it is relative to the gitolite home).

(to be specific -- should be set to "repositories/").

--KUBI--

drakontia commented 12 years ago

i think so, at first. i dont change repositories setting in init.rb. just "repositories/" and i check the setting view on Redmine. it's written "./home/gitolite/repositories/". these are correct settings, i think. why miss slash?

kubitron commented 12 years ago

Hm.... Try changing this setting to "repositories/" on the setting page. See what happens

I'm not sure why it got messed up, but it should be "repositories/". Note that this setting cannot be absolute -- thus, if you happen to say "/home/gitolite/repositories/" it will change it to make it relative....

(Note that once you have started running, the init.rb file will not change any of the settings unless you use the special rake task to reinstall defaults; I don't recommend that here.)

kubitron commented 12 years ago

By the way -- what you see in the settings page is not the right setting. It is saying that the repositories are in:

~git/home/gitolite/repositories/

Which they are clearly not. That setting should be "./repositories/".

drakontia commented 12 years ago

i changed setting to "repositories/". ( before your last comment)

so, it seems that plugin create repositories correctly.

[root@drakontia Redmine]# ls -l /home/gitolite/repositories/
total 40
drwx------ 7 gitolite gitolite 4096 Apr  5 05:15 dotodo.git
drwx------ 8 gitolite gitolite 4096 Apr  5 05:15 gitolite-admin.git
drwx------ 7 gitolite gitolite 4096 Apr  5 05:15 server.git
drwx------ 7 gitolite gitolite 4096 Apr  5 05:15 test2.git
drwx------ 7 gitolite gitolite 4096 Apr  5 05:15 test3.git
drwx------ 7 gitolite gitolite 4096 Apr  5 05:15 test4.git
drwx------ 7 gitolite gitolite 4096 Apr  5 05:15 test5.git
drwx------ 7 gitolite gitolite 4096 Apr  5 05:15 test6.git
drwx------ 7 gitolite gitolite 4096 Apr  5 05:15 test.git
drwx------ 7 gitolite gitolite 4096 Apr  5 05:15 testing.git

(i tried to create new project "test6". i don't know why other repos already tried was create at same time) and check again settings. its changed to "./repositories/" so, maybe ok about the repos created at creating new project. i can't create repo after creating project yet. but i should be recreate project & repo, i think.

thanks

kubitron commented 12 years ago

OK. I am going to close this issue now (since it seems that things are working).

kubitron commented 12 years ago

Incidentally, the reason that the other projects "magically" appeared is because they were supposed to have been constructed earlier and weren't because of problems with the configuration. When you fixed the configuration, the plugin repaired the gitolite.conf file automatically (which constructs the new repos). This is proper behavior.

drakontia commented 12 years ago

i see the behavior. when something magically happen, i will ask you again.

by the way, in installation steps of README, you write "git_gitolite_admin_id_rsa" on (1). but on (4) write "gitolite_admin_id_rsa" and in init.rb also. when you're free, please rewrite.

kubitron commented 12 years ago

Oops. Thanks for finding the bug.