FTP active mode 425 Can't build data connection: Connection refused. An error has occurred

Advertisement

tyamamoto
Joined:
Posts:
2

FTP active mode 425 Can't build data connection: Connection refused. An error has occurred

hello.

I am using WinSCP Ver 6.1.1 in FTP active mode.

Because NAT GATEWAY is used,
Set EXTERNAL IP ADDRESS,
I am trying to make sure that PORT is sent.
When you retrieve a file with GET,
If the same PORT NUMBER is used within the same connection,
425 Can't build data connection: Connection refused. An error has occurred.
After an error, Retry is automatically executed.
Since the file is retrieved, there is no operational problem.
You will receive a notification that an error has occurred on the other server, so
This is an issue.

Is there any way to avoid the error (avoid using the same PORT within the same connection)?
. 2023-09-22 15:00:01.250 Cached directory change via "/TESTN001/SY0S/" to "/TESTN001/SY0S".
. 2023-09-22 15:00:01.250 Getting current directory name.
< 2023-09-22 15:00:01.250 Script: /TESTN001/SY0S
> 2023-09-22 15:00:01.265 Script: MGET SY0S_*.DAT
. 2023-09-22 15:00:01.265 ディレクトリ一覧を取得中...
> 2023-09-22 15:00:01.265 CWD /TESTN001/SY0S
< 2023-09-22 15:00:01.349 250 CWD command successful.
> 2023-09-22 15:00:01.349 PWD
< 2023-09-22 15:00:01.365 257 "/TESTN001/SY0S" is current directory.
> 2023-09-22 15:00:01.365 TYPE A
< 2023-09-22 15:00:01.381 200 Type set to A.
> 2023-09-22 15:00:01.381 PORT XXX,XXX,XXX,XXX,248,215
< 2023-09-22 15:00:01.391 200 PORT command successful.
> 2023-09-22 15:00:01.391 LIST -a
< 2023-09-22 15:00:01.407 150 Opening ASCII mode data connection for file list.
. 2023-09-22 15:00:01.480 drwx------  1 TESTNS00 TESTNS00       4096 Sep 22 13:00 .
. 2023-09-22 15:00:01.525 drwx------  1 TESTNS00 TESTNS00       4096 Sep 22 13:00 ..
. 2023-09-22 15:00:01.525 -r--r-----  1 TESTNS00 TESTNS00       2580 Sep 22 14:34 SY0S_20230922143424.DAT
< 2023-09-22 15:00:02.467 226 Transfer complete.
. 2023-09-22 15:00:02.467 Data connection closed
. 2023-09-22 15:00:02.482 ディレクトリ一覧の取得が成功しました
. 2023-09-22 15:00:02.482 ..;D;0;1899-12-30T09:00:00.000Z;0;"" [0];"" [0];---------;0
. 2023-09-22 15:00:02.482 SY0S_20230922143424.DAT;-;2580;2023-09-22T05:34:00.000Z;1;"TESTNS00" [0];"TESTNS00" [0];r--r-----;0
. 2023-09-22 15:00:02.482 Copying 1 files/directories to local directory "C:\WORK\FTP\LocalUser\ac77" - total size: 2,580
. 2023-09-22 15:00:02.482   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask: 
. 2023-09-22 15:00:02.482   TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; EncryptNewFiles: Yes; ExcludeHiddenFiles: No; ExcludeEmptyDirectories: No; InclM: ; ResumeL: 0
. 2023-09-22 15:00:02.482   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2023-09-22 15:00:02.482 File: '/TESTN001/SY0S/SY0S_20230922143424.DAT' [2023-09-22T05:34:00.000Z] [2580]
. 2023-09-22 15:00:02.482 Copying "/TESTN001/SY0S/SY0S_20230922143424.DAT" to local directory started.
. 2023-09-22 15:00:02.482 Binary transfer mode selected.
. 2023-09-22 15:00:02.482 /TESTN001/SY0S/SY0S_20230922143424.DAT のダウンロードを開始しています。
> 2023-09-22 15:00:02.482 TYPE I
< 2023-09-22 15:00:02.492 200 Type set to I.
> 2023-09-22 15:00:02.492 PORT XXX,XXX,XXX,XXX,248,215
< 2023-09-22 15:00:02.492 200 PORT command successful.
> 2023-09-22 15:00:02.492 RETR SY0S_20230922143424.DAT
< 2023-09-22 15:00:03.086 425 Can't build data connection: Connection refused.
. 2023-09-22 15:00:03.086 リモートからのファイルのコピーに失敗。
. 2023-09-22 15:00:03.086 Got 425 after some previous data connections succeeded, retrying connection
. 2023-09-22 15:00:03.086 Connection was lost, asking what to do.
. 2023-09-22 15:00:03.086 Asking user:
. 2023-09-22 15:00:03.086 **リモートからのファイルのコピーに失敗。** ("Can't build data connection: Connection refused.")
< 2023-09-22 15:00:03.086 Script: リモートからのファイルのコピーに失敗。
< 2023-09-22 15:00:03.086 Script: Can't build data connection: Connection refused.
. 2023-09-22 15:00:09.102 Answer: Retry
< 2023-09-22 15:00:09.103 Script: サーバから切断されました。
. 2023-09-22 15:00:09.103 サーバから切断されました。

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,852
Location:
Prague, Czechia

Re: FTP active mode 425 Can't build data connection: Connection refused. An error has occurred

Do you mean that there is some problem with WinSCP listening twice on the same active mode port (63703 in this specific case)? Why? Why do you even use the active mode?

Reply with quote

tyamamoto
Joined:
Posts:
2

Active Mode is used because the FTP data exchange service on the communication partner only supports Active Mode.
The other party's FTP service may not have closed the data connection that uses the same PORT NO.
However, since there are many users besides me, it seems difficult to change from Active Mode to Passive Mode or prevent errors from occurring if the same PORT No. is used on the other side.

Reply with quote

Advertisement

You can post new topics in this forum