LDAP often fails with 'socket closed'

I am using LDAP to authenticate with ShinyProxy. But this is only partly successful as I have to try to login several times until it succeeds. When it fails I get a ‘socket closed’ error.

Since I can log in after some attempts, I guess the settings are in principle correct.

Any help on how to resolve this is highly appreciated.

If you need more information, let me know.

Here is the (hopefully) relevant part of the log:

2018-06-14 10:27:11.909 DEBUG 11669 --- [XNIO-2 task-138] o.s.s.l.a.LdapAuthenticationProvider     : Processing authentication request for user: <username>
2018-06-14 10:27:12.041 DEBUG 11669 --- [XNIO-2 task-138] o.s.s.l.a.BindAuthenticator              : Attempting to bind as cn=<username>,ou=00000,ou=<OU1>,ou=<OU2>,ou=<OU3>,ou=<OU4>,dc=<DC>,dc=de
2018-06-14 10:27:12.154 DEBUG 11669 --- [XNIO-2 task-138] o.s.s.l.a.BindAuthenticator              : Retrieving attributes...
2018-06-14 10:27:12.156 DEBUG 11669 --- [XNIO-2 task-138] .s.s.l.u.DefaultLdapAuthoritiesPopulator : Getting authorities for user cn=<username>,ou=00000,ou=<OU1>,ou=<OU2>,ou=<OU3>,ou=<OU4>,dc=<DC>,dc=de
2018-06-14 10:27:12.156 DEBUG 11669 --- [XNIO-2 task-138] .s.s.l.u.DefaultLdapAuthoritiesPopulator : Searching for roles for user '<username>', DN = 'cn=<username>,ou=00000,ou=<OU1>,ou=<OU2>,ou=<OU3>,ou=<OU4>,dc=<DC>,dc=de', with filter (member={0}) in search base ''
2018-06-14 10:27:22.296 ERROR 11669 --- [XNIO-2 task-138] io.undertow.request                      : UT005023: Exception handling request to /login

org.springframework.ldap.ServiceUnavailableException: ldap.<DC>.de:636; socket closed; nested exception is javax.naming.ServiceUnavailableException: ldap.<DC>.de:636; socket closed; remaining name ''

Hi @andreas,

Since there are 10 seconds between the role search and the error, this may be a timeout from the LDAP server.
The search may be too slow… can you try specifying a group-search-base setting, to narrow down the search?

Thanks. This seems to work