On Friday, November 29, 2013 4:15:42 PM UTC-5, Ken Dreyer wrote:
> On Fri, Nov 29, 2013 at 10:03 AM, Alexandre Beauclair
> 
> <[email protected]> wrote:
> 
> > I'm pretty much at a loss as to what I should do, as my configs are
> 
> > similar to the working install (adapted for the test install of course).
> 
> > Thanks for any input you can give me!
> 
> 
> 
> Here's the code that's failing, in
> 
> lib/gitorious/authentication/ldap_authentication.rb
> 
> 
> 
>       def auto_register(username)
> 
>         result = connection.search(:base => base_dn, :filter =>
> 
> username_filter(username),
> 
>           :attributes => attribute_mapping.keys, :return_result => true)
> 
>         if result.size > 0
> 
> 
> 
> The connection.search() call in ruby-ldap is not finding anything, so
> 
> it's returning nil. The crash comes when we try to call "nil.size". As
> 
> far as I can tell, nil.size has never returned anything other than a
> 
> NoMethodError exception. (Tested on Ruby 2.0 and Ruby 1.8.)
> 
> 
> 
> Looking at the ruby-ldap v0.3.1 that's bundled in Gitorious v2.4.11,
> 
> https://github.com/ruby-ldap/ruby-net-ldap/blob/3345c58dfb41192dc06f49632287d6a347b7abbb/lib/net/ldap.rb
> 
> has this paragraph:
> 
> 
> 
>   # #search returns either a result-set or a boolean, depending on the value
> 
>   # of the <tt>:return_result</tt> argument. The default behavior is to
> 
>   # return a result set, which is an Array of objects of class
> 
>   # Net::LDAP::Entry. If you request a result set and #search fails with an
> 
>   # error, it will return nil. Call #get_operation_result to get the error
> 
>   # information returned by
> 
>   # the LDAP server.
> 
> 
> 
> So if that's promised by the ruby-ldap API, we really ought to be
> 
> checking for result.nil? before we do anything further with result
> 
> here - particularly checking it's size. We might not be able to do
> 
> anything at this point, but hopefully we can do something more
> 
> graceful than crash.
> 
> 
> 
> What's curious to me is "how could authenticate() succeed, but
> 
> auto_register() fail?" It seems like there's some subtle difference
> 
> there.
> 
> 
> 
> What does your gitorious.yml say for the LDAPAuthentication portion?
> 
> Maybe shed some light on this.
> 
> 
> 
> - Ken

Hi Ken, thanks for your help.

Here are my configs, so that maybe you'll see something I missed.

gitorious.yml

production:
    cookie_secret: < secret >
    repository_base_path: "/home/git/data/repositories"
    extra_html_head_data:
    system_message:
    gitorious_client_port: 80
    gitorious_client_host: gitorious50.test.company.com
    gitorious_host: gitorious50.test.company.com
    gitorious_user: git
    exception_notification_emails: [email protected]
    mangle_email_addresses: true
    public_mode: true
    locale: en
    archive_cache_dir: "/home/git/data/tarballs"
    archive_work_dir: "/home/git/data/tarball-work"
    only_site_admins_can_create_projects: true
    hide_http_clone_urls: false
    is_gitorious_dot_org: false
    use_ldap_authorization: true


authentication.yml

production:
 methods:
   - adapter: Gitorious::Authentication::LDAPAuthentication
     disable_default: false
     host: auth50-master.test.company.com
     port: 389
     base_dn: ou=users,dc=test,dc=company,dc=com
     group_search_dn: ou=groups,dc=test,dc=company,dc=com
     #distinguished_name_template: "cn={},ou=users,dc=test,dc=company,dc=com"
     #membership_attribute_name: memberof
     #members_attribute_name: member
     username_attribute: cn
     login_attribute: cn
     encryption: none
     bind_username: "user"
     bind_password: "password"

The commented lines are because they're things I have tried out (I've seen 
people online solve their issues with these), but didn't solve my problem.
Am I missing anything?

Thanks!                                                                         
                  

-- 
-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to