[jira] Created: (NET-270) Incorrect error handling in method initiateListParsing of FTPClient

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (NET-270) Incorrect error handling in method initiateListParsing of FTPClient

JIRA jira@apache.org
Incorrect error handling in method initiateListParsing of FTPClient
-------------------------------------------------------------------

                 Key: NET-270
                 URL: https://issues.apache.org/jira/browse/NET-270
             Project: Commons Net
          Issue Type: Bug
    Affects Versions: 2.0
         Environment: XP - java version "1.5.0_09" - FileZilla server 0.9.30beta
            Reporter: Gilles Gaillard


In method initiateListParsing of FTPClient, errors when opening the data connection are not correctly handled.
This leads to ignore message delivered by the server and further operation with the FTPClient instance are not valid.

As an example, considere the attached unit test. When such an error is met, using the _sendNoOp_ command returns false.
Here is an output of the test:
{noformat}
F:\dev\jakarta\>run org.apache.commons.vfs.provider.ftp.FTPClientUnitTest 10.0.0.x 21 /GILLES/source usr pass 5500
Ignoring error when creating client at iteration: 1152
Error at iteration: 1155
java.net.SocketTimeoutException: Accept timed out
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
        at java.net.ServerSocket.implAccept(ServerSocket.java:450)
        at java.net.ServerSocket.accept(ServerSocket.java:421)
        at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:489)
        at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2296)
        at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2269)
        at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2046)
        at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.testConnectTimeoutInList(FTPClientUnitTest.java:70)
        at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.main(FTPClientUnitTest.java:110)
Exception in thread "main" junit.framework.AssertionFailedError: NOOP failed at iteration 1155
        at junit.framework.Assert.fail(Assert.java:47)
        at junit.framework.Assert.assertTrue(Assert.java:20)
        at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.testConnectTimeoutInList(FTPClientUnitTest.java:75)
        at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.main(FTPClientUnitTest.java:110)
{noformat}


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (NET-270) Incorrect error handling in method initiateListParsing of FTPClient

JIRA jira@apache.org

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

Gilles Gaillard updated NET-270:
--------------------------------

    Attachment: FTPClientUnitTest.java

Attached unit test showing the issue

> Incorrect error handling in method initiateListParsing of FTPClient
> -------------------------------------------------------------------
>
>                 Key: NET-270
>                 URL: https://issues.apache.org/jira/browse/NET-270
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: XP - java version "1.5.0_09" - FileZilla server 0.9.30beta
>            Reporter: Gilles Gaillard
>         Attachments: FTPClientUnitTest.java
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In method initiateListParsing of FTPClient, errors when opening the data connection are not correctly handled.
> This leads to ignore message delivered by the server and further operation with the FTPClient instance are not valid.
> As an example, considere the attached unit test. When such an error is met, using the _sendNoOp_ command returns false.
> Here is an output of the test:
> {noformat}
> F:\dev\jakarta\>run org.apache.commons.vfs.provider.ftp.FTPClientUnitTest 10.0.0.x 21 /GILLES/source usr pass 5500
> Ignoring error when creating client at iteration: 1152
> Error at iteration: 1155
> java.net.SocketTimeoutException: Accept timed out
>         at java.net.PlainSocketImpl.socketAccept(Native Method)
>         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
>         at java.net.ServerSocket.implAccept(ServerSocket.java:450)
>         at java.net.ServerSocket.accept(ServerSocket.java:421)
>         at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:489)
>         at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2296)
>         at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2269)
>         at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2046)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.testConnectTimeoutInList(FTPClientUnitTest.java:70)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.main(FTPClientUnitTest.java:110)
> Exception in thread "main" junit.framework.AssertionFailedError: NOOP failed at iteration 1155
>         at junit.framework.Assert.fail(Assert.java:47)
>         at junit.framework.Assert.assertTrue(Assert.java:20)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.testConnectTimeoutInList(FTPClientUnitTest.java:75)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.main(FTPClientUnitTest.java:110)
> {noformat}

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (NET-270) Incorrect error handling in method initiateListParsing of FTPClient

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/NET-270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697098#action_12697098 ]

Gilles Gaillard commented on NET-270:
-------------------------------------

The reason why {{sendNoOp }} returns false is that {{completePendingCommand}} was not called because of the socket exception.
The consequence is that any further usages of the FTPClient instance lead to inconsistent server message. At call _n_, the client reads the server response for the call _n - 1_

> Incorrect error handling in method initiateListParsing of FTPClient
> -------------------------------------------------------------------
>
>                 Key: NET-270
>                 URL: https://issues.apache.org/jira/browse/NET-270
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: XP - java version "1.5.0_09" - FileZilla server 0.9.30beta
>            Reporter: Gilles Gaillard
>         Attachments: FTPClientUnitTest.java
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In method initiateListParsing of FTPClient, errors when opening the data connection are not correctly handled.
> This leads to ignore message delivered by the server and further operation with the FTPClient instance are not valid.
> As an example, considere the attached unit test. When such an error is met, using the _sendNoOp_ command returns false.
> Here is an output of the test:
> {noformat}
> F:\dev\jakarta\>run org.apache.commons.vfs.provider.ftp.FTPClientUnitTest 10.0.0.x 21 /GILLES/source usr pass 5500
> Ignoring error when creating client at iteration: 1152
> Error at iteration: 1155
> java.net.SocketTimeoutException: Accept timed out
>         at java.net.PlainSocketImpl.socketAccept(Native Method)
>         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
>         at java.net.ServerSocket.implAccept(ServerSocket.java:450)
>         at java.net.ServerSocket.accept(ServerSocket.java:421)
>         at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:489)
>         at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2296)
>         at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2269)
>         at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2046)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.testConnectTimeoutInList(FTPClientUnitTest.java:70)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.main(FTPClientUnitTest.java:110)
> Exception in thread "main" junit.framework.AssertionFailedError: NOOP failed at iteration 1155
>         at junit.framework.Assert.fail(Assert.java:47)
>         at junit.framework.Assert.assertTrue(Assert.java:20)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.testConnectTimeoutInList(FTPClientUnitTest.java:75)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.main(FTPClientUnitTest.java:110)
> {noformat}

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (NET-270) Incorrect error handling in method initiateListParsing of FTPClient

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/NET-270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697098#action_12697098 ]

