LDAP 9.5.0 ldap_error: TypeError, no implicit conversion of String into Array

Is anyone seeing ‘ldap_error: TypeError, no implicit conversion of String into Array’ after the upgrade to 9.5.0? That’s from ‘/var/log/gitlab/unicorn/unicorn_stdout.log’, but we are getting a similar error on the webpage and when running ‘gitlab-rake gitlab:ldap:check’. We haven’t touched our Gitlab LDAP config since January, so I’m thinking it is something in the latest release.

It looks like an issue with /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/adapter.rb. Line 104 or so has something like:

def user_attributes
%W(#{config.uid} cn dn) + config.attributes[‘username’] + config.attributes[‘email’]
end

Changing that to read:

def user_attributes
%W(#{config.uid} cn dn) + [config.attributes[‘username’]] + [config.attributes[‘email’]]
end

and I’m able to log in again

2 Likes

Thanks a bunch.

I also had to restart with gitlab-ctl restart before the fix took effect.

Thank you!