FTP file transfer issue on "Grass Valley K2 FTP Server"

0
Hi, I am facing some issue in FTP file transfer on "Grass Valley K2 FTP Server". For other server type, the transfer works properly. Below is the network traffic captured, file to be transferred in "V:/GXF" folder. 34200 → 21 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1 21 → 34200 [SYN, ACK] Seq=0 Ack=1 Win=49640 Len=0 MSS=1460 WS=1 SACK_PERM=1 34200 → 21 [ACK] Seq=1 Ack=1 Win=65536 Len=0 Response: 220 FTP Server (x.x.x.xxxx) ready. Request: USER ******* Response: 331 Password required for user *******. Request: PASS ******* Response: 230 Logged in, and aspect successfully set to MOVIE, stream mode GXF. Request: FEAT Response: 211-FTP command extensions supported on MX-C39: 34200 → 21 [ACK] Seq=35 Ack=198 Win=65280 Len=0 Response: UTF8 Request: OPTS UTF8 ON Response: 200 UTF8 mode enabled. Request: CWD / Response: 250 Change of directory to V:/ successful, xfer mode FILEMODE. Request: TYPE I Response: 200 Type set to IMAGE. Request: MDTM . Response: 500 "MDTM" not understood. Request: SIZE . Response: 213 13 Request: CWD /GXF Response: 250 Change of directory to V:/GXF/ successful, xfer mode GXF. Request: PWD Response: 257 "V:/GXF/" is current directory. Request: CWD / Response: 250 Change of directory to V:/GXF/ successful, xfer mode GXF. Request: CWD GXF Response: 250 Change of directory to V:/GXF/GXF/ successful, xfer mode GXF. Request: PWD Response: 257 "V:/GXF/GXF/" is current directory. Request: CWD / Response: 250 Change of directory to V:/GXF/GXF/ successful, xfer mode GXF. Request: MKD GXF Response: 550 Could not create directory, "GXF", 0x0 Thanks in advance.
 
asked 4/4/2018 9:41:35 AM
add a comment

4 Answers

0
Using latest ComponentPro.FTP dll files (v 6.8.40.4155), also goes to else condition i.e. "Folder '/GXF' does not exist". Below is the log when "**if (client.DirectoryExists("/GXF"))**" code executes - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.12] Verbose - Info: Data => 4D 44 54 4D 20 2E 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.12] Information - Command: MDTM . - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.40] Verbose - Info: Received data over control connection: 35 30 30 20 22 4D 44 54 4D 22 20 6E 6F 74 20 75 6E 64 65 72 73 74 6F 6F 64 2E 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.40] Information - Response: 500 "MDTM" not understood. - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.40] Verbose - Info: Data => 53 49 5A 45 20 2E 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.40] Information - Command: SIZE . - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.67] Verbose - Info: Received data over control connection: 32 31 33 20 31 30 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.67] Information - Response: 213 10 - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.67] Verbose - Info: Data => 50 57 44 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.67] Information - Command: PWD - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.95] Verbose - Info: Received data over control connection: 32 35 37 20 22 56 3A 2F 22 20 69 73 20 63 75 72 72 65 6E 74 20 64 69 72 65 63 74 6F 72 79 2E 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.95] Information - Response: 257 "V:/" is current directory. - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.95] Verbose - Info: Data => 43 57 44 20 2F 47 58 46 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:56.95] Information - Command: CWD /GXF - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:57.22] Verbose - Info: Received data over control connection: 32 35 30 20 43 68 61 6E 67 65 20 6F 66 20 64 69 72 65 63 74 6F 72 79 20 74 6F 20 56 3A 2F 47 58 46 2F 20 73 75 63 63 65 73 73 66 75 6C 2C 20 78 66 65 72 20 6D 6F 64 65 20 47 58 46 2E 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:57.22] Information - Response: 250 Change of directory to V:/GXF/ successful, xfer mode GXF. - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:57.22] Verbose - Info: Data => 50 57 44 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:57.22] Information - Command: PWD - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:57.50] Verbose - Info: Received data over control connection: 32 35 37 20 22 56 3A 2F 47 58 46 2F 22 20 69 73 20 63 75 72 72 65 6E 74 20 64 69 72 65 63 74 6F 72 79 2E 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:57.50] Information - Response: 257 "V:/GXF/" is current directory. - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:57.50] Verbose - Info: Data => 43 57 44 20 56 3A 2F 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:57.50] Information - Command: CWD V:/ - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:57.78] Verbose - Info: Received data over control connection: 32 35 30 20 43 68 61 6E 67 65 20 6F 66 20 64 69 72 65 63 74 6F 72 79 20 74 6F 20 56 3A 2F 20 73 75 63 63 65 73 73 66 75 6C 2C 20 78 66 65 72 20 6D 6F 64 65 20 46 49 4C 45 4D 4F 44 45 2E 0D 0A - Ftp: 1, Thread Id: 0 [04/10/2018 10:07:57.78] Information - Response: 250 Change of directory to V:/ successful, xfer mode FILEMODE. **client.GetCurrentDirectory() is "V:/"** Thanks in advance.
 
