New LDAP User Unable to Create Account

I have an Ubuntu 16.04 Gitlab server running 8.16.5-ce.1 Community Edition, integrated with LDAP for logins.

I have a new user trying to log in for the first time. However, Gitlab errors out trying to create the account.

From /var/log/gitlab/gitlab-rails/production.log (identifying info removed):

Started POST “/ci/api/v1/builds/register.json” for at 2017-02-17 10:05:37 -0700
Started GET “” for at 2017-02-17 10:05:38 -0700
Processing by OmniauthCallbacksController#cas3 as HTML
Parameters: {“url”=>"/users/sign_in", “ticket”=>“ST-1487351094638-2ftLqHdzQtJVqbs91NEq0mtKJ”}
Completed 500 Internal Server Error in 83ms (ActiveRecord: 3.8ms)

NoMethodError (undefined method first' for nil:NilClass): lib/gitlab/o_auth/user.rb:161:in user_attributes’
lib/gitlab/o_auth/user.rb:151:in build_new_user' lib/gitlab/o_auth/user.rb:81:in find_or_create_ldap_user’
lib/gitlab/o_auth/user.rb:50:in gl_user' lib/gitlab/o_auth/user.rb:30:in save’
app/controllers/omniauth_callbacks_controller.rb:91:in handle_omniauth' app/controllers/omniauth_callbacks_controller.rb:78:in cas3’
lib/gitlab/middleware/multipart.rb:93:in call' lib/gitlab/request_profiler/middleware.rb:15:in call’
lib/gitlab/middleware/go.rb:16:in `call’

Is there a patch or fix for this?

New user creation was working just fine up until I upgraded to the most recent version yesterday, so it seems like this is probably a new bug.

This continues to be a problem.