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

Plugin breaks if gitolite user == redmine user #526

Closed
Nightreaver opened this Issue Oct 22, 2015 · 3 comments

Comments

Projects
None yet
4 participants
@Nightreaver

Nightreaver commented Oct 22, 2015

Hello

So im about to use this plugin now but I can't get it working

my gitolite runs under the user 'redmine' so I changed
:gitolite_user => 'redmine',

whenever I try to configure the package I get internal error
The logfile prints:

2015-10-22 05:20:34 +0200 [ERROR] Error while getting Gitolite infos, check your SSH keys (path, permissions) or your Git user.
2015-10-22 05:20:34 +0200 [INFO] Testing if Redmine user 'redmine' can sudo to Gitolite user 'git'...
2015-10-22 05:20:34 +0200 [ERROR] Error while testing can_redmine_sudo_to_gitolite_user
2015-10-22 05:20:45 +0200 [ERROR] Error while getting Gitolite infos, check your SSH keys (path, permissions) or your Git user.

I've done a lots of reloading and checked the changes of init.rb apply - they do. but it still breaks on this part.
Why does it need to sudo into 'git'... its not used! where does this git-user come from?

are the default-settings from init.rb are cached/stored somewhere?

nevermind - its stored in the database after migration I think. You should mention to check the init.rb config-settings before installation in your 'Get started'!

Thanks

@amelentjev

This comment has been minimized.

Show comment
Hide comment
@amelentjev

amelentjev Oct 22, 2015

I also bumped into this problem, but, after while, I found this: http://redmine-git-hosting.io/how-to/maintain/ , "To restore/update your plugin settings" section.

amelentjev commented Oct 22, 2015

I also bumped into this problem, but, after while, I found this: http://redmine-git-hosting.io/how-to/maintain/ , "To restore/update your plugin settings" section.

@n-rodriguez n-rodriguez self-assigned this Jul 23, 2016

@cschlusche

This comment has been minimized.

Show comment
Hide comment
@cschlusche

cschlusche Aug 20, 2016

EDIT: Finally my settings.yml got accepted. :)

My user 'gitolite' differs from default 'git', that's why I try to change the plugin parameter for gitolite_user as well.
Unlike nightreaver I don't get the plugin to recognize my modifications (*1):

2016-08-20 18:59:25 +0200 [ERROR] Error while getting Gitolite infos, check your SSH keys (path, permissions) or your Git user.
2016-08-20 18:59:25 +0200 [INFO] Testing if Redmine user 'redmine' can sudo to Gitolite user 'git'...
2016-08-20 18:59:25 +0200 [ERROR] Error while testing can_redmine_sudo_to_gitolite_user
2016-08-20 18:59:25 +0200 [ERROR] Error while getting Gitolite infos, check your SSH keys (path, permissions) or your Git user.

I've followed two approaches as described in the docs (*2).
(a) Utilize redmine_git_hosting/settings.yml
I first tried to adapt the default_settings.yml and saved it to plugin's main folder as settings.yml. After updating the database it became obvious that the change of gitolite_user didn't seem to have any effect (*3). The correction might be valid, cause chaging a string is all it needs. The plugin was still looking for 'git', not 'gitolite'.
Did I miss a step to set up the settings.yml?

While restoring the default settings the command line signals that it's processing updates in init.rb.
(b) Changing redmine_git_hosting/init.rb
Google didn't bring up an example init-ruby-file. This is what I ended up as a plausible solution.

settings({ partial: 'settings/redmine_git_hosting', default: RedmineGitHosting.settings, gitolite_user: 'gitolite' })

After updating the database it became obvious that appending gitolite_user isn't a solution here.
Is the variable gitolite_user expected to be a subordinate of default?

Redmine 3.2 is running on Apache Passenger with Redmine Git Hosting (1.2.0) and Gitolite3.

Great appreciation for redmine_git_hosting! :) I'm just starting to get familiar with the concepts of ruby, gems and bundler.
Thanks in advance for your valuable hints and support.

