Hi,

i am facing an issue when I call the _ftp.GetList() method for a directory on remote server. This error occurs for this directory only, may be because this directory has a lot of files that are about 1-2 mb. The FtpException being fired is "An established connection was aborted by the software in your host machine. ". I have disabled windows firewall and disabled my antivirus as well. But this issue is still occurring.

Any help will be appreciated.

Here is the log: Please note that i have replaced some critical info with xxxxx

2010-05-17 17:10:30.331 Opening log file.
2010-05-17 17:10:30.340 INFO Ftp(1) Command: PWD
2010-05-17 17:10:30.665 INFO Ftp(1) Response: 257 "/" is current directory.
2010-05-17 17:10:30.668 INFO Ftp(1) Command: CWD /
2010-05-17 17:10:30.993 INFO Ftp(1) Response: 250 CWD command successful.
2010-05-17 17:10:31.006 DEBUG Ftp(1) Info: Starting data transfer.
2010-05-17 17:10:31.007 INFO Ftp(1) Command: TYPE A
2010-05-17 17:10:31.330 INFO Ftp(1) Response: 200 Type set to A.
2010-05-17 17:10:31.333 INFO Ftp(1) Command: PASV
2010-05-17 17:10:31.663 INFO Ftp(1) Response: 227 Entering Passive Mode (xxx,xxx,xx,xxx,19,156).
2010-05-17 17:10:31.667 DEBUG Ftp(1) Info: Establishing data connection to xxx,xxx,xx,xxx:5020.
2010-05-17 17:10:31.994 INFO Ftp(1) Command: LIST
2010-05-17 17:10:32.318 INFO Ftp(1) Response: 125 Data connection already open; Transfer starting.
2010-05-17 17:10:32.338 DEBUG Ftp(1) Info: Data transfer ended.
2010-05-17 17:10:32.339 DEBUG Ftp(1) Info: Closing downloading data connection.
2010-05-17 17:10:32.341 DEBUG Ftp(1) Info: Waiting for data transfer ending message.
2010-05-17 17:10:32.857 INFO Ftp(1) Response: 226 Transfer complete.
2010-05-17 17:10:32.857 DEBUG Ftp(1) Info: Data transfer ended.
2010-05-17 17:10:32.857 DEBUG Ftp(1) Info: Transfer ended successfully.
2010-05-17 17:10:32.857 DEBUG Ftp(1) Info: Data connection closed.
2010-05-17 17:11:05.879 INFO Ftp(3) Command: PWD
2010-05-17 17:11:06.203 INFO Ftp(3) Response: 257 "/" is current directory.
2010-05-17 17:11:06.204 INFO Ftp(3) Command: PWD
2010-05-17 17:11:06.529 INFO Ftp(3) Response: 257 "/" is current directory.
2010-05-17 17:11:06.584 INFO Ftp(3) Command: CWD //uploads
2010-05-17 17:11:06.911 INFO Ftp(3) Response: 250 CWD command successful.
2010-05-17 17:11:06.912 DEBUG Ftp(3) Info: Starting data transfer.
2010-05-17 17:11:06.912 INFO Ftp(3) Command: TYPE A
2010-05-17 17:11:07.259 INFO Ftp(3) Response: 200 Type set to A.
2010-05-17 17:11:07.259 INFO Ftp(3) Command: PASV
2010-05-17 17:11:08.934 INFO Ftp(3) Response: 227 Entering Passive Mode (xxx,xxx,xx,xxx,19,157).
2010-05-17 17:11:08.934 DEBUG Ftp(3) Info: Establishing data connection to xxx,xxx,xx,xxx:5021.
2010-05-17 17:11:09.284 INFO Ftp(3) Command: LIST
2010-05-17 17:11:09.611 INFO Ftp(3) Response: 125 Data connection already open; Transfer starting.
2010-05-17 17:11:09.614 DEBUG Ftp(3) Info: Data transfer ended.
2010-05-17 17:11:09.614 DEBUG Ftp(3) Info: Closing downloading data connection.
2010-05-17 17:11:09.615 DEBUG Ftp(3) Info: Waiting for data transfer ending message.
2010-05-17 17:11:10.135 INFO Ftp(3) Response: 226 Transfer complete.
2010-05-17 17:11:10.136 DEBUG Ftp(3) Info: Data transfer ended.
2010-05-17 17:11:10.136 DEBUG Ftp(3) Info: Transfer ended successfully.
2010-05-17 17:11:10.136 DEBUG Ftp(3) Info: Data connection closed.
2010-05-17 17:11:31.022 INFO Ftp(4) Command: CWD //uploads/xxxxxxxxx
2010-05-17 17:11:32.882 INFO Ftp(4) Response: 250 CWD command successful.
2010-05-17 17:11:32.882 INFO Ftp(4) Command: PWD
2010-05-17 17:11:33.204 INFO Ftp(4) Response: 257 "/uploads/xxxxxxxxx" is current directory.
2010-05-17 17:11:33.204 DEBUG Ftp(4) Info: Starting data transfer.
2010-05-17 17:11:33.204 INFO Ftp(4) Command: TYPE A
2010-05-17 17:11:33.526 INFO Ftp(4) Response: 200 Type set to A.
2010-05-17 17:11:33.527 INFO Ftp(4) Command: PASV
2010-05-17 17:11:33.852 INFO Ftp(4) Response: 227 Entering Passive Mode (xxx,xxx,xx,xxx,19,158).
2010-05-17 17:11:33.853 DEBUG Ftp(4) Info: Establishing data connection to xxx,xxx,xx,xxx:5022.
2010-05-17 17:11:34.179 INFO Ftp(4) Command: LIST
2010-05-17 17:11:34.508 INFO Ftp(4) Response: 125 Data connection already open; Transfer starting.
2010-05-17 17:11:35.509 INFO Ftp(4) Response: 226 Transfer complete.
2010-05-17 17:12:45.497 INFO Ftp(5) Command: PWD
2010-05-17 17:12:45.818 INFO Ftp(5) Response: 257 "/" is current directory.
2010-05-17 17:12:45.820 INFO Ftp(5) Command: CWD /
2010-05-17 17:12:46.145 INFO Ftp(5) Response: 250 CWD command successful.
2010-05-17 17:12:46.149 DEBUG Ftp(5) Info: Starting data transfer.
2010-05-17 17:12:46.149 INFO Ftp(5) Command: TYPE A
2010-05-17 17:12:46.470 INFO Ftp(5) Response: 200 Type set to A.
2010-05-17 17:12:46.470 INFO Ftp(5) Command: PASV
2010-05-17 17:12:46.796 INFO Ftp(5) Response: 227 Entering Passive Mode (xxx,xxx,xx,xxx,19,160).
2010-05-17 17:12:46.796 DEBUG Ftp(5) Info: Establishing data connection to xxx,xxx,xx,xxx:5024.
2010-05-17 17:12:47.118 INFO Ftp(5) Command: LIST
2010-05-17 17:12:47.454 INFO Ftp(5) Response: 125 Data connection already open; Transfer starting.
2010-05-17 17:12:47.465 DEBUG Ftp(5) Info: Data transfer ended.
2010-05-17 17:12:47.465 DEBUG Ftp(5) Info: Closing downloading data connection.
2010-05-17 17:12:47.466 DEBUG Ftp(5) Info: Waiting for data transfer ending message.
2010-05-17 17:12:47.975 INFO Ftp(5) Response: 226 Transfer complete.
2010-05-17 17:12:47.975 DEBUG Ftp(5) Info: Data transfer ended.
2010-05-17 17:12:47.975 DEBUG Ftp(5) Info: Transfer ended successfully.
2010-05-17 17:12:47.975 DEBUG Ftp(5) Info: Data connection closed.
2010-05-17 17:13:27.618 INFO Ftp(7) Command: PWD
2010-05-17 17:13:27.940 INFO Ftp(7) Response: 257 "/" is current directory.
2010-05-17 17:13:31.153 INFO Ftp(7) Command: PWD
2010-05-17 17:13:31.479 INFO Ftp(7) Response: 257 "/" is current directory.
2010-05-17 17:13:32.775 INFO Ftp(7) Command: PWD
2010-05-17 17:13:33.100 INFO Ftp(7) Response: 257 "/" is current directory.
2010-05-17 17:13:33.690 INFO Ftp(7) Command: CWD //uploads
2010-05-17 17:13:34.017 INFO Ftp(7) Response: 250 CWD command successful.
2010-05-17 17:13:37.185 DEBUG Ftp(7) Info: Starting data transfer.
2010-05-17 17:13:37.186 INFO Ftp(7) Command: TYPE A
2010-05-17 17:13:37.510 INFO Ftp(7) Response: 200 Type set to A.
2010-05-17 17:13:37.510 INFO Ftp(7) Command: PASV
2010-05-17 17:13:37.850 INFO Ftp(7) Response: 227 Entering Passive Mode (xxx,xxx,xx,xxx,19,161).
2010-05-17 17:13:37.850 DEBUG Ftp(7) Info: Establishing data connection to xxx,xxx,xx,xxx:5025.
2010-05-17 17:13:38.179 INFO Ftp(7) Command: LIST
2010-05-17 17:13:38.508 INFO Ftp(7) Response: 125 Data connection already open; Transfer starting.
2010-05-17 17:13:38.511 DEBUG Ftp(7) Info: Data transfer ended.
2010-05-17 17:13:38.511 DEBUG Ftp(7) Info: Closing downloading data connection.
2010-05-17 17:13:38.511 DEBUG Ftp(7) Info: Waiting for data transfer ending message.
2010-05-17 17:13:39.031 INFO Ftp(7) Response: 226 Transfer complete.
2010-05-17 17:13:39.031 DEBUG Ftp(7) Info: Data transfer ended.
2010-05-17 17:13:39.031 DEBUG Ftp(7) Info: Transfer ended successfully.
2010-05-17 17:13:39.031 DEBUG Ftp(7) Info: Data connection closed.
2010-05-17 17:14:04.463 INFO Ftp(8) Command: CWD //uploads/xxxxxxxxx
2010-05-17 17:14:04.832 INFO Ftp(8) Response: 250 CWD command successful.
2010-05-17 17:14:04.832 INFO Ftp(8) Command: PWD
2010-05-17 17:14:05.159 INFO Ftp(8) Response: 257 "/uploads/xxxxxxxxx" is current directory.
2010-05-17 17:14:05.159 DEBUG Ftp(8) Info: Starting data transfer.
2010-05-17 17:14:05.159 INFO Ftp(8) Command: TYPE A
2010-05-17 17:14:05.483 INFO Ftp(8) Response: 200 Type set to A.
2010-05-17 17:14:05.484 INFO Ftp(8) Command: PASV
2010-05-17 17:14:05.808 INFO Ftp(8) Response: 227 Entering Passive Mode (xxx,xxx,xx,xxx,19,163).
2010-05-17 17:14:05.808 DEBUG Ftp(8) Info: Establishing data connection to xxx,xxx,xx,xxx:5027.
2010-05-17 17:14:06.132 INFO Ftp(8) Command: LIST
2010-05-17 17:14:07.960 INFO Ftp(8) Response: 125 Data connection already open; Transfer starting.
2010-05-17 17:14:07.960 INFO Ftp(8) Response: 226 Transfer complete.
2010-05-17 17:23:04.376 ERROR Ftp(4) Info: Error while reading data: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at Rebex.Net.ProxySocket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at wWGvS.bEcmRk.BMJzdYZ(Byte[] , Int32 , Int32 )
   at wWGvS.bEcmRk.Read(Byte[] buffer, Int32 offset, Int32 count)
2010-05-17 17:23:04.383 ERROR Ftp(4) Info: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at Rebex.Net.ProxySocket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at wWGvS.bEcmRk.BMJzdYZ(Byte[] , Int32 , Int32 )
   at wWGvS.bEcmRk.Read(Byte[] buffer, Int32 offset, Int32 count)
   at wWGvS.bsWOwAZ.Read(Byte[] buffer, Int32 offset, Int32 count)
   at Rebex.Net.Ftp.bjMtzmZ(String , Stream , Int64 )
2010-05-17 17:23:04.390 DEBUG Ftp(4) Info: Closing downloading data connection.
2010-05-17 17:23:04.396 DEBUG Ftp(4) Info: Transfer ended successfully.
2010-05-17 17:23:04.397 DEBUG Ftp(4) Info: Data connection closed.
2010-05-17 17:24:07.966 INFO Ftp(8) Command: NOOP
2010-05-17 17:24:08.973 DEBUG Ftp(8) Info: Closing data connection.
2010-05-17 17:24:08.998 ERROR Ftp(8) Info: Error while reading data: Rebex.Net.FtpException: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at Rebex.Net.ProxySocket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at wWGvS.AgXIfM.BMJzdYZ(Byte[] , Int32 )
   at wWGvS.AgXIfM.BbLKfs(String& )
   at wWGvS.AgXIfM.KsZclZ()
   at Rebex.Net.Ftp.baTZwi(Boolean )
   --- End of inner exception stack trace ---
   at Rebex.Net.Ftp.baTZwi(Boolean )
   at wWGvS.bEcmRk.BboyfsZ()
   at wWGvS.bEcmRk.BMJzdYZ(Byte[] , Int32 , Int32 )
   at wWGvS.bEcmRk.Read(Byte[] buffer, Int32 offset, Int32 count)
2010-05-17 17:24:09.004 ERROR Ftp(8) Info: Rebex.Net.FtpException: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at Rebex.Net.ProxySocket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at wWGvS.AgXIfM.BMJzdYZ(Byte[] , Int32 )
   at wWGvS.AgXIfM.BbLKfs(String& )
   at wWGvS.AgXIfM.KsZclZ()
   at Rebex.Net.Ftp.baTZwi(Boolean )
   --- End of inner exception stack trace ---
   at Rebex.Net.Ftp.baTZwi(Boolean )
   at wWGvS.bEcmRk.BboyfsZ()
   at wWGvS.bEcmRk.BMJzdYZ(Byte[] , Int32 , Int32 )
   at wWGvS.bEcmRk.Read(Byte[] buffer, Int32 offset, Int32 count)
   at wWGvS.bsWOwAZ.Read(Byte[] buffer, Int32 offset, Int32 count)
   at Rebex.Net.Ftp.bjMtzmZ(String , Stream , Int64 )
2010-05-17 17:24:09.011 DEBUG Ftp(8) Info: Closing downloading data connection.
2010-05-17 17:24:09.017 DEBUG Ftp(8) Info: Transfer ended successfully.
2010-05-17 17:24:09.017 DEBUG Ftp(8) Info: Data connection closed.
2010-05-17 17:31:41.489 INFO Ftp(9) Command: CWD //uploads/xxxxxxxxx
2010-05-17 17:31:42.895 INFO Ftp(9) Response: 250 CWD command successful.
2010-05-17 17:31:42.895 INFO Ftp(9) Command: PWD
2010-05-17 17:31:43.218 INFO Ftp(9) Response: 257 "/uploads/xxxxxxxxx" is current directory.
2010-05-17 17:31:47.833 DEBUG Ftp(9) Info: Starting data transfer.
2010-05-17 17:31:47.833 INFO Ftp(9) Command: TYPE A
2010-05-17 17:31:48.159 INFO Ftp(9) Response: 200 Type set to A.
2010-05-17 17:31:48.159 INFO Ftp(9) Command: PASV
2010-05-17 17:31:50.014 INFO Ftp(9) Response: 227 Entering Passive Mode (xxx,xxx,xx,xxx,19,156).
2010-05-17 17:31:50.014 DEBUG Ftp(9) Info: Establishing data connection to xxx,xxx,xx,xxx:5020.
2010-05-17 17:31:50.338 INFO Ftp(9) Command: LIST
2010-05-17 17:31:53.732 INFO Ftp(9) Response: 125 Data connection already open; Transfer starting.
2010-05-17 17:31:53.732 INFO Ftp(9) Response: 226 Transfer complete.
2010-05-17 17:41:54.027 INFO Ftp(9) Command: NOOP
2010-05-17 17:41:55.034 DEBUG Ftp(9) Info: Closing data connection.
2010-05-17 17:41:55.047 ERROR Ftp(9) Info: Error while reading data: Rebex.Net.FtpException: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at Rebex.Net.ProxySocket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at wWGvS.AgXIfM.BMJzdYZ(Byte[] , Int32 )
   at wWGvS.AgXIfM.BbLKfs(String& )
   at wWGvS.AgXIfM.KsZclZ()
   at Rebex.Net.Ftp.baTZwi(Boolean )
   --- End of inner exception stack trace ---
   at Rebex.Net.Ftp.baTZwi(Boolean )
   at wWGvS.bEcmRk.BboyfsZ()
   at wWGvS.bEcmRk.BMJzdYZ(Byte[] , Int32 , Int32 )
   at wWGvS.bEcmRk.Read(Byte[] buffer, Int32 offset, Int32 count)
2010-05-17 17:41:55.053 ERROR Ftp(9) Info: Rebex.Net.FtpException: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at Rebex.Net.ProxySocket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at wWGvS.AgXIfM.BMJzdYZ(Byte[] , Int32 )
   at wWGvS.AgXIfM.BbLKfs(String& )
   at wWGvS.AgXIfM.KsZclZ()
   at Rebex.Net.Ftp.baTZwi(Boolean )
   --- End of inner exception stack trace ---
   at Rebex.Net.Ftp.baTZwi(Boolean )
   at wWGvS.bEcmRk.BboyfsZ()
   at wWGvS.bEcmRk.BMJzdYZ(Byte[] , Int32 , Int32 )
   at wWGvS.bEcmRk.Read(Byte[] buffer, Int32 offset, Int32 count)
   at wWGvS.bsWOwAZ.Read(Byte[] buffer, Int32 offset, Int32 count)
   at Rebex.Net.Ftp.bjMtzmZ(String , Stream , Int64 )
2010-05-17 17:41:55.062 DEBUG Ftp(9) Info: Closing downloading data connection.
2010-05-17 17:41:55.068 DEBUG Ftp(9) Info: Transfer ended successfully.
2010-05-17 17:41:55.068 DEBUG Ftp(9) Info: Data connection closed.

asked 17 May '10, 12:56

imran's gravatar image

imran
162
accept rate: 0%

edited 10 Aug '10, 13:00

Rebex%20KB's gravatar image

Rebex KB ♦♦
258519

the issue is solved thankfully.

the problem was that the ftp instance (by default) was connecting in passive mode. when i changed it to active mode, the getfile() returned list without any issues.

Just for my curiosity, what is the difference between active/passive mode in this ftp client?

(17 May '10, 13:05) imran

Nice to know that you have solved it. Here is the difference between active and passive modes:

FTP uses two connections - one for sending commands and the second one for transferring files and directory listing.

In active mode:

  • The client sends the server the IP address port number that the client will use for the data connection
  • and the server opens the connection
  • you must allow incoming traffic on your firewall

In passive mode:

  • The server sends the client an IP address and port number
  • Client opens the connection to the server

The passive mode is more firewall friendly.

link

answered 17 May '10, 13:20

Martin%20Vobr's gravatar image

Martin Vobr ♦♦
335310
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×152
×22
×13

Asked: 17 May '10, 12:56

Seen: 1,034 times

Last updated: 23 Mar '11, 02:22