Gilles Gaillard edited comment on NET-270 at 4/8/09 9:57 AM:
-------------------------------------------------------------

The reason why {{sendNoOp}} returns false is that {{completePendingCommand}} was not called because of the socket exception.

The consequence is that any further usages of the FTPClient instance lead to inconsistent server message. At call _n_, the client reads the server response for the call _n - 1_

      was (Author: [hidden email]):
    The reason why {{sendNoOp }} returns false is that {{completePendingCommand}} was not called because of the socket exception.
The consequence is that any further usages of the FTPClient instance lead to inconsistent server message. At call _n_, the client reads the server response for the call _n - 1_
 

> Incorrect error handling in method initiateListParsing of FTPClient
> -------------------------------------------------------------------
>
>                 Key: NET-270
>                 URL: https://issues.apache.org/jira/browse/NET-270
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: XP - java version "1.5.0_09" - FileZilla server 0.9.30beta
>            Reporter: Gilles Gaillard
>         Attachments: FTPClientUnitTest.java
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In method initiateListParsing of FTPClient, errors when opening the data connection are not correctly handled.
> This leads to ignore message delivered by the server and further operation with the FTPClient instance are not valid.
> As an example, considere the attached unit test. When such an error is met, using the _sendNoOp_ command returns false.
> Here is an output of the test:
> {noformat}
> F:\dev\jakarta\>run org.apache.commons.vfs.provider.ftp.FTPClientUnitTest 10.0.0.x 21 /GILLES/source usr pass 5500
> Ignoring error when creating client at iteration: 1152
> Error at iteration: 1155
> java.net.SocketTimeoutException: Accept timed out
>         at java.net.PlainSocketImpl.socketAccept(Native Method)
>         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
>         at java.net.ServerSocket.implAccept(ServerSocket.java:450)
>         at java.net.ServerSocket.accept(ServerSocket.java:421)
>         at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:489)
>         at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2296)
>         at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2269)
>         at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2046)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.testConnectTimeoutInList(FTPClientUnitTest.java:70)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.main(FTPClientUnitTest.java:110)
> Exception in thread "main" junit.framework.AssertionFailedError: NOOP failed at iteration 1155
>         at junit.framework.Assert.fail(Assert.java:47)
>         at junit.framework.Assert.assertTrue(Assert.java:20)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.testConnectTimeoutInList(FTPClientUnitTest.java:75)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.main(FTPClientUnitTest.java:110)
> {noformat}

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (NET-270) Incorrect error handling in method initiateListParsing of FTPClient

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Sebb updated NET-270:
---------------------

    Component/s: FTP

> Incorrect error handling in method initiateListParsing of FTPClient
> -------------------------------------------------------------------
>
>                 Key: NET-270
>                 URL: https://issues.apache.org/jira/browse/NET-270
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.0
>         Environment: XP - java version "1.5.0_09" - FileZilla server 0.9.30beta
>            Reporter: Gilles Gaillard
>         Attachments: FTPClientUnitTest.java
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In method initiateListParsing of FTPClient, errors when opening the data connection are not correctly handled.
> This leads to ignore message delivered by the server and further operation with the FTPClient instance are not valid.
> As an example, considere the attached unit test. When such an error is met, using the _sendNoOp_ command returns false.
> Here is an output of the test:
> {noformat}
> F:\dev\jakarta\>run org.apache.commons.vfs.provider.ftp.FTPClientUnitTest 10.0.0.x 21 /GILLES/source usr pass 5500
> Ignoring error when creating client at iteration: 1152
> Error at iteration: 1155
> java.net.SocketTimeoutException: Accept timed out
>         at java.net.PlainSocketImpl.socketAccept(Native Method)
>         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
>         at java.net.ServerSocket.implAccept(ServerSocket.java:450)
>         at java.net.ServerSocket.accept(ServerSocket.java:421)
>         at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:489)
>         at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2296)
>         at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2269)
>         at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2046)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.testConnectTimeoutInList(FTPClientUnitTest.java:70)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.main(FTPClientUnitTest.java:110)
> Exception in thread "main" junit.framework.AssertionFailedError: NOOP failed at iteration 1155
>         at junit.framework.Assert.fail(Assert.java:47)
>         at junit.framework.Assert.assertTrue(Assert.java:20)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.testConnectTimeoutInList(FTPClientUnitTest.java:75)
>         at org.apache.commons.vfs.provider.ftp.FTPClientUnitTest.main(FTPClientUnitTest.java:110)
> {noformat}

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.