JoelB commented on a change in pull request #371: GUACAMOLE-717: Handle
LDAPException gracefully when doing a search
URL: https://github.com/apache/guacamole-client/pull/371#discussion_r251169144
##########
File path:
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/ObjectQueryService.java
##########
@@ -220,6 +220,9 @@ public String generateQuery(String filter,
logger.warn("Given a referral, but referrals are
disabled. Error was: {}", e.getMessage());
logger.debug("Got a referral, but configured to not
follow them.", e);
}
+ } catch (LDAPException e) {
+ logger.warn("Failed to process an LDAP search result.");
Review comment:
Here is an example Exception from the logs after this change is applied:
`22:09:34.489 [http-nio-8080-exec-2] ERROR
o.a.g.auth.ldap.ObjectQueryService - Error processing LDAPEntry search result.
com.novell.ldap.LDAPException: Sizelimit Exceeded
at com.novell.ldap.LDAPResponse.getResultException(Unknown Source)
~[guacamole-auth-ldap-1.0.0.jar:na]
at com.novell.ldap.LDAPResponse.chkResultCode(Unknown Source)
~[guacamole-auth-ldap-1.0.0.jar:na]
at com.novell.ldap.LDAPSearchResults.next(Unknown Source)
~[guacamole-auth-ldap-1.0.0.jar:na]
at
org.apache.guacamole.auth.ldap.ObjectQueryService.search(ObjectQueryService.java:209)
[guacamole-auth-ldap-1.0.0.jar:na]
at
org.apache.guacamole.auth.ldap.ObjectQueryService.search(ObjectQueryService.java:279)
[guacamole-auth-ldap-1.0.0.jar:na]
at
org.apache.guacamole.auth.ldap.group.UserGroupService.getUserGroups(UserGroupService.java:115)
[guacamole-auth-ldap-1.0.0.jar:na]
at
org.apache.guacamole.auth.ldap.user.LDAPUserContext.init(LDAPUserContext.java:137)
[guacamole-auth-ldap-1.0.0.jar:na]
at
org.apache.guacamole.auth.ldap.AuthenticationProviderService.getUserContext(AuthenticationProviderService.java:351)
[guacamole-auth-ldap-1.0.0.jar:na]
at
org.apache.guacamole.auth.ldap.LDAPAuthenticationProvider.getUserContext(LDAPAuthenticationProvider.java:86)
[guacamole-auth-ldap-1.0.0.jar:na]
at
org.apache.guacamole.extension.AuthenticationProviderFacade.getUserContext(AuthenticationProviderFacade.java:274)
[classes/:na]
at
org.apache.guacamole.rest.auth.AuthenticationService.getUserContexts(AuthenticationService.java:393)
[classes/:na]
at
org.apache.guacamole.rest.auth.AuthenticationService.authenticate(AuthenticationService.java:442)
[classes/:na]
at
org.apache.guacamole.rest.auth.TokenRESTService.createToken(TokenRESTService.java:173)
[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
~[na:1.8.0_181]
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[na:1.8.0_181]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at
com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
[jersey-server-1.17.1.jar:1.17.1]
at
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
[jersey-server-1.17.1.jar:1.17.1]
at
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
[jersey-server-1.17.1.jar:1.17.1]`
I'd say the only thing that's useful is the exception description "Sizelimit
Exceeded".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services