LDAP group sync error undefined method `result_code'
Zendesk issue: https://gitlab.zendesk.com/agent/tickets/19024 Ruby Net LDAP issue: https://github.com/ruby-ldap/ruby-net-ldap/issues/269
Occassionally, a customer is seeing group sync failures with the following stack trace. It's not specifically within group sync code, but in the adapter when the actual search occurs. It's not clear what's causing this.
2016-04-04_13:23:25.50020 2016-04-04T13:23:25.500Z 8882 TID-v9x84 WARN: NoMethodError: undefined method `result_code' for nil:NilClass
2016-04-04_13:23:25.50022 2016-04-04T13:23:25.500Z 8882 TID-v9x84 WARN: /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap/connection.rb:450:in `block (2 levels) in search'
2016-04-04_13:23:25.50022 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap/connection.rb:363:in `loop'
2016-04-04_13:23:25.50023 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap/connection.rb:363:in `block in search'
2016-04-04_13:23:25.50023 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap/instrumentation.rb:19:in `instrument'
2016-04-04_13:23:25.50023 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap/connection.rb:352:in `search'
2016-04-04_13:23:25.50024 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap.rb:753:in `block (2 levels) in search'
2016-04-04_13:23:25.50024 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap.rb:1223:in `use_connection'
2016-04-04_13:23:25.50025 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap.rb:752:in `block in search'
2016-04-04_13:23:25.50025 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap/instrumentation.rb:19:in `instrument'
2016-04-04_13:23:25.50026 /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/net-ldap-0.12.1/lib/net/ldap.rb:751:in `search'
In the short term we can catch this error when we do the group search. But, this also seems to be a less than ideal solution because there's still some scenario that causes this. Is it odd data in LDAP? If we're going to catch the error we should at least know what caused the situation.
Edited by 🤖 GitLab Bot 🤖