termscp icon indicating copy to clipboard operation
termscp copied to clipboard

[BUG] - Can not enter the directory

Open scum833 opened this issue 1 year ago • 1 comments

Description

Can not enter the directory. image

The other directories are working fine; only ‘/00CM’ is getting this error.

Environment

  • OS: Windows 11
  • Architecture: x86_64
  • termscp version: termscp v0.16.0 (0.16, 79c33095, 2024-10-14T14:24:35.620336300Z)
  • Protocol used: FTP
  • Remote server version and name: vsFTPd 3.0.2

Log

2024-10-15T08:08:20.3496249Z [INFO] Connection established!
2024-10-15T08:08:20.3496947Z [INFO] Established connection with '': "220 (vsFTPd 3.0.2)"
2024-10-15T08:08:20.5755775Z [DEBUG] (1) remotefs_ftp::client: Getting working directory...
2024-10-15T08:08:20.6159992Z [DEBUG] (1) remotefs_ftp::client: Getting list entries for /
2024-10-15T08:08:35.45623Z [DEBUG] (1) remotefs_ftp::client: Changing working directory to /00CM
2024-10-15T08:08:35.5006547Z [INFO] Changed directory on remote: /00CM
2024-10-15T08:08:35.5007788Z [DEBUG] (1) remotefs_ftp::client: Getting working directory...
2024-10-15T08:08:35.5405966Z [DEBUG] (1) remotefs_ftp::client: Getting list entries for /00CM
2024-10-15T08:08:35.7015793Z [ERROR] Failed to list directory: Response contains an invalid syntax
2024-10-15T08:08:35.701888Z [ERROR] Could not scan current remote directory: protocol error (Response contains an invalid syntax)
2024-10-15T08:08:35.7020965Z [DEBUG] (1) remotefs_ftp::client: Getting working directory...
2024-10-15T08:08:35.772975Z [DEBUG] (1) remotefs_ftp::client: Getting list entries for /00CM
2024-10-15T08:08:35.9503306Z [ERROR] Failed to list directory: Response contains an invalid syntax
2024-10-15T08:08:35.950644Z [ERROR] Could not scan current remote directory: protocol error (Response contains an invalid syntax)

scum833 avatar Oct 15 '24 08:10 scum833

Hi,

unfortunately this issue is not strictly related to termscp, but to suppaftp, which is also implemented by me. Unfortunately suppaftp logs are filtered, so the actionnable for this issue is not to filter them.

But I'd like to understand what the issue is, so if you want, you can install suppaftp-cli and try to connect to the server and check with the debug option what is causing the issue by providing me with the log.

suppaftp-cli --debug <socket_addr>
LOGIN
... enter password
CWD /00CM
LIST

veeso avatar Oct 17 '24 16:10 veeso

@veeso Here is the log.

