[ 
https://issues.apache.org/jira/browse/HDFS-7427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brahma Reddy Battula updated HDFS-7427:
---------------------------------------
    Description: 
Scenario:

Start cluster in securemode and enable only HTTPS
Run fectchimage command where user not having permission to access the folder..
 *From Namenode log* 
{noformat}
2014-11-24 16:46:49,072 | WARN  | 614008292@qtp-1263063368-200 | Committed 
before 410 GetImage failed. org.mortbay.jetty.EofException
        at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:791)
        at 
org.mortbay.jetty.HttpConnection.flushResponse(HttpConnection.java:693)
        at 
org.mortbay.jetty.HttpConnection$Output.close(HttpConnection.java:999)
        at 
org.apache.hadoop.hdfs.server.namenode.TransferFsImage.copyFileToStream(TransferFsImage.java:376)
        at 
org.apache.hadoop.hdfs.server.namenode.TransferFsImage.copyFileToStream(TransferFsImage.java:332)
        at 
org.apache.hadoop.hdfs.server.namenode.ImageServlet$1.serveFile(ImageServlet.java:158)
        at 
org.apache.hadoop.hdfs.server.namenode.ImageServlet$1.run(ImageServlet.java:120)
        at 
org.apache.hadoop.hdfs.server.namenode.ImageServlet$1.run(ImageServlet.java:101)
        at java.security.AccessController.doPrivileged(Native Method)
{noformat}

 *From Commandline* 
[omm@linux158 bin]$ ./hdfs dfsadmin -fetchImage /srv
OutPut : 123456
 *{color:red}fetchImage: Unable to download to any storage directory{color}* 


 *It's not unable to download, it should be like permission denied* 

  was:
Scenario:

Start cluster in securemode and enable only HTTPS
Run fectchimage command 

 [omm@linux158 bin]$ ./hdfs dfsadmin -fetchImage /srv/image
No GC_PROFILE is given. Defaults to medium.
fetchImage: FileSystem file:/// is not an HDFS file system
Usage: java DFSAdmin [-fetchImage <local directory>]

{code}
public int fetchImage(final String[] argv, final int idx) throws IOException {
    Configuration conf = getConf();
    final URL infoServer = DFSUtil.getInfoServer(
        HAUtil.getAddressOfActive(getDFS()), conf,
        DFSUtil.getHttpClientScheme(conf)).toURL();
    SecurityUtil.doAsCurrentUser(new PrivilegedExceptionAction<Void>() {
      @Override
      public Void run() throws Exception {
        TransferFsImage.downloadMostRecentImageToDirectory(infoServer,
            new File(argv[idx]));
        return null;
      }
    });
    return 0;
  }

{code}


> [fetchimage] Should give correct error message when it's not able flush the 
> image file.
> ---------------------------------------------------------------------------------------
>
>                 Key: HDFS-7427
>                 URL: https://issues.apache.org/jira/browse/HDFS-7427
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Brahma Reddy Battula
>            Priority: Critical
>
> Scenario:
> Start cluster in securemode and enable only HTTPS
> Run fectchimage command where user not having permission to access the 
> folder..
>  *From Namenode log* 
> {noformat}
> 2014-11-24 16:46:49,072 | WARN  | 614008292@qtp-1263063368-200 | Committed 
> before 410 GetImage failed. org.mortbay.jetty.EofException
>         at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:791)
>         at 
> org.mortbay.jetty.HttpConnection.flushResponse(HttpConnection.java:693)
>         at 
> org.mortbay.jetty.HttpConnection$Output.close(HttpConnection.java:999)
>         at 
> org.apache.hadoop.hdfs.server.namenode.TransferFsImage.copyFileToStream(TransferFsImage.java:376)
>         at 
> org.apache.hadoop.hdfs.server.namenode.TransferFsImage.copyFileToStream(TransferFsImage.java:332)
>         at 
> org.apache.hadoop.hdfs.server.namenode.ImageServlet$1.serveFile(ImageServlet.java:158)
>         at 
> org.apache.hadoop.hdfs.server.namenode.ImageServlet$1.run(ImageServlet.java:120)
>         at 
> org.apache.hadoop.hdfs.server.namenode.ImageServlet$1.run(ImageServlet.java:101)
>         at java.security.AccessController.doPrivileged(Native Method)
> {noformat}
>  *From Commandline* 
> [omm@linux158 bin]$ ./hdfs dfsadmin -fetchImage /srv
> OutPut : 123456
>  *{color:red}fetchImage: Unable to download to any storage directory{color}* 
>  *It's not unable to download, it should be like permission denied* 



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

Reply via email to