Skip to content
This repository has been archived by the owner on Feb 14, 2019. It is now read-only.

undefined method `to_ber' for nil:NilClass #13

Closed
cforce opened this issue Aug 29, 2011 · 2 comments
Closed

undefined method `to_ber' for nil:NilClass #13

cforce opened this issue Aug 29, 2011 · 2 comments
Assignees
Labels

Comments

@cforce
Copy link
Contributor

cforce commented Aug 29, 2011

We get following error message when running rake task:
rake redmine:plugins:redmine_ldap_sync:sync_users RAILS_ENV=p roduction --trace
(in /usr/local/lib/redmine-1.2.1)
** Invoke redmine:plugins:redmine_ldap_sync:sync_users (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:plugins:redmine_ldap_sync:sync_users
rake aborted!
undefined method to_ber' for nil:NilClass /usr/local/lib/redmine-1.2.1/vendor/plugins/ruby-net-ldap-0.0.4/lib/net/ldap/fil ter.rb:206:into_ber'
/usr/local/lib/redmine-1.2.1/vendor/plugins/ruby-net-ldap-0.0.4/lib/net/ldap/fil ter.rb:214:in to_ber' /usr/local/lib/redmine-1.2.1/vendor/plugins/ruby-net-ldap-0.0.4/lib/net/ldap/fil ter.rb:214:inmap'
/usr/local/lib/redmine-1.2.1/vendor/plugins/ruby-net-ldap-0.0.4/lib/net/ldap/fil ter.rb:214:in to_ber' /usr/local/lib/redmine-1.2.1/vendor/plugins/ruby-net-ldap-0.0.4/lib/net/ldap.rb: 1154:insearch'
/usr/local/lib/redmine-1.2.1/vendor/plugins/ruby-net-ldap-0.0.4/lib/net/ldap.rb: 1144:in loop' /usr/local/lib/redmine-1.2.1/vendor/plugins/ruby-net-ldap-0.0.4/lib/net/ldap.rb: 1144:insearch'
/usr/local/lib/redmine-1.2.1/vendor/plugins/ruby-net-ldap-0.0.4/lib/net/ldap.rb: 640:in search' /usr/local/lib/redmine-1.2.1/app/models/auth_source_ldap.rb:109:inget_user_dn'
/usr/local/lib/redmine-1.2.1/vendor/plugins/redmine_ldap_sync/lib/redmine_ldap_s ync/redmine_ext/auth_source_ldap_patch.rb:50:in sync_users' /usr/local/lib/redmine-1.2.1/vendor/rails/activerecord/lib/active_record/base.rb :1971:infind_or_create_by_login'
/usr/local/lib/redmine-1.2.1/vendor/plugins/redmine_ldap_sync/lib/redmine_ldap_s ync/redmine_ext/auth_source_ldap_patch.rb:49:in sync_users' /usr/local/lib/redmine-1.2.1/vendor/plugins/redmine_ldap_sync/lib/redmine_ldap_s ync/redmine_ext/auth_source_ldap_patch.rb:46:ineach'
/usr/local/lib/redmine-1.2.1/vendor/plugins/redmine_ldap_sync/lib/redmine_ldap_s ync/redmine_ext/auth_source_ldap_patch.rb:46:in sync_users' /usr/local/lib/redmine-1.2.1/vendor/plugins/redmine_ldap_sync/lib/tasks/sync_use rs.rake:6 /usr/local/lib/redmine-1.2.1/vendor/plugins/redmine_ldap_sync/lib/tasks/sync_use rs.rake:6:ineach'

@thorin
Copy link
Owner

thorin commented Aug 29, 2011

After a better look, it seems to be that the login names of one of the users
is not very friendly and makes the plugin crash when parsing it to create
the user search filter.

Because of the nil:NilClass my first guess would be an empty username, if
that makes any sense.

-- EDITED --
It has to be a user without an username.
There must be an entry with the user's objectClass that has no username. Ie, with the username attribute missing.

I'll add a check on the code to prevent that case.

@cforce
Copy link
Contributor Author

cforce commented Aug 29, 2011

The cause was this string in DN =DDV, ou=GR..i changed it to DN =DDV and the error was gone

@thorin thorin closed this as completed Aug 29, 2011
@ghost ghost assigned thorin Nov 28, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants