Misleading error message when user tries to register from not-white-listed email domain

Summary

If email address of a new user that tries to register does not appear neither in white nor in black list, Gitlab CE shows misleading message 'Could not authenticate you from Ldapmain because "Undefined method `provider' for 'nil:nilclass'"'

Steps to reproduce

  1. Gitlab CE version 11.10.4 (gitlab-ce@62c464651d2df6f4002af4e4967d11be9aec8d92), installed from Gitlab-Omnibus
  2. In general settings, add following settings in "Signup restrictions"
    1. Sign-up enabled: False
    2. Send confirmation email on sign-up: True
    3. Add "*.corp.com" in "Whitelisted domains for sign-ups" (note the dot after an asterisk)
    4. Leave empty "Blacklisted domains for sign-ups"
  3. Configure LDAP
  4. Try to register a new user, existing in LDAP with email "user@corp.com"

What is the current bug behavior?

User is not allowed to sign-up and is displayed a message above.

application.log nevertheless contains more informative message "Email domain is not authorized for sign-up".

What is the expected correct behavior?

More informative error message should be displayed in browser.

Relevant logs and/or screenshots

ef1i045o

Respective log line:

(LDAP) Error saving user cn=username,ou=part,ou=lab,ou=team,ou=srr,dc=corp,dc=net (user@corp.com): ["Email domain is not authorized for sign-up"]

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:         Ubuntu 14.04
Current User:   git
Using RVM:      no
Ruby Version:   2.5.3p105
Gem Version:    2.7.6
Bundler Version:1.17.3
Rake Version:   12.3.2
Redis Version:  3.2.12
Git Version:    2.18.1
Sidekiq Version:5.2.5
Go Version:     unknown

GitLab information Version: 11.10.4 Revision: 62c464651d2 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 9.6.11 URL: https://internal-server.corp.com HTTP Clone URL: https://internal-server.corp.com/some-group/some-project.git SSH Clone URL: git@internal-server.corp.com:some-group/some-project.git Using LDAP: yes Using Omniauth: no

