ericpaulbishop / redmine_git_hosting

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

Migrating to sudo setup... not working #52

Closed that0n3guy closed 13 years ago

that0n3guy commented 13 years ago

My server has been working great for several months. But I recently updated to 2.1 and thought I'd upgrade this as well. I figured the sudo stuff was going to work nice and easy... but I can't get it to:

I am running chiliproject 2.1.

From my previous working setup, I updated to 2.1 code and db, then updated redmin_git_hosting and db. I changed the perms of /srv/www/chiliproject/.ssh to owner = www-data with perms of 600. I also modded my sudoers file and I figured that wold take care of it.

Some debugging

If I login to www-data (with root: su -s /bin/bash www-data) and run something like:

sudo -u git git clone /srv/git/repositories/gitolite-admin

It works just fine... which tells me that www-data (apache) can run commands with git. Right? But the plugin config page has 2 red exclamation marks next to the permissions so this tells me the opposite.

I also removed the /tmp/redmine_git_hosting directory since it seemed to have old ssh code in it. Then I rebooted and ran the rake for updating pluggins db... I have a new redmin_git_hosting dir in tmp... but it still doesn't work .

What am I missing? Its probably something really simple but I cant figure it out.

that0n3guy commented 13 years ago

I got the error below when trying to create a new project (thus a repo). I have a /tmp/redmine_git_hosting dir

Errno::ENOENT (No such file or directory - /tmp/redmine_git_hosting/gitolite-admin/conf/gitolite.conf):
vendor/plugins/redmine_git_hosting/app/models/git_hosting_observer.rb:64:in `update_repositories'
vendor/plugins/redmine_git_hosting/app/models/git_hosting_observer.rb:38:in `after_save'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/observer.rb:171:in `send'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/observer.rb:171:in `update'
/usr/lib/ruby/1.8/observer.rb:185:in `notify_observers'
/usr/lib/ruby/1.8/observer.rb:184:in `each'
/usr/lib/ruby/1.8/observer.rb:184:in `notify_observers'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:357:in `notify'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:350:in `callback'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:251:in `create_or_update'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2577:in `save_without_validation'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/validations.rb:1090:in `save_without_dirty'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/dirty.rb:79:in `save_without_transactions'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:229:in `send'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transacti$
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:182:in `transaction'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:196:in `save'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:196:in `save'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:215:in `send'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
app/controllers/repositories_controller.rb:41:in `edit_without_scm_settings'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:1333:in `send'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:1333:in `perform_action_without_filters'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/filters.rb:617:in `call_filters'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/flash.rb:151:in `perform_action'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:532:in `send'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:532:in `process_without_filters'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/filters.rb:606:in `process'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:391:in `process'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:386:in `call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/routing/route_set.rb:438:in `call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/dispatcher.rb:87:in `dispatch'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/dispatcher.rb:121:in `_call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/dispatcher.rb:130
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:29:in `call'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:29:in `call'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:9:in `cache'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:28:in `call'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/string_coercion.rb:25:in `call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/params_parser.rb:15:in `call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/session/cookie_store.rb:99:in `call'
Errno::ENOENT (No such file or directory - /tmp/redmine_git_hosting/gitolite-admin/conf/gitolite.conf):
vendor/plugins/redmine_git_hosting/app/models/git_hosting_observer.rb:64:in `update_repositories'
vendor/plugins/redmine_git_hosting/app/models/git_hosting_observer.rb:38:in `after_save'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/observer.rb:171:in `send'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/observer.rb:171:in `update'
/usr/lib/ruby/1.8/observer.rb:185:in `notify_observers'
/usr/lib/ruby/1.8/observer.rb:184:in `each'
/usr/lib/ruby/1.8/observer.rb:184:in `notify_observers'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:357:in `notify'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:350:in `callback'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/callbacks.rb:251:in `create_or_update'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/base.rb:2577:in `save_without_validation'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/validations.rb:1090:in `save_without_dirty'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/dirty.rb:79:in `save_without_transactions'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:229:in `send'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transacti$
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:182:in `transaction'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:196:in `save'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/transactions.rb:196:in `save'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:215:in `send'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
app/controllers/repositories_controller.rb:41:in `edit_without_scm_settings'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:1333:in `send'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:1333:in `perform_action_without_filters'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/filters.rb:617:in `call_filters'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/flash.rb:151:in `perform_action'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:532:in `send'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:532:in `process_without_filters'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/filters.rb:606:in `process'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:391:in `process'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/base.rb:386:in `call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/routing/route_set.rb:438:in `call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/dispatcher.rb:87:in `dispatch'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/dispatcher.rb:121:in `_call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/dispatcher.rb:130
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:29:in `call'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:29:in `call'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:9:in `cache'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/query_cache.rb:28:in `call'
lockfile/ruby/1.8/gems/activerecord-2.3.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/string_coercion.rb:25:in `call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/params_parser.rb:15:in `call'
lockfile/ruby/1.8/gems/actionpack-2.3.12/lib/action_controller/session/cookie_store.rb:99:in `call'
that0n3guy commented 13 years ago

Oh I am running ubuntu 10.04... so I am running sudo version 1.7.2p1... maybe thats the issue.

that0n3guy commented 13 years ago

Ok, I got it to work. I had to give user and group "chiliproject" access to my .ssh folder... NOT www-data

I also had to modify my sudoers file. I had to use "chiliproject" instead of www-data.

I think the DOCs are a little confusing. It says "This assumes www-data is your web server user". My apache webserver user is www-data, but ruby is user chiliproject so this is what was causing my confusion.

Thanks and I hope this helps someone else.