Skip to content

not able to create initial repository #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ptr-reinold opened this issue Jul 15, 2014 · 18 comments
Closed

not able to create initial repository #237

ptr-reinold opened this issue Jul 15, 2014 · 18 comments
Assignees

Comments

@ptr-reinold
Copy link

Hi,

I installed redmine_git_hosting plugin v0.7.3 following https://github.com/jbox-web/redmine_git_hosting/wiki/Step-by-step-installation-instructions and the Plugin's 'Config Test' shows that everything (should) work fine.
I also set GIT_CONFIG_KEYS => '.*',
I disabled Sidekiq.
I activated initial repository creation with README.
When I create a new project, git_hosting.log says that a new project was created. But when I check in gitolite v3, no project is there.
I read in previous issues, that it helped to remove /tmp/redmine_git_hosting and to reinstall gitolite, but after doing so I still got the same error. Further I tried using gitolitev2, but that also returned the same error. I also tried redmine_git_hosting dev version 0.7.5 -> same problem.

To me it seems, that the hooks are not properly set (though the admin panel 'Config Test' claims, that everything is fine).

git_hosting.log

2014-07-15 20:09:29 +0200 INFO [GitHosting] User 'reinold' created a new repository 'redmine/test'
2014-07-15 20:09:29 +0200 INFO [GitWorker] Clone Gitolite Admin Repo : git@localhost/gitolite-admin.git (port : xxx) to /tmp/redmine_git_hosting/git/gitolite-admin.git
2014-07-15 20:09:29 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-07-15 20:09:29 +0200 INFO [GitWorker] add_repository : repository 'redmine/test' does not exist in Gitolite, create it ...
2014-07-15 20:09:29 +0200 INFO [GitWorker] add_repository : commiting to Gitolite...
2014-07-15 20:09:30 +0200 INFO [GitWorker] add_repository : let Gitolite create empty repository 'repositories/redmine/test.git'
2014-07-15 20:09:30 +0200 INFO [GitWorker] add_repository : pushing to Gitolite...
2014-07-15 20:09:30 +0200 INFO [GitWorker] add_repository : done !
2014-07-15 20:09:30 +0200 INFO [GitWorker] Create README file for repository 'redmine/test'
2014-07-15 20:09:30 +0200 ERROR [GitWorker] Error while creating README file for repository 'redmine/test'
2014-07-15 20:09:30 +0200 ERROR [GitWorker] Command output : 'Cloning into '/tmp/d20140715-16423-ypnvu8'...
[GitWorker]  fatal: '/usr/local/git/repositories/redmine/test.git' does not appear to be a git repository
[GitWorker]  fatal: The remote end hung up unexpectedly'
2014-07-15 20:09:30 +0200 ERROR [GitCache] Git exited with non-zero status : 128

gitolitev2 log (gitolitev3 looks similiar...):

2014-07-15.20:09:29     admin   ::1     git-upload-pack '/gitolite-admin.git'
2014-07-15.20:09:30     admin   5.45.104.136    git-upload-pack '/redmine/test.git'

Any idea what I am doing wrong?
Reinold

@n-rodriguez n-rodriguez self-assigned this Jul 16, 2014
@n-rodriguez
Copy link
Contributor

Hi!

Thanks for your feedback!

Any idea what I am doing wrong?

Nothing :)

Which version of ’gitlab-grit is installed? (bundle list)

I think the bug comes from here. More details here.

Can you test with the v0.7.6 branch?

By the way, you can keep using Gitolite 3 ;)

@ptr-reinold
Copy link
Author

Hi,

Thanks a lot! I installed the new version and It works now - also with gitolitev3! :)

Sadly there is another weird issue now:
From time to time an operation is not executed. So sometimes the README is not initialized in the repo. Another time redmine is not updated after a push (although in gitolite itself the changes are existant).
That is why now i activated Sidekiq since it caches the requests and maybe helps avoiding to "lose" the jobs?

I start redis-server and then execute
"RAILS_ENV=production sidekiq -C plugins/redmine_git_hosting/config/sidekiq-worker.yml"

When a request is "lost" I can see it now in the sidekiq "enqueued" queue. But it just stays there and is never executed?

Next i tried using you script contrib/service_sidekiq.sh
It results in:

Start Sidekiq...
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
database configuration does not specify adapter
/var/lib/gems/1.9.1/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:47:in `resolve_hash_connection'
/var/lib/gems/1.9.1/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:in `resolve_string_connection'
/var/lib/gems/1.9.1/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in `spec'
/var/lib/gems/1.9.1/gems/activerecord-3.2.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection'
/var/lib/gems/1.9.1/gems/activerecord-3.2.17/lib/active_record/railtie.rb:88:in `block (2 levels) in <class:Railtie>'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/lazy_load_hooks.rb:25:in `each'
/var/lib/gems/1.9.1/gems/activesupport-3.2.17/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
/var/lib/gems/1.9.1/gems/activerecord-3.2.17/lib/active_record/railtie.rb:80:in `block in <class:Railtie>'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `instance_exec'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `run'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/initializable.rb:55:in `block in run_initializers'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `each'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `run_initializers'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/application.rb:136:in `initialize!'
/var/lib/gems/1.9.1/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `method_missing'
/usr/local/redmine/redmine-2.5.0/config/environment.rb:14:in `<top (required)>'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/var/lib/gems/1.9.1/gems/sidekiq-3.2.1/lib/sidekiq/cli.rb:227:in `boot_system'
/var/lib/gems/1.9.1/gems/sidekiq-3.2.1/lib/sidekiq/cli.rb:49:in `run'
/var/lib/gems/1.9.1/gems/sidekiq-3.2.1/bin/sidekiq:8:in `<top (required)>'
/usr/local/bin/sidekiq:23:in `load'
/usr/local/bin/sidekiq:23:in `<main>'
Done