[2024-10-21T08:30:13Z DEBUG suppaftp::sync_ftp] Signin in with user ''
[2024-10-21T08:30:13Z TRACE suppaftp::sync_ftp] CC OUT: USER 
[2024-10-21T08:30:13Z TRACE suppaftp::sync_ftp] CC IN: [51, 51, 49, 32, 80, 108, 101, 97, 115, 101, 32, 115, 112, 101, 99, 105, 102, 121, 32, 116, 104, 101, 32, 112, 97, 115, 115, 119, 111, 114, 100, 46, 13, 10]
[2024-10-21T08:30:13Z TRACE suppaftp::sync_ftp] Code parsed from response: user name okay, need password (331)
[2024-10-21T08:30:13Z TRACE suppaftp::sync_ftp] CC IN: [51, 51, 49, 32, 80, 108, 101, 97, 115, 101, 32, 115, 112, 101, 99, 105, 102, 121, 32, 116, 104, 101, 32, 112, 97, 115, 115, 119, 111, 114, 100, 46, 13, 10]
[2024-10-21T08:30:13Z DEBUG suppaftp::sync_ftp] Password is required
[2024-10-21T08:30:13Z TRACE suppaftp::sync_ftp] CC OUT: PASS 
[2024-10-21T08:30:13Z TRACE suppaftp::sync_ftp] CC IN: [50, 51, 48, 32, 76, 111, 103, 105, 110, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 46, 13, 10]
[2024-10-21T08:30:13Z TRACE suppaftp::sync_ftp] Code parsed from response: user logged in, proceed. Logged out if appropriate. (230)
[2024-10-21T08:30:13Z TRACE suppaftp::sync_ftp] CC IN: [50, 51, 48, 32, 76, 111, 103, 105, 110, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 46, 13, 10]
[2024-10-21T08:30:13Z DEBUG suppaftp::sync_ftp] Login OK
OK
>> cwd /00CM
[2024-10-21T08:30:38Z DEBUG suppaftp::sync_ftp] Changing working directory to /00CM
[2024-10-21T08:30:38Z TRACE suppaftp::sync_ftp] CC OUT: CWD /00CM
[2024-10-21T08:30:38Z TRACE suppaftp::sync_ftp] CC IN: [50, 53, 48, 32, 68, 105, 114, 101, 99, 116, 111, 114, 121, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 108, 121, 32, 99, 104, 97, 110, 103, 101, 100, 46, 13, 10]
[2024-10-21T08:30:38Z TRACE suppaftp::sync_ftp] Code parsed from response: requested file action okay (250)
[2024-10-21T08:30:38Z TRACE suppaftp::sync_ftp] CC IN: [50, 53, 48, 32, 68, 105, 114, 101, 99, 116, 111, 114, 121, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 108, 121, 32, 99, 104, 97, 110, 103, 101, 100, 46, 13, 10]
OK
>> list
[2024-10-21T08:30:41Z DEBUG suppaftp::sync_ftp] Reading working directory content
[2024-10-21T08:30:41Z DEBUG suppaftp::sync_ftp] PASV command
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] CC OUT: PASV
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] CC IN: [50, 50, 55, 32, 69, 110, 116, 101, 114, 105, 110, 103, 32, 80, 97, 115, 115, 105, 118, 101, 32, 77, 111, 100, 101, 32, 40, 53, 56, 44, 50, 52, 55, 44, 57, 50, 44, 49, 50, 50, 44, 49, 52, 54, 44, 50, 51, 57, 41, 46, 13, 10]
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] Code parsed from response: entering passive mode (227)
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] CC IN: [50, 50, 55, 32, 69, 110, 116, 101, 114, 105, 110, 103, 32, 80, 97, 115, 115, 105, 118, 101, 32, 77, 111, 100, 101, 32, 40, 53, 56, 44, 50, 52, 55, 44, 57, 50, 44, 49, 50, 50, 44, 49, 52, 54, 44, 50, 51, 57, 41, 46, 13, 10]
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] Passive address: 
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] CC OUT: LIST
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] CC IN: [49, 53, 48, 32, 72, 101, 114, 101, 32, 99, 111, 109, 101, 115, 32, 116, 104, 101, 32, 100, 105, 114, 101, 99, 116, 111, 114, 121, 32, 108, 105, 115, 116, 105, 110, 103, 46, 13, 10]
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] Code parsed from response: file status okay, about to open data connection (150)
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] CC IN: [49, 53, 48, 32, 72, 101, 114, 101, 32, 99, 111, 109, 101, 115, 32, 116, 104, 101, 32, 100, 105, 114, 101, 99, 116, 111, 114, 121, 32, 108, 105, 115, 116, 105, 110, 103, 46, 13, 10]
[2024-10-21T08:30:41Z DEBUG suppaftp::sync_ftp] Finalizing retr stream
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] dropped stream
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] CC IN: [50, 50, 54, 32, 68, 105, 114, 101, 99, 116, 111, 114, 121, 32, 115, 101, 110, 100, 32, 79, 75, 46, 13, 10]
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] Code parsed from response: closing data connection (226)
[2024-10-21T08:30:41Z TRACE suppaftp::sync_ftp] CC IN: [50, 50, 54, 32, 68, 105, 114, 101, 99, 116, 111, 114, 121, 32, 115, 101, 110, 100, 32, 79, 75, 46, 13, 10]
LIST error: Response contains an invalid syntax

