ComponentPro.Net.SftpException: Failure; Failure

0

Hi, 

I'm using ComponentPro.Sftp libraries in our C# application to connect to a remote server for sending and receiving files. 

What is Successfully working: 

       1. Connecting to remote server using public/private key authentication

       2. Sending files after successful connection to remote server

       3. Viewing files, changing directories on remote server

 

Libraries: 

      1. ComponentPro.Common.dll (v 6.8.40.4155)

      2. ComponentPro.FileSystem.dll (v 6.8.40.4155)

      3. ComponentPro.Network.dll (v 6.8.40.4155)

      4. ComponentPro.Sftp.dll (v 6.8.40.4155)

 

Things that are not working:

       1. After we connect to remote server to fetch/get the file(flat file): Our application(using componentPro libraries) gets the file successfully and then application fails. So, after successful connection, we get the file on our local machine/server and after that our application catches exception of type "ComponentPro.Net.SftpException: Failure; Failure". 

We included "ComponentPro.Diagnostics.XTrace" loggin to Verbose level and following is the result of it: 

 

[07-05-2017 15:50:36.61] Debug - Response: SSH_FXP_DATA Id:12, Len: 1375 bytes)

Sftp: 1, Thread Id: 0 [07-05-2017 15:50:36.61] Debug - Info: 15 SSH read requests are in queue.

Sftp: 1, Thread Id: 0 [07-05-2017 15:50:36.61] Information - Response: SSH_FXP_STATUS Id: 13, Code: 4, Message: 'Failure'

Sftp: 1, Thread Id: 0 [07-05-2017 15:50:36.61] Debug - Info: 14 SSH read requests are in queue.

Sftp: 1, Thread Id: 0 [07-05-2017 15:50:36.61] Information - Response: SSH_FXP_STATUS Id: 14, Code: 4, Message: 'Failure'

 [07-05-2017 15:50:36.61] Verbose - Ssh: Received packet SSH_MSG_CHANNEL_DATA (149 bytes).

5E 00 00 00 00 00 00 00 8C 00 00 00 18 65 00 00 00 11 00 00 00 04 00 00 00 07 46 61 69 6C 75 72 65 00 00 00

00 00 00 00 18 65 00 00 00 12 00 00 00 04 00 00 00 07 46 61 69 6C 75 72 65 00 00 00 00 00 00 00 18 65 00 00

00 13 00 00 00 04 00 00 00 07 46 61 69 6C 75 72 65 00 00 00 00 00 00 00 18 65 00 00 00 14 00 00 00 04 00 00

00 07 46 61 69 6C 75 72 65 00 00 00 00 00 00 00 18 65 00 00 00 15 00 00 00 04 00 00 00 07 46 61 69 6C 75 72

65 00 00 00 00

Sftp: 1, Thread Id: 0 [07-05-2017 15:50:36.61] Error - Info: ComponentPro.Net.SftpException: Failure; Failure.

   at c_R1W.c_P4W(c_GQC c_EAD, Type c_HQB)

   at c_R1W.c_F2W(UInt32 c_SFW, AsyncOperation c_DA)

   at ComponentPro.Net.Sftp.c_UXM(Boolean c_YAM, ProgressFileItem c_X3K, Stream c_YYM, AsyncOperation c_M)

 

 

 

Code from our Application that download the file:

                                             try {

 
 
                           SftpFileInfoCollection files = (SftpFileInfoCollection)client.ListDirectory("/"new NameSearchCondition(_ftpFileFilter), false);
                                if (files.Count > 0)
                                {
                                    foreach (var file in files)
                                    {
                                      
                                      client.DownloadFile(_ftpReceiveDirectory + file, receiveFilePath + file);
                                    }
 
                                 var movefile = client.ListName("/");
 
                                }
                                else
                                {
                                    Console.WriteLine("File Not Found");
                                }
 
                           }
                       catch (Exception ex)
                        {
                            Console.WriteLine("An error has occurred:");
                            Console.WriteLine(ex.Message);
                        }

 

 

 

Thanks You

edited 12/1/2017 2:27:10 AM
asked 7/18/2017 1:56:18 PM
add a comment

3 Answers

0

Hello,

That error is so general. Base on the information you provided, it seems that the file indicates that the path is not correct. Can you try "client.DownloadFile(file.FullName, receiveFilePath + file);" instead of "client.DownloadFile(_ftpReceiveDirectory + file, receiveFilePath + file);"

 
answered 11/16/2017 12:41:37 AM
add a comment
0
Hi,
 
I havent heard back from you guys about this thread. I replied to you on you mail 'support@componentpro.com' twice but got no response back. 
If, in case you didn't receive my email, below is the copy of it. 
 
"Hi, 
Unfortunately we cannot provide you with test account because the server we are connecting to is not ours. 
I can provide you logs that we captured when we fetch/get the file to our machine. 
And, if you like I can also provide you with our C# application environment details, let me know what you need."
 
We are still having issues after receiving the file from server. Hope to heard back from you soon.
 
 
 
Thanks
Rahul
 
answered 11/16/2017 12:41:37 AM
add a comment
0

Thank you for sharing the details of your issue. To reproduce the issue we would need the configuration of that one to build similar one on our side. Or if you have a test one that is accessible from us, please send us test account info to support@componentpro.com.

 
answered 11/16/2017 12:41:37 AM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged ftp sftp or ask your own question.