Plugin svnauth failed to load gem htauth

Added by Erwane Breton about 7 years ago

Hi,

I'm trying the svnauth plugin from Alex A (http://www.redmine.org/plugins/svnauth).
The configuration page work fine BUT when i want to change my svn password, i'v got this error :

Parameters: {"controller"=>"svnauth", "action"=>"htpasswd"}

MissingSourceFile (cannot load such file -- htauth):
vendor/plugins/redmine_svnauth/app/controllers/svnauth_controller.rb:1:in `<top (required)>'

my gems

actionmailer (2.3.15)
actionpack (2.3.15)
activerecord (2.3.15)
activerecord-mysql2-adapter (0.0.3)
activeresource (2.3.15)
activesupport (2.3.15)
bundler (1.3.5)
coderay (1.0.9)
daemon_controller (1.1.7)
fastthread (1.0.7)
highline (1.5.2)
htauth (1.0.3)
i18n (0.4.2)
inifile (2.0.2)
lockfile (2.1.0)
mysql (2.9.1)
mysql2 (0.2.21)
net-ldap (0.3.1)
net-ssh (2.7.0)
passenger (3.0.21)
rack (1.5.2, 1.1.6)
rails (2.3.15)
rake (10.1.0)
rmagick (2.13.2)
ruby-openid (2.1.8)
tzinfo (0.3.38)

redmine : 1.4-stable (from today)
apache 2.2 with passenger
ruby 1.9.3p484 (2013-11-22 revision 43786)
freebsd 9.1-RELEASE-p7

Thanks for any help

Replies (7)

RE: Plugin svnauth failed to load gem htauth - Added by Erwane Breton about 7 years ago

i used bundle Gemfile.local to add htauth and now it's working.

New error :

Error when updating svn password for user 'xxxx': undefined method `|' for "I\x10":String

this line correspond to this method in svnauth controller :

  def save_password(passwd)
    begin
       HTAuth::PasswdFile.open(Setting.plugin_redmine_svnauth['svn_passwd_file']) do |file|
             file.add_or_update(User.current.login, passwd, 'sha1')
       end
       flash[:notice] = l(:notice_svn_password_updated) 
       logger.info("User '#{User.current.login}' has been changed svn password successfully.")           
    rescue => e
       flash[:error] = l(:notice_error_svn_password_update)
       logger.error("Error when updating svn password for user '#{User.current.login}': #{e}")
    end
  end

any ideas ?

RE: Plugin svnauth failed to load gem htauth - Added by Alex A about 7 years ago

Can you log full stack error here?

RE: Plugin svnauth failed to load gem htauth - Added by Erwane Breton about 7 years ago

here the log for this action

Processing SvnauthController#htpasswd (for <IP> at 2013-12-02 09:42:31) [POST]
  Parameters: {"authenticity_token"=>"uliuvgXcQfX37eq/B5azAaSRFNHUli6KWTXadA5ZDvY=", "password"=>"[FILTERED]", "new_password"=>"[FILTERED]", "new_password_confirmation"=>"[FILTERED]", "commit"=>"Appliquer", "controller"=>"svnauth", "action"=>"htpasswd"}
Error when updating svn password for user 'Erwane': undefined method `|' for "I\x10":String
Rendering template within layouts/base
Rendering svnauth/htpasswd
Completed in 10ms (View: 5, DB: 1) | 200 OK [http://<DOMAIN>/my/svnpassword]

i masked my IP and domain, but they are corrects.

RE: Plugin svnauth failed to load gem htauth - Added by Alex A about 7 years ago

I don`t know why this error occurred, i suppose the problem in file.add_or_update(User.current.login, passwd, 'sha1'). In original plugin i use md5 encryption. Does the passed file has rights allow to write in it for apache user?

RE: Plugin svnauth failed to load gem htauth - Added by Erwane Breton about 7 years ago

sorry, i changed md5 to sha1, just to try but it was the same with md5.

i moved file from /tmp to htdocs redmine dir and change plugin configuration, it's the same.

I reoriented my research on redmine/svn auth to this script : https://github.com/matthb2/Redmine-SVN-Authentication-Tool/blob/master/redminesvnauth.rb

It's not the same way, but sound goods.

Your plugin can be realy cool (and easy to implement) if htpasswd was sync with all users password (at user creation or changed password)

RE: Plugin svnauth failed to load gem htauth - Added by Alex A about 7 years ago

Does the system rights allow to write into file?
Try this function and write error stack trace here

def save_password(passwd)
begin
HTAuth::PasswdFile.open(Setting.plugin_redmine_svnauth['svn_passwd_file']) do |file|
file.add_or_update(User.current.login, passwd, 'sha1')
end
end

RE: Plugin svnauth failed to load gem htauth - Added by Erwane Breton about 7 years ago

Same error

The problem is not in the file.add_or_update(User.current.login, passwd, 'sha1') but in do |file| i think

undefined method `|' for "\xD6\x10":String

However, i used a different methode based on mod-authnz-external apache module and php access script.

My svn/redmine auth working fine now.

(1-7/7)