References for other readers looking for a solution:
*1: Docs: Configuration variables
*2: Docs: Configuration notes
*3: Docs: Restore/update plugin settings

cschlusche commented Aug 20, 2016

EDIT: Finally my settings.yml got accepted. :)

My user 'gitolite' differs from default 'git', that's why I try to change the plugin parameter for gitolite_user as well.
Unlike nightreaver I don't get the plugin to recognize my modifications (*1):

2016-08-20 18:59:25 +0200 [ERROR] Error while getting Gitolite infos, check your SSH keys (path, permissions) or your Git user.
2016-08-20 18:59:25 +0200 [INFO] Testing if Redmine user 'redmine' can sudo to Gitolite user 'git'...
2016-08-20 18:59:25 +0200 [ERROR] Error while testing can_redmine_sudo_to_gitolite_user
2016-08-20 18:59:25 +0200 [ERROR] Error while getting Gitolite infos, check your SSH keys (path, permissions) or your Git user.

I've followed two approaches as described in the docs (*2).
(a) Utilize redmine_git_hosting/settings.yml
I first tried to adapt the default_settings.yml and saved it to plugin's main folder as settings.yml. After updating the database it became obvious that the change of gitolite_user didn't seem to have any effect (*3). The correction might be valid, cause chaging a string is all it needs. The plugin was still looking for 'git', not 'gitolite'.
Did I miss a step to set up the settings.yml?

While restoring the default settings the command line signals that it's processing updates in init.rb.
(b) Changing redmine_git_hosting/init.rb
Google didn't bring up an example init-ruby-file. This is what I ended up as a plausible solution.

settings({ partial: 'settings/redmine_git_hosting', default: RedmineGitHosting.settings, gitolite_user: 'gitolite' })

After updating the database it became obvious that appending gitolite_user isn't a solution here.
Is the variable gitolite_user expected to be a subordinate of default?

Redmine 3.2 is running on Apache Passenger with Redmine Git Hosting (1.2.0) and Gitolite3.

Great appreciation for redmine_git_hosting! :) I'm just starting to get familiar with the concepts of ruby, gems and bundler.
Thanks in advance for your valuable hints and support.

References for other readers looking for a solution:
*1: Docs: Configuration variables
*2: Docs: Configuration notes
*3: Docs: Restore/update plugin settings

@n-rodriguez n-rodriguez added bug and removed question labels Dec 29, 2016

@n-rodriguez n-rodriguez added this to the v1.2.2 milestone Dec 29, 2016

@n-rodriguez n-rodriguez changed the title from breaks if gitolite user is not 'git' to breaks if gitolite user == redmine user Dec 30, 2016

@n-rodriguez n-rodriguez changed the title from breaks if gitolite user == redmine user to Plugin breaks if gitolite user == redmine user Dec 30, 2016

@n-rodriguez

This comment has been minimized.

Show comment
Hide comment
@n-rodriguez

n-rodriguez Dec 31, 2016

Member

@cschlusche about the init.rb file :

Before RGH 1.2, default settings was stored in plugin's init.rb file : example.

Now default settings are stored in lib/default_settings.yml. This file must not be edited by users.

Instead copy the settings you want to override in redmine_git_hosting/settings.yml then do a

RAILS_ENV=production rake redmine_git_hosting:restore_default_settings

Explained here : http://redmine-git-hosting.io/configuration/notes/#deployment-and-configuration

Member

n-rodriguez commented Dec 31, 2016

@cschlusche about the init.rb file :

Before RGH 1.2, default settings was stored in plugin's init.rb file : example.

Now default settings are stored in lib/default_settings.yml. This file must not be edited by users.

Instead copy the settings you want to override in redmine_git_hosting/settings.yml then do a

RAILS_ENV=production rake redmine_git_hosting:restore_default_settings

Explained here : http://redmine-git-hosting.io/configuration/notes/#deployment-and-configuration

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