answered 4/10/2018 4:56:13 AM
add a comment
0
With the Older ComponentPro library, following log is generated Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.19] Information - Response: 250 Change of directory to V:/GXF/ successful, xfer mode GXF. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.19] Information - Command: PWD Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.19] Information - Command: PWD Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.19] Information - Command: PWD Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Response: 257 "V:/GXF/" is current directory. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Response: 257 "V:/GXF/" is current directory. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Response: 257 "V:/GXF/" is current directory. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Command: CWD V:/ Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Command: CWD V:/ Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Command: CWD V:/ Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.84] Information - Response: 250 Change of directory to V:/ successful, xfer mode FILEMODE. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.84] Information - Response: 250 Change of directory to V:/ successful, xfer mode FILEMODE. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.84] Information - Response: 250 Change of directory to V:/ successful, xfer mode FILEMODE. Below is demo source code, which checks the directory exists goes to else condition i.e. directory does not exists. private void CheckDirectoryExists(string _serveraddress,string _username,string _password) { try { Ftp client = new Ftp(); client.Connect(_serveraddress); string auth = client.Authenticate(_username, _password); ComponentPro.IO.FileInfoCollection collection = client.ListDirectory(); // Set the log level. ComponentPro.Diagnostics.XTrace.Level = ComponentPro.Diagnostics.TraceEventType.Verbose; // Add the UltimateTextWriterTraceListener listener to write to a file. ComponentPro.Diagnostics.XTrace.Listeners.Add( new ComponentPro.Diagnostics.UltimateTextWriterTraceListener("c:\\temp\\log.log")); // You can also write log to a Console window with the following code: ComponentPro.Diagnostics.XTrace.Listeners.Add(new ComponentPro.Diagnostics.UltimateConsoleTraceListener()); // Determine whether folder 'myFolder' exists or not. if (client.DirectoryExists("/GXF")) Console.WriteLine("Folder '/GXF' exists"); else Console.WriteLine("Folder '/GXF' does not exist"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } **ComponentPro.IO.FileInfoCollection collection = client.ListDirectory();** Zeroth index element (GXF directory) of collection have below properties. - collection[0] {GXF} ComponentPro.IO.AbstractFileInfo {ComponentPro.Net.FtpFileInfo} - [ComponentPro.Net.FtpFileInfo] {GXF} ComponentPro.Net.FtpFileInfo - Attributes Directory | Normal System.IO.FileAttributes - CreationTime {1/1/0001 12:00:00 AM} System.DateTime - DirectoryName "V:" string - Exists false bool - FileSystem {Ftp: 1, Thread Id: 0} ComponentPro.IO.FileSystem {ComponentPro.Net.Ftp} - FullName "V:/GXF" string - IsDirectory true bool - IsFile false bool - IsSymlink false bool - LastAccessTime {1/1/0001 12:00:00 AM} System.DateTime - LastWriteTime {3/6/2018 12:00:00 AM} System.DateTime - Length 0 long - Name "GXF" string - ParentFolder {V:/} ComponentPro.IO.AbstractFileInfo {ComponentPro.Net.FtpFileInfo} - SymlinkPath null string
edited 4/9/2018 12:42:52 PM
answered 4/9/2018 12:40:05 PM
add a comment
0
**ComponentPro ftp library version** : 6.1.40.50412 This piece of code works for other server types public void ProcessDelivery(TransferTask transferTask, string targetPath, string transferPath, List dirs, List files) { if (string.IsNullOrWhiteSpace(targetPath) && files.Count > 0) targetPath = Path.GetDirectoryName(files[0]); targetPath = targetPath.Replace("%s", Path.GetFileNameWithoutExtension(files[0])); // Loop through the directories first)));) foreach (string dir in dirs) { if (Worker.CheckCancellationPending()) return; //Get the folder name only to append the folder at the CIFS or FTP location where the file is getting delivered string subFolder = Transfer.GetRelativePath(targetPath, dir); // Create only needs the relative path (current directory should be transfer tasks selected sub folder, if any) CreateDirectory(subFolder); } Worker.FileCount = files.Count; // Don't use more threads than we have files int numThreads = Math.Min(files.Count, _numThreads); if (numThreads < 1) numThreads = 1; // Set the bitrate throttle value if it was specified SetBitrateThrottle(numThreads); // Kick of a multi-threaded transfer now _transferThreadsCompleted = false; _transferFailed = false; _transferThreads = FtpLib.UploadFiles(targetPath, files.ToArray(), "", new TransferOptions(), numThreads, false); while (!_transferThreadsCompleted) { // For sanity, if there is no progress update within the configured timeout value, then cancel with an error if ((DateTime.Now - _lastProgressCheck).TotalSeconds > _noActivityTimeout) { _errorMessage = "Cancelling the transfer. The fetcher has not reported its status for the past " _noActivityTimeout " seconds."; CancellTransfer(); } Thread.Sleep(5000); } // Check if the transfer failed for any reason and ,nreport the error if it did if (_transferFailed) { Logger.Error(_errorMessage); throw new Exception(_errorMessage); } // Loop through the files to get the list of target files and save them to the task var targetFiles = new List(); foreach (var file in files) { if (Worker.CheckCancellationPending()) return; string targetFile = transferPath; string folder = Transfer.GetRelativePath(targetPath, Path.GetDirectoryName(file)); if (!string.IsNullOrEmpty(folder)) { targetFile = transferPath @"/" folder; } targetFiles.Add(targetFile); // Also handle the Move case here "Delete file after delivery" if (transferTask.Type == TransferType.Move) { var message = UNCHelpers.DeleteUncFile(file); if (!string.IsNullOrEmpty(message)) throw new Exception(message); } } // Set the progress to 100% and add the list of target files Worker.T.Progress = 100; Worker.T.AddTargets(targetFiles); }
edited 4/4/2018 12:44:24 PM
answered 4/4/2018 11:56:34 AM
  Please verify whether your subscription is still active since you are using a quite old version. The latest one is v6.8.1. If it's possible please send us the log file generated by our component to support@componentpro.com. For more info about generating log file, please see: [https://www.componentpro.com/blog/in-class/cpro-blog-tags/log](https://www.componentpro.com/blog/in-class/cpro-blog-tags/log) sysadmin 4/4/2018 3:19:58 PM
  With the Older ComponentPro library, following log is generated Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.19] Information - Response: 250 Change of directory to V:/GXF/ successful, xfer mode GXF. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.19] Information - Command: PWD Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.19] Information - Command: PWD Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.19] Information - Command: PWD Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Response: 257 "V:/GXF/" is current directory. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Response: 257 "V:/GXF/" is current directory. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Response: 257 "V:/GXF/" is current directory. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Command: CWD V:/ Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Command: CWD V:/ Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.51] Information - Command: CWD V:/ Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.84] Information - Response: 250 Change of directory to V:/ successful, xfer mode FILEMODE. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.84] Information - Response: 250 Change of directory to V:/ successful, xfer mode FILEMODE. Ftp: 1, Thread Id: 0 [04/09/2018 17:48:46.84] Information - Response: 250 Change of directory to V:/ successful, xfer mode FILEMODE. This is demo source code private void CheckDirectoryExists(string _serveraddress,string _username,string _password) { try { Ftp client = new Ftp(); client.Connect(_serveraddress); string auth = client.Authenticate(_username, _password); ComponentPro.IO.FileInfoCollection collection = client.ListDirectory(); // Set the log level. ComponentPro.Diagnostics.XTrace.Level = ComponentPro.Diagnostics.TraceEventType.Verbose; // Add the UltimateTextWriterTraceListener listener to write to a file. ComponentPro.Diagnostics.XTrace.Listeners.Add( new ComponentPro.Diagnostics.UltimateTextWriterTraceListener("c:\\\ emp\\\\log.log")); // You can also write log to a Console window with the following code: ComponentPro.Diagnostics.XTrace.Listeners.Add(new ComponentPro.Diagnostics.UltimateConsoleTraceListener()); // Determine whether folder 'myFolder' exists or not. if (client.DirectoryExists("/GXF")) Console.WriteLine("Folder '/GXF' exists"); else Console.WriteLine("Folder '/GXF' does not exist"); } catch (Exception ex) { MessageBox.Show(ex.Message); } } ComponentPro.IO.FileInfoCollection collection = client.ListDirectory(); Zeroth index element of collection have below properties. collection[0] {GXF} ComponentPro.IO.AbstractFileInfo {ComponentPro.Net.FtpFileInfo} [ComponentPro.Net.FtpFileInfo] {GXF} ComponentPro.Net.FtpFileInfo Attributes Directory | Normal System.IO.FileAttributes CreationTime {1/1/0001 12:00:00 AM} System.DateTime DirectoryName "V:" string Exists false bool FileSystem {Ftp: 1, Thread Id: 0} ComponentPro.IO.FileSystem {ComponentPro.Net.Ftp} FullName "V:/GXF" string IsDirectory true bool IsFile false bool IsSymlink false bool LastAccessTime {1/1/0001 12:00:00 AM} System.DateTime LastWriteTime {3/6/2018 12:00:00 AM} System.DateTime Length 0 long Name "GXF" string ParentFolder {V:/} ComponentPro.IO.AbstractFileInfo {ComponentPro.Net.FtpFileInfo} SymlinkPath null string abhishekzararia 4/9/2018 12:26:34 PM
add a comment
0
Can you please share the code snippet that produced this issue?
edited 4/4/2018 11:29:06 AM
answered 4/4/2018 10:28:01 AM
  waiting for your reply. abhishekzararia 4/11/2018 10:10:02 AM
add a comment

Your Answer

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