hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mukhadin Buzdov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-12785) [Handling exceptions] LdapGroupsMapping.getGroups() do not provide information about root cause
Date Tue, 09 Feb 2016 16:54:18 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-12785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15139195#comment-15139195
] 

Mukhadin Buzdov commented on HADOOP-12785:
------------------------------------------

[~jojochuang], thank you for paying attention!

I'm pretty fine with messages, suggestion was to print stack trace of exceptions, something
like:
{code:title=WARN level|borderStyle=solid}
    try {
        // ...
    } catch (CommunicationException e) {
      LOG.warn("Connection is closed, will try to reconnect", e);
    } catch (NamingException e) {
      LOG.warn("Exception trying to get groups for user " + user, e);
      return emptyResults;
    }
{code}

Or if it will generate to much logs - just to provide stack trace on DEBUG level:
{code:title=DEBUG level|borderStyle=solid}
    try {
        // ...
    } catch (CommunicationException e) {
      LOG.warn("Connection is closed, will try to reconnect");
      LOG.debug("Root cause is", e);
    } catch (NamingException e) {
      LOG.warn("Exception trying to get groups for user " + user + ": " + e.getMessage());
      LOG.debug("Root cause is", e);
      return emptyResults;
    }
{code}

----

Had to write something similar to _LdapGroupsMapping_ today to understand what is wrong with
my environment and configuration properties.
Exception message only may be not informative enough - today had a problem with self-signed
CA and only the 3rd level exception says me this.

> [Handling exceptions] LdapGroupsMapping.getGroups() do not provide information about
root cause
> -----------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-12785
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12785
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 2.7.1
>         Environment: _Operating system_: CentOS Linux 7 {color:gray}(7.1.1503){color}
> _Platform_: HDP 2.3.4.0, Ambari 2.1.2
>            Reporter: Mukhadin Buzdov
>            Priority: Minor
>              Labels: easyfix
>
> _CommunicationException_ and _NamingException_ are not logged in _LdapGroupsMapping.getGroups()_.
> {code:title=LdapGroupsMapping.java|borderStyle=solid}
>   public synchronized List<String> getGroups(String user) throws IOException {
>     List<String> emptyResults = new ArrayList<String>();
>     // ...
>     try {
>       return doGetGroups(user);
>     } catch (CommunicationException e) {
>       LOG.warn("Connection is closed, will try to reconnect");
>     } catch (NamingException e) {
>       LOG.warn("Exception trying to get groups for user " + user + ": " + e.getMessage());
>       return emptyResults;
>     }
>     //...
>     return emptyResults;
>   }
> {code}
> {color:red}It is not possible to understand _LDAP_ level failures.{color}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message