Not sure what I am doing wrong here :(

@n-rodriguez
Copy link
Contributor

From time to time an operation is not executed. So sometimes the README is not initialized in the repo.

This is not normal... Do you have logs?

Another time redmine is not updated after a push (although in gitolite itself the changes are existant).

What do you mean? Do you mean when you push code in a repo or when you create a repo?

In both case this is not normal too. Can you enable hook debug? (in Administration -> Redmine Git Hosting -> Hooks) and retry to push code?

That is why now i activated Sidekiq since it caches the requests and maybe helps avoiding to "lose" the jobs?

To be more precise, actually it does not cache the request but put every request in Redis in a FIFO style so the worker can execute them later one by one.

@n-rodriguez
Copy link
Contributor

Next i tried using you script contrib/service_sidekiq.sh
It results in:

Can you please try with this new version of the script : https://github.com/jbox-web/redmine_git_hosting/blob/devel/contrib/scripts/service_sidekiq.sh ?

@ptr-reinold
Copy link
Author

The link https://github.com/jbox-web/redmine_git_hosting/blob/devel/contrib/scripts/service_sidekiq.sh does not work for me :(

It behaves now really weird. I disabled sidekiq. I activated the debug hooks. I restarted apache.
After that it took several minutes and like 5 times creating and deleting test repos, until the DEBUG finally started logging in the logfile? I am not sure how this is possible?

git_hosting.log:

2014-07-17 22:45:17 +0200 ERROR [GitHosting] Problems to retrieve Gitolite hook parameters in Gitolite config
2014-07-17 22:45:17 +0200 INFO [GitHosting] Testing if Gitolite user 'git' can sudo to Redmine user 'redmine'...
2014-07-17 22:45:17 +0200 INFO [GitHosting] OK!
2014-07-17 22:45:17 +0200 INFO [GitHosting] Testing if Redmine user 'redmine' can sudo to Gitolite user 'git'...
2014-07-17 22:45:17 +0200 INFO [GitHosting] OK!
2014-07-17 22:45:17 +0200 ERROR [GitHosting] Problems to retrieve Gitolite hook parameters in Gitolite config
2014-07-17 22:45:17 +0200 INFO [GitHosting] Set Git hooks global parameter : redmineurl (https://redmine.example.com/githooks/post-receive/redmine)
2014-07-17 22:45:17 +0200 INFO [GitHosting] Set Git hooks global parameter : debugmode (true)
2014-07-17 22:45:17 +0200 INFO [GitHosting] Set Git hooks global parameter : asyncmode (false)
2014-07-17 22:45:17 +0200 INFO [GitHosting] Global hook directory '~/.gitolite/hooks/common/post-receive.d' not created yet, installing it...
2014-07-17 22:45:17 +0200 INFO [GitHosting] Installing hook directory '~/.gitolite/hooks/common/post-receive.d'
2014-07-17 22:45:17 +0200 INFO [GitHosting] Global hook directory '~/.gitolite/hooks/common/post-receive.d' installed
2014-07-17 22:45:17 +0200 INFO [GitHosting] Hook 'post-receive.redmine_gitolite.rb' does not exist, installing it ...
2014-07-17 22:45:17 +0200 INFO [GitHosting] Installing hook '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/contrib/hooks/post-receive.redmine_gitolite.rb' in '~/.gitolite/hooks/common/post-receive'
2014-07-17 22:45:18 +0200 INFO [GitHosting] Hook 'post-receive.redmine_gitolite.rb' installed
2014-07-17 22:45:18 +0200 INFO [GitHosting] Running 'gitolite setup' on the Gitolite install ...
2014-07-17 22:45:19 +0200 INFO [GitHosting] Hook 'post-receive.git_multimail.py' does not exist, installing it ...
2014-07-17 22:45:19 +0200 INFO [GitHosting] Installing hook '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/contrib/hooks/post-receive.git_multimail.py' in '~/.gitolite/hooks/common/post-receive.d/git_multimail.py'
2014-07-17 22:45:19 +0200 INFO [GitHosting] Hook 'post-receive.git_multimail.py' installed
2014-07-17 22:45:19 +0200 INFO [GitHosting] Running 'gitolite setup' on the Gitolite install ...
2014-07-17 22:45:20 +0200 INFO [GitHosting] Hook 'post-receive.mail_notifications.py' does not exist, installing it ...
2014-07-17 22:45:20 +0200 INFO [GitHosting] Installing hook '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/contrib/hooks/post-receive.mail_notifications.py' in '~/.gitolite/hooks/common/post-receive.d/mail_notifications'
2014-07-17 22:45:20 +0200 INFO [GitHosting] Hook 'post-receive.mail_notifications.py' installed
2014-07-17 22:45:20 +0200 INFO [GitHosting] Running 'gitolite setup' on the Gitolite install ...
2014-07-17 22:45:21 +0200 INFO [GitHosting] Installing Redmine Gitolite mirroring SSH keys ...
2014-07-17 22:45:21 +0200 INFO [GitHosting] Done !

Anyways now I can not clone any repository anymore (DENIED by fallthru) :(
It creates now always without any trouble a new repo with a README file. But I cannot clone it... I reinstalled gitolite again, I reset my users ssh key in gitolite -> no success. In git_host.log there is not even any entry about my clone try.

git_hosting.log

2014-07-17 22:52:07 +0200 INFO [GitHosting] User 'peter' has deleted a SSH key
2014-07-17 22:52:07 +0200 INFO [GitHosting] Delete SSH key redmine_peter@redmine_1405629234_865032
2014-07-17 22:52:07 +0200 DEBUG [GitWorker] delete_ssh_key : get lock !
2014-07-17 22:52:07 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-07-17 22:52:07 +0200 INFO [GitWorker] delete_ssh_key : SSH key 'redmine_peter@redmine_1405629234_865032' exists in Gitolite, delete it ...
2014-07-17 22:52:07 +0200 INFO [GitWorker] delete_ssh_key : commiting to Gitolite...
2014-07-17 22:52:07 +0200 INFO [GitWorker] delete_ssh_key : pushing to Gitolite...
2014-07-17 22:52:09 +0200 INFO [GitWorker] delete_ssh_key : done !
2014-07-17 22:52:09 +0200 DEBUG [GitWorker] delete_ssh_key : lock released !
2014-07-17 22:52:51 +0200 DEBUG [GitHosting]  ssh-keygen -l -f /tmp/foo20140717-7173-q2g2xy 2>&1
2014-07-17 22:52:51 +0200 INFO [GitHosting] User 'peter' has added a SSH key
2014-07-17 22:52:51 +0200 DEBUG [GitWorker] add_ssh_key : get lock !
2014-07-17 22:52:51 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-07-17 22:52:51 +0200 INFO [GitWorker] add_ssh_key : SSH key 'redmine_peter@redmine_1405630371_855075' does not exist in Gitolite, create it ...
2014-07-17 22:52:51 +0200 INFO [GitWorker] add_ssh_key : commiting to Gitolite...
2014-07-17 22:52:51 +0200 INFO [GitWorker] add_ssh_key : pushing to Gitolite...
2014-07-17 22:52:53 +0200 INFO [GitWorker] add_ssh_key : done !
2014-07-17 22:52:53 +0200 DEBUG [GitWorker] add_ssh_key : lock released !
2014-07-17 22:53:43 +0200 INFO [GitHosting] User 'peter' created a new repository 'redmine/test2'
2014-07-17 22:53:43 +0200 DEBUG [GitWorker] add_repository : get lock !
2014-07-17 22:53:43 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-07-17 22:53:43 +0200 INFO [GitWorker] add_repository : repository 'redmine/test2' does not exist in Gitolite, create it ...
2014-07-17 22:53:43 +0200 DEBUG [GitWorker] add_repository : repository path 'repositories/redmine/test2.git'
2014-07-17 22:53:43 +0200 INFO [GitWorker] add_repository : commiting to Gitolite...
2014-07-17 22:53:43 +0200 DEBUG [GitHosting] /usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_shell_cmd_as_gitolite_user find 'recycle_bin/' -type d -regex 'recycle_bin/[0-9]+__redmine__test2.git' -prune -print 2> /dev/null 2>&1
2014-07-17 22:53:43 +0200 INFO [GitWorker] add_repository : let Gitolite create empty repository 'repositories/redmine/test2.git'
2014-07-17 22:53:43 +0200 INFO [GitWorker] add_repository : pushing to Gitolite...
2014-07-17 22:53:45 +0200 INFO [GitWorker] add_repository : done !
2014-07-17 22:53:45 +0200 DEBUG [GitWorker] add_repository : lock released !
2014-07-17 22:53:45 +0200 DEBUG [GitHosting] /usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_shell_cmd_as_gitolite_user find 'repositories/redmine/test2.git/objects' -type f | wc -l 2>&1
2014-07-17 22:53:45 +0200 DEBUG [GitWorker] add_repository : counted objects in repository directory 'repositories/redmine/test2.git' : '0'
2014-07-17 22:53:45 +0200 INFO [GitWorker] Create README file for repository 'redmine/test2'
2014-07-17 22:53:45 +0200 DEBUG [GitHosting]  env GIT_SSH=/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/gitolite_admin_ssh git clone ssh://[email protected]:my_port/redmine/test2.git /tmp/d20140717-7173-k6oxxi 2>&1 && cd /tmp/d20140717-7173-k6oxxi && echo '## redmine/test2' >> README.md && git add README.md && git commit README.md -m 'Initialize repository' && env GIT_SSH=/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/gitolite_admin_ssh git push -u origin master 2>&1
2014-07-17 22:53:47 +0200 INFO [GitHooks] ["  Current user: anonymous"]
2014-07-17 22:53:48 +0200 INFO [GitCache] Removed '0' expired cache entries for repository 'test2'
2014-07-17 22:53:48 +0200 INFO [GitHooks] Fetching changesets for 'test2' repository ... 
2014-07-17 22:53:48 +0200 DEBUG [GitHosting] Lookup for git_cache_id with repository path 'repositories/redmine/test2.git' ... 
2014-07-17 22:53:48 +0200 DEBUG [GitHosting] Found git_cache_id ('test2'), call cache... 
2014-07-17 22:53:48 +0200 DEBUG [GitHosting] Send GitCommand : '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/redmine/test2.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'branch' '--no-color' '--verbose' '--no-abbrev'
2014-07-17 22:53:48 +0200 DEBUG [GitCache] Probing cache entry
2014-07-17 22:53:48 +0200 DEBUG [GitCache] '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/redmine/test2.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'branch' '--no-color' '--verbose' '--no-abbrev'
2014-07-17 22:53:48 +0200 DEBUG [GitCache] Inserting cache entry for repository 'test2'
2014-07-17 22:53:48 +0200 DEBUG [GitCache] '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/redmine/test2.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'branch' '--no-color' '--verbose' '--no-abbrev'
2014-07-17 22:53:49 +0200 DEBUG [GitHosting] Lookup for git_cache_id with repository path 'repositories/redmine/test2.git' ... 
2014-07-17 22:53:49 +0200 DEBUG [GitHosting] Found git_cache_id ('test2'), call cache... 
2014-07-17 22:53:49 +0200 DEBUG [GitHosting] Send GitCommand : '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/redmine/test2.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'log' '--no-color' '--encoding=UTF-8' '--raw' '--date=iso' '--pretty=fuller' '--parents' '--stdin' '--reverse'
2014-07-17 22:53:49 +0200 DEBUG [GitCache] Probing cache entry
2014-07-17 22:53:49 +0200 DEBUG [GitCache] '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/redmine/test2.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'log' '--no-color' '--encoding=UTF-8' '--raw' '--date=iso' '--pretty=fuller' '--parents' '--stdin' '--reverse'
[GitCache]d7471949dc475ac3651bff99b60dda903d147051
[GitCache]
2014-07-17 22:53:49 +0200 DEBUG [GitCache] Inserting cache entry for repository 'test2'
2014-07-17 22:53:49 +0200 DEBUG [GitCache] '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/redmine/test2.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'log' '--no-color' '--encoding=UTF-8' '--raw' '--date=iso' '--pretty=fuller' '--parents' '--stdin' '--reverse'
[GitCache]d7471949dc475ac3651bff99b60dda903d147051
[GitCache]
2014-07-17 22:53:50 +0200 INFO [GitHooks] Succeeded!
2014-07-17 22:53:50 +0200 INFO [GitHooks] Creating branch 'master'
2014-07-17 22:53:50 +0200 DEBUG [GitHosting] /usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user --git-dir='repositories/redmine/test2.git' rev-list --reverse d7471949dc475ac3651bff99b60dda903d147051 2>&1
2014-07-17 22:53:50 +0200 DEBUG [GitHooks] Revisions in range : d7471949dc475ac3651bff99b60dda903d147051
2014-07-17 22:53:50 +0200 DEBUG [GitHooks] Revision : 'd7471949dc475ac3651bff99b60dda903d147051'
2014-07-17 22:53:51 +0200 INFO [GitWorker] README file successfully created for repository 'redmine/test2'
2014-07-17 22:53:51 +0200 DEBUG [GitHosting] Lookup for git_cache_id with repository path 'repositories/redmine/test2.git' ... 
2014-07-17 22:53:51 +0200 DEBUG [GitHosting] Found git_cache_id ('test2'), call cache... 
2014-07-17 22:53:51 +0200 DEBUG [GitHosting] Send GitCommand : '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/redmine/test2.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'branch' '--no-color' '--verbose' '--no-abbrev'
2014-07-17 22:53:51 +0200 DEBUG [GitCache] Probing cache entry
2014-07-17 22:53:51 +0200 DEBUG [GitCache] '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/redmine/test2.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'branch' '--no-color' '--verbose' '--no-abbrev'
2014-07-17 22:53:51 +0200 DEBUG [GitHosting] Lookup for git_cache_id with repository path 'repositories/redmine/test2.git' ... 
2014-07-17 22:53:51 +0200 DEBUG [GitHosting] Found git_cache_id ('test2'), call cache... 
2014-07-17 22:53:51 +0200 DEBUG [GitHosting] Send GitCommand : '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/redmine/test2.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'log' '--no-color' '--encoding=UTF-8' '--raw' '--date=iso' '--pretty=fuller' '--parents' '--stdin' '--reverse'
2014-07-17 22:53:51 +0200 DEBUG [GitCache] Probing cache entry
2014-07-17 22:53:51 +0200 DEBUG [GitCache] '/usr/local/redmine/redmine-2.5.0/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/redmine/test2.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'log' '--no-color' '--encoding=UTF-8' '--raw' '--date=iso' '--pretty=fuller' '--parents' '--stdin' '--reverse'

gitolite.log:

2014-07-17.22:53:44     8465    ssh     ARGV=redmine_gitolite_admin_id_rsa      SOC=git-receive-pack '/gitolite-admin.git'      FROM=::1
2014-07-17.22:53:44     8465    pre_git gitolite-admin  redmine_gitolite_admin_id_rsa   W       any     refs/.*
2014-07-17.22:53:44     8465            system,git,shell,-c,git-receive-pack '/usr/local/git/repositories/gitolite-admin.git'
2014-07-17.22:53:44     8465    update  gitolite-admin  redmine_gitolite_admin_id_rsa   W       refs/heads/master       8654c233c177e6b14fb02cf89d9fccb86ff73ed5        9d9ccd6d692c1c5ad33f1bc53110931df2b50f06        refs/.*
2014-07-17.22:53:44     8465            system,gitolite compile
2014-07-17.22:53:44     8465            system,git init --bare >&2
2014-07-17.22:53:44     8465            system,/usr/local/git/bin/triggers/post-compile/update-git-configs,POST_CREATE,redmine/test2
2014-07-17.22:53:44     8465            system,/usr/local/git/bin/triggers/post-compile/update-gitweb-access-list,POST_CREATE,redmine/test2
2014-07-17.22:53:44     8465            system,/usr/local/git/bin/triggers/post-compile/update-git-daemon-access-list,POST_CREATE,redmine/test2
2014-07-17.22:53:44     8465            system,gitolite trigger POST_COMPILE
2014-07-17.22:53:44     8465            system,/usr/local/git/bin/triggers/post-compile/ssh-authkeys,POST_COMPILE
2014-07-17.22:53:44     8465            system,/usr/local/git/bin/triggers/post-compile/update-git-configs,POST_COMPILE
2014-07-17.22:53:44     8465            system,/usr/local/git/bin/triggers/post-compile/update-gitweb-access-list,POST_COMPILE
2014-07-17.22:53:44     8465            system,/usr/local/git/bin/commands/access,%,gitweb,R,any
2014-07-17.22:53:45     8465            system,/usr/local/git/bin/commands/git-config,-r,%,gitweb\.
2014-07-17.22:53:45     8465            system,/usr/local/git/bin/triggers/post-compile/update-git-daemon-access-list,POST_COMPILE
2014-07-17.22:53:45     8465            system,/usr/local/git/bin/commands/access,%,daemon,R,any
2014-07-17.22:53:45     8465    END
2014-07-17.22:53:45     8649    ssh     ARGV=redmine_gitolite_admin_id_rsa      SOC=git-upload-pack '/redmine/test2.git'        FROM=5.45.104.136
2014-07-17.22:53:45     8649    pre_git redmine/test2   redmine_gitolite_admin_id_rsa   R       any     refs/.*
2014-07-17.22:53:45     8649            system,git,shell,-c,git-upload-pack '/usr/local/git/repositories/redmine/test2.git'
2014-07-17.22:53:45     8649    END
2014-07-17.22:53:46     8740    ssh     ARGV=redmine_gitolite_admin_id_rsa      SOC=git-receive-pack '/redmine/test2.git'       FROM=5.45.104.136
2014-07-17.22:53:46     8740    pre_git redmine/test2   redmine_gitolite_admin_id_rsa   W       any     refs/.*
2014-07-17.22:53:46     8740            system,git,shell,-c,git-receive-pack '/usr/local/git/repositories/redmine/test2.git'
2014-07-17.22:53:46     8740    update  redmine/test2   redmine_gitolite_admin_id_rsa   W       refs/heads/master       0000000000000000000000000000000000000000        d7471949dc475ac3651bff99b60dda903d147051        refs/.*
2014-07-17.22:53:51     8740    END
2014-07-17.22:54:18     8910    ssh     ARGV=redmine_peter    SOC=git-upload-pack '/redmine/test2.git'        FROM=85.179.30.156
2014-07-17.22:54:18     8910    die     R any redmine/test2 redmine_peter DENIED by fallthru<<newline>>(or you mis-spelled the reponame)

Via SmartHTTP I can clone the repo though (git_hosting.log):

2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] ["  Current user: anonymous"]
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] ###### AUTHENTICATION ######
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] git_params      : info, refs
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] repo_path       : test.git
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] is_push         : false
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] project name    : test
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] public project  : false
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] repository name : redmine/test
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] repository path : repositories/redmine/test.git
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] ##########################
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] ["  Current user: anonymous"]
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] ###### AUTHENTICATION ######
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] git_params      : info, refs
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] repo_path       : test.git
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] is_push         : false
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] project name    : test
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] public project  : false
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] repository name : redmine/test
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] repository path : repositories/redmine/test.git
2014-07-17 22:42:56 +0200 INFO [GitSmartHttp] ##########################
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] ["  Current user: anonymous"]
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] ###### AUTHENTICATION ######
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] git_params      : info, refs
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] repo_path       : test.git
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] is_push         : false
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] project name    : test
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] public project  : false
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] repository name : redmine/test
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] repository path : repositories/redmine/test.git
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] ##########################
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] ###### AUTHENTICATED ######
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] command         : get_info_refs
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] rpc             : 
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] user_name       : peter
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] ##########################
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] ["  Current user: anonymous"]
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] ###### AUTHENTICATION ######
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] git_params      : git-upload-pack
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] repo_path       : test.git
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] is_push         : false
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] project name    : test
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] public project  : false
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] repository name : redmine/test
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] repository path : repositories/redmine/test.git
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] ##########################
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] ###### AUTHENTICATED ######
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] command         : service_rpc
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] rpc             : upload-pack
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] user_name       : peter
2014-07-17 22:43:06 +0200 INFO [GitSmartHttp] ##########################