GitLab Shell Version: 9.0.0 Repository storage paths: default: /mnt/gitlab/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 9.0.0 ? ... OK (9.0.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) DN: cn=restrictedusergroup1,ou=github,ou=mosaic,ou=service accounts,dc=corp,dc=net sAMAccountName: $3AI830-0L9KIAJ8QRDL removed 99 lines

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 6/2 ... yes 49/7 ... yes 69/10 ... yes 21/11 ... yes 21/12 ... yes 21/13 ... yes 26/15 ... yes 27/16 ... yes 32/17 ... yes 32/18 ... yes 32/19 ... yes 33/20 ... yes 6/21 ... yes 33/23 ... yes 27/26 ... yes 44/27 ... yes 44/28 ... yes 51/29 ... yes 44/32 ... yes 49/39 ... yes 49/42 ... yes 49/43 ... yes 49/44 ... yes 49/45 ... yes 49/46 ... yes 49/47 ... yes 49/48 ... yes 49/49 ... yes 49/51 ... yes 51/52 ... yes 33/53 ... yes 33/54 ... yes 54/56 ... yes 54/57 ... yes 44/58 ... yes 49/59 ... yes 54/61 ... yes 49/62 ... yes 59/63 ... yes 2/64 ... yes 69/66 ... yes 49/68 ... yes 39/69 ... yes 69/77 ... yes 6/78 ... yes 74/80 ... yes 54/82 ... yes 54/83 ... yes 54/84 ... yes 79/85 ... yes 49/86 ... yes 78/88 ... yes 79/89 ... yes 6/90 ... yes 77/91 ... yes 79/93 ... yes 82/94 ... yes 79/95 ... yes 79/96 ... yes 79/97 ... yes 59/98 ... yes 6/99 ... yes 2/100 ... yes 79/111 ... yes 95/114 ... yes 98/115 ... yes 98/116 ... yes 59/120 ... yes 59/121 ... yes 59/123 ... yes 93/124 ... yes 59/125 ... yes 59/126 ... yes 59/127 ... yes 93/128 ... yes 93/129 ... yes 93/130 ... yes 94/131 ... yes 94/132 ... yes 94/133 ... yes 95/135 ... yes 59/136 ... yes 82/137 ... yes 82/138 ... yes 82/139 ... yes 82/140 ... yes 82/144 ... yes 82/145 ... yes 82/146 ... yes 82/147 ... yes 72/149 ... yes 89/150 ... yes 79/152 ... yes 79/153 ... yes 79/154 ... yes 79/155 ... yes 79/156 ... yes 98/157 ... yes 2/158 ... yes 39/159 ... yes 100/160 ... yes 79/161 ... yes 229/162 ... yes 55/163 ... yes 98/164 ... yes 98/165 ... yes 2/167 ... yes 175/168 ... yes 79/169 ... yes 175/170 ... yes 39/171 ... yes 175/172 ... yes 108/173 ... yes 49/174 ... yes 106/175 ... yes 89/176 ... yes 79/177 ... yes 106/179 ... yes 77/180 ... yes 79/181 ... yes 79/182 ... yes 79/183 ... yes 79/184 ... yes 113/186 ... yes 113/187 ... yes 89/188 ... yes 99/189 ... yes 115/190 ... yes 116/191 ... yes 116/192 ... yes 117/193 ... yes 93/194 ... yes 116/196 ... yes 49/197 ... yes 59/198 ... yes 119/199 ... yes 106/200 ... yes 113/201 ... yes 113/202 ... yes 113/208 ... yes 37/209 ... yes 113/210 ... yes 113/211 ... yes 39/212 ... yes 59/213 ... yes 89/219 ... yes 113/225 ... yes 145/228 ... yes 99/229 ... yes 86/230 ... yes 128/231 ... yes 89/232 ... yes 128/233 ... yes 99/234 ... yes 121/235 ... yes 138/237 ... yes 141/238 ... yes 109/239 ... yes 79/240 ... yes 147/241 ... yes 6/242 ... yes 148/243 ... yes 89/244 ... yes 132/245 ... yes 79/247 ... yes 108/248 ... yes 108/249 ... yes 108/250 ... yes 121/252 ... yes 121/253 ... yes 121/254 ... yes 86/256 ... yes 77/258 ... yes 6/259 ... yes 151/260 ... yes 77/261 ... yes 237/262 ... yes 159/263 ... yes 162/264 ... yes 165/265 ... yes 161/266 ... yes 148/267 ... yes 108/268 ... yes 89/269 ... yes 99/270 ... yes 77/271 ... yes 99/272 ... yes 193/273 ... yes 79/274 ... yes 108/276 ... yes 192/277 ... yes 89/278 ... yes 193/279 ... yes 79/280 ... yes 79/281 ... yes 193/282 ... yes 89/283 ... yes 77/284 ... yes 113/285 ... yes 128/286 ... yes 89/287 ... yes 108/288 ... yes 193/290 ... yes 99/291 ... yes 39/292 ... yes 192/293 ... yes 159/294 ... yes 193/295 ... yes 99/296 ... yes 162/298 ... yes 116/299 ... yes 39/300 ... yes 113/301 ... yes 235/302 ... yes 193/303 ... yes 193/305 ... yes 213/306 ... yes 99/307 ... yes 113/309 ... yes 113/311 ... yes 113/312 ... yes 193/313 ... yes 193/314 ... yes 113/315 ... yes 77/317 ... yes 113/318 ... yes 193/319 ... yes 206/320 ... yes 77/321 ... yes 77/322 ... yes 213/323 ... yes 213/324 ... yes 229/326 ... yes 113/327 ... yes 77/328 ... yes 106/329 ... yes 113/330 ... yes 77/331 ... yes 108/334 ... yes 60/335 ... yes 213/336 ... yes 108/337 ... yes 212/338 ... yes 6/339 ... yes 113/340 ... yes 237/341 ... yes 228/342 ... yes 228/343 ... yes 113/344 ... yes 232/345 ... yes 232/346 ... yes 233/347 ... yes 232/349 ... yes 232/350 ... yes 232/351 ... yes 232/352 ... yes 232/353 ... yes 232/354 ... yes 233/355 ... yes 233/356 ... yes 232/357 ... yes 232/358 ... yes 232/359 ... yes 232/360 ... yes 232/361 ... yes 232/362 ... yes 232/363 ... yes 232/364 ... yes 232/365 ... yes 233/366 ... yes 232/367 ... yes 232/368 ... yes 232/369 ... yes 232/370 ... yes 232/372 ... yes 233/373 ... yes 232/374 ... yes 232/375 ... yes 113/377 ... yes 113/378 ... yes 234/379 ... yes 234/380 ... yes 234/381 ... yes 234/383 ... yes 125/385 ... yes 235/386 ... yes 235/387 ... yes 113/388 ... yes 237/389 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.5.3) Git version >= 2.18.0 ? ... yes (2.18.1) Git user has default SSH configuration? ... yes Active users: ... 115

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Edited May 14, 2019 by Vladimir Eremeev
Assignee Loading
Time tracking Loading