You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Mikhail Pryakhin (Jira)" <ji...@apache.org> on 2020/05/11 13:39:00 UTC

[jira] [Reopened] (HDFS-1820) FTPFileSystem attempts to close the outputstream even when it is not initialised

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

Mikhail Pryakhin reopened HDFS-1820:
------------------------------------

looks like this is causing HADOOP-17036.

> FTPFileSystem attempts to close the outputstream even when it is not initialised
> --------------------------------------------------------------------------------
>
>                 Key: HDFS-1820
>                 URL: https://issues.apache.org/jira/browse/HDFS-1820
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs-client
>    Affects Versions: 0.20.1
>         Environment: occurs on all platforms
>            Reporter: Sudharsan Sampath
>            Assignee: Mikhail Pryakhin
>            Priority: Major
>              Labels: hadoop
>             Fix For: 3.3.1
>
>         Attachments: HDFS-1820.001.patch, HDFS-1820.002.patch
>
>
> FTPFileSystem's create method attempts to close the outputstream even when it is not initialized causing a null pointer exception. In our case the apache commons FTPClient was not able to create the destination file due to permissions issue. The FtpClient promptly reported a 553 : Permissions issue but it was overlooked in FTPFileSystem create method. 
> The following code fails
> if (!FTPReply.isPositivePreliminary(client.getReplyCode())) {
>       // The ftpClient is an inconsistent state. Must close the stream
>       // which in turn will logout and disconnect from FTP server
>       fos.close();
>       throw new IOException("Unable to create file: " + file + ", Aborting");
>     }
> as 'fos' is null. As a result the proper error message "Unable to create file XXX" is not reported but rather a null pointer exception.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org