Any ideas what's causing this?

@ptr-reinold
Copy link
Author

by reinstalling gitolite i always mean following all the steps in the step-by-step ('.*', repo @ALL ..., etc) setup and deleting /tmp/redmine_git_hosting

@ptr-reinold
Copy link
Author

The script starts now without error. Problem is that no repository is created now, instead the task is enqueued in Sidekiq:

GithostingShellWorker
[{"command"=>"add_repository", "object"=>48, "options"=>{"create_readme_file"=>true}}]

All git_hosting.log says now is:

2014-07-17 23:27:40 +0200 INFO [GitHosting] User 'peter' created a new repository 'redmine/test'

I checked and the repository is not existant in gitolite.

@n-rodriguez
Copy link
Contributor

If the worker is running it should do something... even a crash... and you should have output in logs.

Be sure that the worker is really running with a ps ax | grep sidekiq | grep -v grep.

Can you also check the worker's log in redmine/log/worker_redmine_git_hosting.log?

@ptr-reinold
Copy link
Author

You are right. There is no worker running. Redis-Server is started with standard conf in daemonized mode. ps ax shows that server is running and a pid file exists at /var/run/redis/redis-server.pid

I execute service_sidekiq.sh start
Start Sidekiq...
Done

worker.log

No such file or directory - /usr/local/redmine/redmine/tmp/pids/worker_redmine_git_hosting.pid
/var/lib/gems/1.9.1/gems/sidekiq-3.2.1/lib/sidekiq/cli.rb:347:in `initialize'
/var/lib/gems/1.9.1/gems/sidekiq-3.2.1/lib/sidekiq/cli.rb:347:in `open'
/var/lib/gems/1.9.1/gems/sidekiq-3.2.1/lib/sidekiq/cli.rb:347:in `write_pid'
/var/lib/gems/1.9.1/gems/sidekiq-3.2.1/lib/sidekiq/cli.rb:41:in `parse'
/var/lib/gems/1.9.1/gems/sidekiq-3.2.1/bin/sidekiq:7:in `<top (required)>'
/usr/local/bin/sidekiq:23:in `load'
/usr/local/bin/sidekiq:23:in `<main>'

directory /usr/local/redmine/redmine/tmp is set to 776 (but I also tried 777), so the write permissions to this directory should not be an issue

@n-rodriguez
Copy link
Contributor

You must create the pids dir. Sidekiq don't create it, only the pid file.

@ptr-reinold
Copy link
Author

nah ok. sry that was very stupid of me.... but thanks a lot for helping out! Sidekiq is working now. The worker is processing the requests perfectly.

Now I still have the problem with the repo cloning. I enter my public key and everything seems to work fine:

git_hosting.log

2014-07-18 00:15:25 +0200 DEBUG [GitHosting]  ssh-keygen -l -f /tmp/foo20140718-11077-1pbtsyp 2>&1
2014-07-18 00:15:25 +0200 INFO [GitHosting] User 'peter' has added a SSH key
2014-07-18 00:15:25 +0200 DEBUG [GitWorker] add_ssh_key : get lock !
2014-07-18 00:15:26 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-07-18 00:15:26 +0200 INFO [GitWorker] add_ssh_key : SSH key 'redmine_peter@redmine_1405635325_965544' does not exist in Gitolite, create it ...
2014-07-18 00:15:26 +0200 INFO [GitWorker] add_ssh_key : commiting to Gitolite...
2014-07-18 00:15:26 +0200 INFO [GitWorker] add_ssh_key : pushing to Gitolite...
2014-07-18 00:15:28 +0200 INFO [GitWorker] add_ssh_key : done !
2014-07-18 00:15:28 +0200 DEBUG [GitWorker] add_ssh_key : lock released !

key is in gitolite authorized_keys:

.........
command="/usr/local/git/bin/gitolite-shell redmine_peter",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa............
..........

Still when trying to clone i get:

gitolite.log

2014-07-18.00:32:08     18906   ssh     ARGV=redmine_peter    SOC=git-upload-pack '/redmine/xaxa.git' FROM=75.176.31.156
2014-07-18.00:32:08     18906   die     R any redmine/xaxa redmine_peter DENIED by fallthru<<newline>>(or you mis-spelled the reponame)

The repository redmine/xaxa.git exits in gitolite. It is also declared in gitolite.conf.
It seems to me that he does not accept my public key, but i dont know why?

@n-rodriguez
Copy link
Contributor

Can you please post your gitolite.conf?

@ptr-reinold
Copy link
Author

in git user $HOME/.gitolite/conf/gitolite.conf

repo    @all
RW+                            = redmine_gitolite_admin_id_rsa

repo    gitolite-admin
RW+                            = redmine_gitolite_admin_id_rsa

repo    redmine/test
R                              = DUMMY_REDMINE_KEY
config redminegitolite.projectid = test
config redminegitolite.repositoryid =
config redminegitolite.repositorykey = CTXEICIWDOVBECXQAWQDCHMVAWBEEAAPJKUWVGYRNXNHTESTQELOJRJQRLHATAPXDQEBNRVPYAEXUXESLOPAAWIHBLMEAMAXUWFCFNDENA
config http.uploadpack = true
config multimailhook.enabled = false

repo    redmine/xaxa
R                              = DUMMY_REDMINE_KEY
config redminegitolite.projectid = xaxa
config redminegitolite.repositoryid =
config redminegitolite.repositorykey = YPYRTYEBAGEAHQGFUTBWJXYCRSWTUQUJANRWISLFQQRDELUDGHKOSILNPXQVMMAPYKPXXQUGWXTLUKDULTWFETBQNWKXOVYLNWDGETFHFORKW
config http.uploadpack = true
config multimailhook.enabled = false

 repo    testing
 RW+                            = @all

@n-rodriguez
Copy link
Contributor

repo    redmine/xaxa
R                              = DUMMY_REDMINE_KEY

You must add members to your project. These members must have permissions to create ssh keys, commit and maybe view changesets. This is done in Administration -> Roles.

@ptr-reinold
Copy link
Author

-,- so sorry. I reinstalled, readded and deleted so many times that at some point I completely skipped adding myself to the project...

With Sidekiq running now it seems to work perfectly. I am still not sure why before I sometimes got an error message when pushing (remote: Notifying Redmine about changes...), but since everything works now, it was most likely another stupid mistake of mine somewhere. In case the error occurs again, I will write.

Thanks a lot for the awesome support!!! :)

@n-rodriguez
Copy link
Contributor

Thanks a lot for the awesome support!!! :)

You're welcome :)

@n-rodriguez
Copy link
Contributor

By the way, I've updated the worker startup script : https://github.com/jbox-web/redmine_git_hosting/blob/devel/contrib/scripts/sidekiq_git_hosting.sh

It avoids creation of duplicated processus. For example, with the previous version, if you do :

redmine$ sidekiq_git_hosting.sh start
# and immediatly after
redmine$ sidekiq_git_hosting.sh start

you've got 2 running workers plugged to the same queue : I don't think this is good :/

With the new version the script fires up Sidekiq and wait until it's started. On my server it takes between 10 and 15 seconds for Sidekiq to be fully loaded. So there is a default timeout of 15 seconds. You can override it by passing the timeout as an environment variable to the script :

redmine$ TIMEOUT=20 sidekiq_git_hosting.sh start

You can also start the worker in development mode by passing another environment variable :

redmine$ RAILS_ENV=development sidekiq_git_hosting.sh start

This will let the worker hang on the console instead of forking with the log redirected to the stdout.

Happy testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants