I am running code as a windows service. When I run the same code in debug mode it works, when i run the code as a service I get the error "Cannot read from a directory ('/')".
I narrowed the command down to FTP.GetFiles method. In the FTP directory there are 81 files with the largest being 110k in size. I have used the rebex.filelogwriter with the log level set to debug. I have tried using pasv mode and active mode but receive the same error. Here is the Rebex Log. I have removed the user and ipaddress from the file. Thank you for any help you can provide.
2010-21-06 08:10:01.046 Opening log file.
2010-21-06 08:10:01.046 INFO Ftp(2) Info: Connecting to ##FTP:PORT## using Ftp 3.0.3588.0.
2010-21-06 08:10:01.046 INFO Ftp(2) Info: Using proxy none.
2010-21-06 08:10:01.234 DEBUG Ftp(2) Info: Connection succeeded.
2010-21-06 08:10:01.437 INFO Ftp(2) Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
2010-21-06 08:10:01.437 INFO Ftp(2) Response: 220-You are user number 5 of 250 allowed.
2010-21-06 08:10:01.437 INFO Ftp(2) Response: 220-<<
2010-21-06 08:10:01.437 INFO Ftp(2) Command: FEAT
2010-21-06 08:10:01.640 INFO Ftp(2) Response: 211-Extensions supported:
2010-21-06 08:10:01.640 INFO Ftp(2) Response: EPRT
2010-21-06 08:10:01.640 INFO Ftp(2) Response: IDLE
2010-21-06 08:10:01.640 INFO Ftp(2) Response: MDTM
2010-21-06 08:10:01.640 INFO Ftp(2) Response: SIZE
2010-21-06 08:10:01.640 INFO Ftp(2) Response: REST STREAM
2010-21-06 08:10:01.640 INFO Ftp(2) Response: MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
2010-21-06 08:10:01.640 INFO Ftp(2) Response: MLSD
2010-21-06 08:10:01.640 INFO Ftp(2) Response: ESTP
2010-21-06 08:10:01.640 INFO Ftp(2) Response: PASV
2010-21-06 08:10:01.640 INFO Ftp(2) Response: EPSV
2010-21-06 08:10:01.640 INFO Ftp(2) Response: SPSV
2010-21-06 08:10:01.640 INFO Ftp(2) Response: ESTA
2010-21-06 08:10:01.640 INFO Ftp(2) Response: AUTH TLS
2010-21-06 08:10:01.640 INFO Ftp(2) Response: PBSZ
2010-21-06 08:10:01.640 INFO Ftp(2) Response: PROT
2010-21-06 08:10:01.640 INFO Ftp(2) Response: UTF8
2010-21-06 08:10:01.640 INFO Ftp(2) Response: 211 End.
2010-21-06 08:10:01.640 INFO Ftp(2) Command: USER ##
2010-21-06 08:10:01.828 INFO Ftp(2) Response: 331 User ## OK. Password required
2010-21-06 08:10:01.828 INFO Ftp(2) Command: PASS **********
2010-21-06 08:10:02.031 INFO Ftp(2) Response: 230-Your bandwidth usage is restricted
2010-21-06 08:10:02.031 INFO Ftp(2) Response: 230-User ## has group access to: ftpgroup
2010-21-06 08:10:02.031 INFO Ftp(2) Response: 230 OK. Current restricted directory is /
2010-21-06 08:10:02.031 INFO Ftp(2) Command: OPTS UTF8 ON
2010-21-06 08:10:02.234 INFO Ftp(2) Response: 200 OK, UTF-8 enabled
2010-21-06 08:10:02.234 DEBUG Ftp(2) Info: Starting data transfer.
2010-21-06 08:10:02.234 INFO Ftp(2) Command: TYPE I
2010-21-06 08:10:02.625 INFO Ftp(2) Response: 200 TYPE is now 8-bit binary
2010-21-06 08:10:02.625 INFO Ftp(2) Command: PASV
2010-21-06 08:10:02.828 INFO Ftp(2) Response: 227 Entering Passive Mode (##IPADDRESS##)
2010-21-06 08:10:02.828 DEBUG Ftp(2) Info: Establishing data connection to ##IPADDRESS##.
2010-21-06 08:10:23.859 DEBUG Ftp(2) Info: Error while starting data transfer: Rebex.Net.FtpException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> Rebex.Net.ProxySocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> Rebex.Net.ProxySocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at 328075837.13357030529.151169660(String , IPAddress , Int32 )
--- End of inner exception stack trace ---
at 328075837.13357030529.151169660(String , IPAddress , Int32 )
--- End of inner exception stack trace ---
at 328075837.13357030529.362804169(IAsyncResult , String )
at 328075837.13357030529.15613119759(IAsyncResult , Int32 )
at Rebex.Net.ProxySocket.EndConnect(IAsyncResult asyncResult)
at 328075837.588172452.151169660(EndPoint )
--- End of inner exception stack trace ---
at 328075837.588172452.151169660(EndPoint )
at Rebex.Net.Ftp.19941338139(String , 588172452 , Int64 , FtpTransferState )
2010-21-06 08:10:23.859 DEBUG Ftp(2) Info: Closing data connection.
2010-21-06 08:10:23.859 ERROR Ftp(2) Info: Rebex.Net.FtpBatchTransferException: Cannot read from a directory ('/'). ---> Rebex.Net.FtpException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> Rebex.Net.ProxySocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> Rebex.Net.ProxySocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at 328075837.13357030529.151169660(String , IPAddress , Int32 )
--- End of inner exception stack trace ---
at 328075837.13357030529.151169660(String , IPAddress , Int32 )
--- End of inner exception stack trace ---
at 328075837.13357030529.362804169(IAsyncResult , String )
at 328075837.13357030529.15613119759(IAsyncResult , Int32 )
at Rebex.Net.ProxySocket.EndConnect(IAsyncResult asyncResult)
at 328075837.588172452.151169660(EndPoint )
--- End of inner exception stack trace ---
at 328075837.588172452.151169660(EndPoint )
at Rebex.Net.Ftp.19941338139(String , 588172452 , Int64 , FtpTransferState )
at Rebex.Net.Ftp.8956377289(String , Stream , Int64 )
at Rebex.Net.Ftp.GetList(String arguments)
at 328075837.20961014519.1569771334(String )
at 328075837.20961014519.AppendRemoteFileList(ArrayList dirs, ArrayList files, 792810434 remotePathDesc, Regex nameFilter, Boolean appendDirs, String remotePath, String localPath)
at 328075837.17759126019.17005970309(792810434 )
--- End of inner exception stack trace ---
at 328075837.17759126019.HandleException(Exception ex, 2061242560 type, String remotePath, String localPath, 2074704321 remoteInfo, 2074704321 localInfo, 16902977159 defaultAction, 16902977159 possibleActions, 16902977159& chosenAction)
at 328075837.17759126019.HandleCaughtException(Exception caught, String message, 2061242560 type, String remotePath, String localPath, 2074704321 remoteInfo, 2074704321 localInfo, 16902977159 possibleActions, 16902977159& chosenAction)
at 328075837.17759126019.17005970309(792810434 )
at 328075837.17759126019.5474409839(String , String )
at 328075837.17759126019.TransferFiles(Boolean putFile, Object expectedRootItem, String localPath, String remotePath, 1286277555 transferOptions, 2117658205 existingFileMode)
at Rebex.Net.Ftp.GetFiles(String remotePath, String localDirectoryPath, FtpBatchTransferOptions transferOptions, FtpActionOnExistingFiles existingFileMode)
2010-21-06 08:10:23.859