Closed alex1702 closed 10 years ago
It seems that gitolite isn't running correctly or not set up to use from openproject. This would result in the project 'test.git' to not be created through OpenProject and thus it fails to display it.
You need a correctly set up gitolite that runs as a seperate user than openproject (you specified the gitolite user as openproject
, which will not work.
Ensure you've followed all steps in the installation tutorial and execute the following commands on the shell, as the user running openproject.
I'm assuming your gitolite user is named git
, if its named otherwise, you'll need to update the following commands respectively
hello openproject, this is git@dev running gitolite3 v3.x-x on git x.x.x.
R W gitolite-admin
R W testing
If these commands both work fine, please show me your revisions_git configuration.
ok, now i have the user "opgit" and the commands works. the configtest shows the same error
OpenProject username openproject
Gitolite username opgit
Redmine user is able to sudo to Git user? Redmine user is able to sudo to Git user?
Git version 1.9.1
Gitolite version true
Gitolite banner
Error while getting Gitolite banner: ScmException(ssh) -> Non-zero exit code pid 24930 exit 255 for `ssh -T -o BatchMode=yes git@localhost -p 22 -i /home/openproject/.ssh/id_rsa info`
PATH directories
/home/openproject/.rvm/gems/ruby-2.1.3/bin
/home/openproject/.rvm/gems/ruby-2.1.3@global/bin
/home/openproject/.rvm/rubies/ruby-2.1.3/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/home/openproject/.rvm/bin
output of sudo -n -i -u opgit ls repositories:
openproject@elaon:~$ sudo -n -i -u opgit ls repositories
gitolite-admin.git testing.git
and ssh -i ~/.ssh/openproject opgit@localhost info:
openproject@elaon:~$ ssh -i ~/.ssh/openproject opgit@localhost info
hello openproject, this is opgit@elaon running gitolite3 v3.6.1-6-gdc8b590 on git 1.9.1
R W gitolite-admin
R W testing
Ah, yes. The config tests are cached through Rails.cache, you can clear them through rake tmp:clear
, or get the latest commit (bb9d3cd10912faf82d6f512d0db07ba4e1bbb0b5) which fixes just that.
ok, so the problem is solved with the configtest. But apparently he created me no repositories, if I do the settings under project settings. Settings:
Gitolite Storage Configuration
Gitolite Admin repository: /home/opgit/repositories/gitolite-admin.git/
Location of the Gitolite Admin repository
Gitolite repositories base path: home/opgit/repositories/
(Relative to Gitolite user home)
error log when I create the git repo in project settings:
Started POST "/repositories/edit/test" for 80.133.31.108 at 2014-10-24 18:31:08 +0200
Processing by RepositoriesController#edit as JS
Parameters: {"utf8"=>"✓", "authenticity_token"=>"EUyoR55eJIDhv3/6QVw60GuLEYT1Uu0/lUwYoOH3nP4=", "repository_scm"=>"Git", "repository"=>{"extra_attributes"=>{"git_daemon"=>"0", "git_http"=>"0"}}, "commit"=>"Anlegen", "id"=>"test"}
Automatic initialization of RepositoryGitExtra failed.
Automatic initialization of RepositoryGitExtra failed.
Rendered /home/openproject/.rvm/gems/ruby-2.1.3/bundler/gems/openproject-revisions_git-2fda32b8d1b3/app/views/projects/settings/_git.html.erb (2.7ms)
Rendered projects/settings/_repository.html.erb (7.2ms)
User 'admin' created a new repository 'test'
Creating gitolite action for 'add_repository'
Completed 200 OK in 68.9ms (Views: 27.3ms | ActiveRecord: 19.9ms)
I assume the delayed_jobs worker isn't running. I'll have to add this to the installation tutorial to ensure it is loaded, as the plugin relies on it for all I/O access.
Try RAILS_ENV=production script/delayed_job start
.
/edit: I've updated the installation tutorial: https://github.com/oliverguenther/openproject-revisions_git/blob/dev/README.md#4-starting-delayed_jobs
hmm, now i get permission errors. has the plugin directly access to the folder?
Running delayed job 'delete_repositories'
Acessing gitolite-admin.git at '/home/opgit/repositories/gitolite-admin.git/'
2014-10-24T18:44:24+0200: [Worker(delayed_job host:elaon.de pid:6990)] OpenProject::Revisions::Git::GitoliteWrapper::Repositories#run_without_delay failed with Rugged::OSError: Failed to make directory '/home/opgit/repositories/gitolite-admin.git': Permission denied - 3 failed attempts
The gitolite-admin.git must be cloned locally using the openproject user. This is due to the fact that openproject acts on the (cloned) gitolite-admin.git repository and commits changes to gitolite, which then adds the project and sets up any ssh keys configured with it.
This is part of the preliminary setup for this plugin (cite: you have successfully cloned the gitolite-admin.git repository from the user running OpenProject.) In my setup this worked as follows:
git clone ssh://git@localhost:gitolite-admin /home/openproject/gitolite-admin.git
/home/openproject/gitolite-admin.git
Running delayed job 'add_repository'
Acessing gitolite-admin.git at '/home/openproject/gitolite-admin.git/'
2014-10-24T19:14:47+0200: [Worker(delayed_job host:elaon.de pid:6990)] OpenProject::Revisions::Git::GitoliteWrapper::Repositories#run_without_delay failed with Rugged::NetworkError: This transport isn't implemented. Sorry - 3 failed attempts
2014-10-24T19:14:47+0200: [Worker(delayed_job host:elaon.de pid:6990)] 2 jobs processed at 19.2750 j/s, 2 failed ...
Aha , one step further :laughing: You need to rebuild libgit2/rugged with SSH support, see this issue: https://github.com/libgit2/rugged/issues/299
Under Debian/Ubuntu this currently is libssh2.1-dev
. Simple reinstall the rugged gem afterwards:
$ gem uninstall foo
$ bundle update
I'll have another thing to add to the preliminary step of the tutorial ;)
Hi,
I have the problem that the settings are not apparently taken properly. I have another user set in the options, but in the logs I see "git" as user.
Log output when calling the repository page for a project
The output of the settings ConfigTest page:
Thanks for your help. And sorry for my bad english. xD