scum833 avatar Oct 21 '24 08:10 scum833

Amazing, I will check it and come back with the solution (I hope)

veeso avatar Oct 21 '24 18:10 veeso

I eventually forgot to debug this, sorry.

@archwizmgm It seems to be an issue with reading the stream, maybe firewall? But yeah, it receives nothing from the stream. Now In the latest version of suppaftp I've added logs to debug the stream error (which was missing :/) and the incoming data. So if you still have the test environment and you don't mind to test it, you can submit the logs using the new version

veeso avatar Mar 17 '25 09:03 veeso

@veeso I found the error might be caused by a folder under /00CM, which has a strange name. I tried decoding these characters but didn't get any thing. I doubt the error with suppaftp is also caused by this folder, as Xftp is unable to handle it either.

Image

And There is the new log.

[2025-03-24T01:53:53Z DEBUG suppaftp::sync_ftp] Signin in with user ''
[2025-03-24T01:53:53Z TRACE suppaftp::sync_ftp] CC OUT: USER 
[2025-03-24T01:53:53Z TRACE suppaftp::sync_ftp] CC IN: [51, 51, 49, 32, 80, 108, 101, 97, 115, 101, 32, 115, 112, 101, 99, 105, 102, 121, 32, 116, 104, 101, 32, 112, 97, 115, 115, 119, 111, 114, 100, 46, 13, 10]
[2025-03-24T01:53:53Z TRACE suppaftp::sync_ftp] Code parsed from response: user name okay, need password (331)
[2025-03-24T01:53:53Z TRACE suppaftp::sync_ftp] CC IN: [51, 51, 49, 32, 80, 108, 101, 97, 115, 101, 32, 115, 112, 101, 99, 105, 102, 121, 32, 116, 104, 101, 32, 112, 97, 115, 115, 119, 111, 114, 100, 46, 13, 10]
[2025-03-24T01:53:53Z DEBUG suppaftp::sync_ftp] Password is required
[2025-03-24T01:53:53Z TRACE suppaftp::sync_ftp] CC OUT: PASS
[2025-03-24T01:53:54Z TRACE suppaftp::sync_ftp] CC IN: [50, 51, 48, 32, 76, 111, 103, 105, 110, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 46, 13, 10]
[2025-03-24T01:53:54Z TRACE suppaftp::sync_ftp] Code parsed from response: user logged in, proceed. Logged out if appropriate. (230)
[2025-03-24T01:53:54Z TRACE suppaftp::sync_ftp] CC IN: [50, 51, 48, 32, 76, 111, 103, 105, 110, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 46, 13, 10]
[2025-03-24T01:53:54Z DEBUG suppaftp::sync_ftp] Login OK
OK
>> CWD /00CM
[2025-03-24T01:54:09Z DEBUG suppaftp::sync_ftp] Changing working directory to /00CM
[2025-03-24T01:54:09Z TRACE suppaftp::sync_ftp] CC OUT: CWD /00CM
[2025-03-24T01:54:09Z TRACE suppaftp::sync_ftp] CC IN: [50, 53, 48, 32, 68, 105, 114, 101, 99, 116, 111, 114, 121, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 108, 121, 32, 99, 104, 97, 110, 103, 101, 100, 46, 13, 10]
[2025-03-24T01:54:09Z TRACE suppaftp::sync_ftp] Code parsed from response: requested file action okay (250)
[2025-03-24T01:54:09Z TRACE suppaftp::sync_ftp] CC IN: [50, 53, 48, 32, 68, 105, 114, 101, 99, 116, 111, 114, 121, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 108, 121, 32, 99, 104, 97, 110, 103, 101, 100, 46, 13, 10]
OK
>> LIST
[2025-03-24T01:54:14Z DEBUG suppaftp::sync_ftp] Reading working directory content
[2025-03-24T01:54:14Z DEBUG suppaftp::sync_ftp] PASV command
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] CC OUT: PASV
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] CC IN: [50, 50, 55, 32, 69, 110, 116, 101, 114, 105, 110, 103, 32, 80, 97, 115, 115, 105, 118, 101, 32, 77, 111, 100, 101, 32, 40, 53, 56, 44, 50, 52, 55, 44, 57, 50, 44, 49, 50, 50, 44, 54, 54, 44, 51, 53, 41, 46, 13, 10]
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] Code parsed from response: entering passive mode (227)
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] CC IN: [50, 50, 55, 32, 69, 110, 116, 101, 114, 105, 110, 103, 32, 80, 97, 115, 115, 105, 118, 101, 32, 77, 111, 100, 101, 32, 40, 53, 56, 44, 50, 52, 55, 44, 57, 50, 44, 49, 50, 50, 44, 54, 54, 44, 51, 53, 41, 46, 13, 10]
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] PASV response: 227 Entering Passive Mode (58,247,92,122,66,35).
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] Passive address: 58.247.92.122:16931
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] CC OUT: LIST
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] CC IN: [49, 53, 48, 32, 72, 101, 114, 101, 32, 99, 111, 109, 101, 115, 32, 116, 104, 101, 32, 100, 105, 114, 101, 99, 116, 111, 114, 121, 32, 108, 105, 115, 116, 105, 110, 103, 46, 13, 10]
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] Code parsed from response: file status okay, about to open data connection (150)
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] CC IN: [49, 53, 48, 32, 72, 101, 114, 101, 32, 99, 111, 109, 101, 115, 32, 116, 104, 101, 32, 100, 105, 114, 101, 99, 116, 111, 114, 121, 32, 108, 105, 115, 116, 105, 110, 103, 46, 13, 10]
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "-rw-rw-r--    1 1002     1001           74 Jan 07 13:45 2.txt\r\n"
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "drwxrwxr-x    2 1004     1001           25 Sep 15  2023 20230915_a5e60500\r\n"
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "drwxrwxr-x    2 1004     1001           25 Sep 19  2023 20230919_0bdd0c89\r\n"
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "drwxrwxr-x    2 1004     1001           93 Sep 26  2023 20230926_1e763193\r\n"
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "drwxrwxr-x    2 1004     1001           54 Nov 02  2023 20231102_019cc418\r\n"
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "drwxrwxr-x    2 1004     1001            6 Nov 10  2023 20231110_2a46399d\r\n"
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "drwxrwxr-x    2 1004     1001           87 May 08  2024 20240508_ca914554\r\n"
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "drwxrwxr-x    2 1004     1001           57 Aug 29  2024 20240829_4a6c9e2f\r\n"
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "drwxrwxr-x    2 1004     1001           69 Sep 02  2024 20240902_a9904da1\r\n"
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "drwxrwxr-x    2 1004     1001           69 Sep 02  2024 20240902_c0ed7c91\r\n"
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "drwxrwxr-x    2 1004     1001           57 Oct 08 13:44 20241008_cdb838e6\r\n"
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] STREAM IN: "drwxrwxr-x    2 1004     1001           57 Oct 09 16:38 20241009_77cecbf7\r\n"
[2025-03-24T01:54:14Z ERROR suppaftp::sync_ftp] failed to get lines from stream: stream did not contain valid UTF-8
[2025-03-24T01:54:14Z DEBUG suppaftp::sync_ftp] Finalizing retr stream
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] dropped stream
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] CC IN: [50, 50, 54, 32, 68, 105, 114, 101, 99, 116, 111, 114, 121, 32, 115, 101, 110, 100, 32, 79, 75, 46, 13, 10]
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] Code parsed from response: closing data connection (226)
[2025-03-24T01:54:14Z TRACE suppaftp::sync_ftp] CC IN: [50, 50, 54, 32, 68, 105, 114, 101, 99, 116, 111, 114, 121, 32, 115, 101, 110, 100, 32, 79, 75, 46, 13, 10]
LIST error: Response contains an invalid syntax

I hope suppaftp can ignore this kind of error, as it prevents access to the entire folder (/00CM).

scum833 avatar Mar 24 '25 02:03 scum833

This has been fixed in suppaftp 6.2.1, so it will fix termscp in cascade on the next termscp releasae.

veeso avatar May 13 '25 11:05 veeso