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

Rob Vesse commented on HADOOP-13824:
------------------------------------

The command line is as follows:

{noformat}
hdfs dfs -D dfs.client.use.datanode.hostname=true -cat 
hdfs://remote-namenode:8020/some/file
{noformat}

So I am attempting to talk to a Remote HDFS cluster where I can access the name 
node but the data nodes are registered with internal IP addresses hence why I 
want to use hostnames. I think the underlying cause is that the returned 
hostnames are not resolvable on the machine where I run this command but since 
the underlying error is suppressed I can't tell for certain.

Reproducing the specific case may be awkward because it appears to require 
specific network configurations. However if you look at the code for 
{{FsShell}} you should be able to see by inspection what I'm talking about. 
Specifically there is a {{catch}} branch in {{FsShell.run()}} that does not log 
the error and the {{displayError()}} method does not check that the provided 
{{message}} argument is not {{null}}

I can probably provide a patch for this myself but I'm taking some time off 
this weekend so it would be Monday at the earliest

> FsShell can suppress the real error if no error message is present
> ------------------------------------------------------------------
>
>                 Key: HADOOP-13824
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13824
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 2.7.1, 2.7.3
>            Reporter: Rob Vesse
>            Assignee: John Zhuge
>              Labels: supportability
>
> The {{FsShell}} error handling assumes in {{displayError()}} that the 
> {{message}} argument is not {{null}}. However in the case where it is this 
> leads to a NPE which results in suppressing the actual error information 
> since a higher level of error handling kicks in and just dumps the stack 
> trace of the NPE instead.
> e.g.
> {noformat}
> Exception in thread "main" java.lang.NullPointerException
>       at org.apache.hadoop.fs.FsShell.displayError(FsShell.java:304)
>       at org.apache.hadoop.fs.FsShell.run(FsShell.java:289)
>       at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
>       at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
>       at org.apache.hadoop.fs.FsShell.main(FsShell.java:340)
> {noformat}
> This is deeply unhelpful because depending on what the underlying error was 
> there may be no stack dumped/logged for it (as HADOOP-7114 provides) since 
> {{FsShell}} doesn't explicitly dump traces for {{IllegalArgumentException}} 
> which appears to be the underlying cause of my issue.  Line 289 is where 
> {{displayError()}} is called for {{IllegalArgumentException}} handling and 
> that catch clause does not log the error.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to