Skip to content

MULTI state machine error in FTP STOR #17394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JoelAtWisetech opened this issue May 20, 2025 · 8 comments
Closed

MULTI state machine error in FTP STOR #17394

JoelAtWisetech opened this issue May 20, 2025 · 8 comments
Assignees

Comments

@JoelAtWisetech
Copy link

JoelAtWisetech commented May 20, 2025

I did this

Implemented a FTP client using TLS uploads. The ftp_do_more() does not properly handle the case where it goes out of upload with the completion set, BUT the wait_data_conn has been reassigned to TRUE in the processing. It leaves the DO_MORE state and terminates the upload.

My workaround for this problem is as follows; it may or may not be correct depending on my limited understanding on the internal state machines.

 --- orig/curl-8.13.0/lib/ftp.c  2025-04-02 07:47:41.000000000 +0200
 +++ curl-8.13.0/lib/ftp.c       2025-05-20 09:15:35.981767300 +0200
 @@ -3643,7 +3643,9 @@
          return result;
 
        result = ftp_multi_statemach(data, &complete);
 -      *completep = (int)complete;
 +      if (!ftpc->wait_data_conn) {
 +          *completep = (int)complete;
 +      }
      }
      else {
        /* download */

I expected the following

The UPLOAD should complete successfully regardless the way the client takes through the state machine,

curl/libcurl version

curl 8.13.0

operating system

Windows 10

@icing
Copy link
Contributor

icing commented May 20, 2025

This looks like the right way to fix it. Although, I am not the expert on the FTP state machine either.

@bagder bagder added the FTP label May 20, 2025
@bagder
Copy link
Member

bagder commented May 20, 2025

Any chance you can provide a detailed log showing what happens when it does not work, i.e without this patch?

It looks to me that the FTP state machine gets "stuck" somewhere before this point that looks like it could be the real problem that this suggested fix mostly "paints over". But I would like more info first before I can tell for sure.

@JoelAtWisetech
Copy link
Author

JoelAtWisetech commented May 22, 2025

== LOG :info app.proto.transfer</FTP/C/FTP Client.global.tx.30891> initializing message upload -- filename: 30891 bytes: 561
== INFO:[93-0] [MULTI] [COMPLETED] -> [INIT] (line 384)
== INFO:[94-0] [MULTI] [INIT] added, transfers=1
== INFO:[94-0] [MULTI] [INIT] -> [SETUP] (line 2252)
== INFO:[94-0] [MULTI] [SETUP] -> [CONNECT] (line 2268)
== INFO:[94-0] [READ] client_reset, clear readers
== INFO:[94-0] [FTP] [STOP] setup connection -> 0
== INFO:[94-0] [TCP] is_alive: poll timeout, assume alive
== INFO:[94-0] Re-using existing ftp: connection with host JOEL-W72
== INFO:[94-0] [MULTI] [CONNECT] -> [CONNECTING] (line 2183)
== INFO:[94-0] [MULTI] [CONNECTING] -> [PROTOCONNECT] (line 2306)
== INFO:[94-0] [MULTI] [PROTOCONNECT] -> [DO] (line 2323)
== INFO:[94-0] Request has same path as previous transfer
== INFO:[94-0] [FTP] [STOP] DO phase starts
== INFO:[94-0] Hostname 192.168.56.1 was found in DNS cache
== INFO:[94-0] [FTP] [STOP] ftp_state_use_port(), opened socket
== INFO:[94-0] [FTP] [STOP] ftp_state_use_port(), socket bound to port 0
== INFO:[94-0] [FTP] [STOP] ftp_state_use_port(), listening on 0
== INFO:[94-0] [TCP] send(len=58) -> 58, err=0
== INFO:[94-0] [SSL] ossl_bio_cf_out_write(len=58) -> 58, err=0
=> SEND:[94-0] EPRT |1|192.168.56.1|49139|
== INFO:[94-0] [FTP] [STOP] -> [PORT] (line 1207)
== INFO:[94-0] [TCP-ACCEPT-1] added
== INFO:[94-0] [TCP-ACCEPT-1] set filter for listen socket fd=1948 ip=192.168.56.1:49139
== INFO:[94-0] [SSL-1] added
== INFO:[94-0] pp_statematch, timeout=90000
== INFO:[94-0] [FTP] [PORT] perform, awaiting DATA connect
== INFO:[94-0] [MULTI] [DO] -> [DOING] (line 1933)
== INFO:[94-0] pp_statematch, timeout=90000
== INFO:[94-0] [TCP] recv(len=5) -> 5, err=0
== INFO:[94-0] [SSL] ossl_bio_cf_in_read(len=5) -> 5, err=0
== INFO:[94-0] [TCP] recv(len=54) -> 54, err=0
== INFO:[94-0] [SSL] ossl_bio_cf_in_read(len=54) -> 54, err=0
== INFO:[94-0] [SSL] cf_recv(len=900) -> 30, 0
<= RECV:[94-0] 200 PORT command successful.
== INFO:[94-0] [WRITE] [OUT] wrote 30 header bytes -> 30
== INFO:[94-0] [WRITE] [PAUSE] writing 30/30 bytes of type 2 -> 0
== INFO:[94-0] [WRITE] download_write header(type=2, blen=30) -> 0
== INFO:[94-0] [WRITE] client_write(type=2, len=30) -> 0
== INFO:[94-0] Connect data stream actively
== INFO:[94-0] [FTP] [PORT] -> [STOP] (line 1996)
== INFO:[94-0] [FTP] [STOP] DO phase is complete2
== INFO:[94-0] [MULTI] [DOING] -> [DOING_MORE] (line 2375)
== INFO:[94-0] [TCP-ACCEPT-1] Checking for incoming on fd=1948 ip=192.168.56.1:49139
== INFO:[94-0] [TCP-ACCEPT-1] socket_check -> 0
== INFO:[94-0] [TCP-ACCEPT-1] nothing heard from the server yet
== INFO:[94-0] [SSL-1] Curl_conn_connect(block=0) -> 0, done=0
== INFO:[94-0] [FTP] [STOP] -> [STOR_TYPE] (line 3516)
== INFO:[94-0] [TCP] send(len=41) -> 41, err=0
== INFO:[94-0] [SSL] ossl_bio_cf_out_write(len=41) -> 41, err=0
=> SEND:[94-0] STOR 30891
== INFO:[94-0] [FTP] [STOR_TYPE] -> [STOR] (line 1600)
== INFO:[94-0] pp_statematch, timeout=90000
== INFO:[94-0] [TCP] recv(len=5) -> 5, err=0
== INFO:[94-0] [SSL] ossl_bio_cf_in_read(len=5) -> 5, err=0
== INFO:[94-0] [TCP] recv(len=75) -> 75, err=0
== INFO:[94-0] [SSL] ossl_bio_cf_in_read(len=75) -> 75, err=0
== INFO:[94-0] [SSL] cf_recv(len=900) -> 51, 0
<= RECV:[94-0] 150 Opening ASCII mode data connection for 30891.
== INFO:[94-0] [WRITE] [OUT] wrote 51 header bytes -> 51
== INFO:[94-0] [WRITE] [PAUSE] writing 51/51 bytes of type 2 -> 0
== INFO:[94-0] [WRITE] download_write header(type=2, blen=51) -> 0
== INFO:[94-0] [WRITE] client_write(type=2, len=51) -> 0
== INFO:[94-0] [FTP] [STOR] -> [STOP] (line 2404)
== INFO:[94-0] [TCP-ACCEPT-1] Checking for incoming on fd=1948 ip=192.168.56.1:49139
== INFO:[94-0] [TCP-ACCEPT-1] socket_check -> 0
== INFO:[94-0] [TCP-ACCEPT-1] nothing heard from the server yet
== INFO:[94-0] [SSL-1] Curl_conn_connect(block=0) -> 0, done=0
== INFO:[94-0] Data conn was not available immediately
== INFO:[94-0] [MULTI] [DOING_MORE] -> [DID] (line 2399)
== INFO:[94-0] [MULTI] [DID] -> [PERFORMING] (line 2423)
== INFO:[94-0] [MULTI] [PERFORMING] -> [DONE] (line 1856)
== INFO:[94-0] [MULTI] [DONE] multi_done: status: 0 prem: 0 done: 0
== INFO:[94-0] Remembering we are in dir ""
== INFO:[94-0] [FTP] [STOP] closing DATA connection
== INFO:[94-0] [TCP-ACCEPT-1] cf_socket_close, fd=1948
== INFO:[94-0] [MULTI] [DONE] Curl_multi_will_close fd=1948
== INFO:[94-0] [TCP-ACCEPT-1] destroy
== INFO:Uploaded unaligned file size (0 out of 561 bytes)
== INFO:[94-0] [FTP] [STOP] done, result=18
== INFO:[94-0] [WRITE] [OUT] done
== INFO:[94-0] Connection #0 to host JOEL-W72 left intact
== INFO:[94-0] [MULTI] [DONE] -> [COMPLETED] (line 2471)
== INFO:[94-0] [MULTI] [COMPLETED] Expire cleared
== INFO:[94-0] [MULTI] [COMPLETED] -> [MSGSENT] (line 2566)
== INFO:[94-0] [MULTI] [COMPLETED] removed, transfers=0
== LOG :error app.proto.transfer</FTP/C/FTP Client.global.tx.30891> unable to transfer file 30891: Uploaded unaligned file size (0 out of 561 bytes) (curl: Transferred a partial file)

@JoelAtWisetech
Copy link
Author

This transfer failed; we fell out of DOING_MORE to DID. It seems its dependent on how we fall out of "DO" whether or not it works or not.

@JoelAtWisetech
Copy link
Author

JoelAtWisetech commented May 22, 2025

== LOG :info app.proto.transfer</FTP/C/FTP Client.global.tx.30881> initializing message upload -- filename: 30881 bytes: 561
== INFO:[92-0] [MULTI] [COMPLETED] -> [INIT] (line 384)
== INFO:[93-0] [MULTI] [INIT] added, transfers=1
== INFO:[93-0] [MULTI] [INIT] -> [SETUP] (line 2252)
== INFO:[93-0] [MULTI] [SETUP] -> [CONNECT] (line 2268)
== INFO:[93-0] [READ] client_reset, clear readers
== INFO:[93-0] [FTP] [STOP] setup connection -> 0
== INFO:[93-0] [TCP] is_alive: poll timeout, assume alive
== INFO:[93-0] Re-using existing ftp: connection with host JOEL-W72
== INFO:[93-0] [MULTI] [CONNECT] -> [CONNECTING] (line 2183)
== INFO:[93-0] [MULTI] [CONNECTING] -> [PROTOCONNECT] (line 2306)
== INFO:[93-0] [MULTI] [PROTOCONNECT] -> [DO] (line 2323)
== INFO:[93-0] Request has same path as previous transfer
== INFO:[93-0] [FTP] [STOP] DO phase starts
== INFO:[93-0] Hostname 192.168.56.1 was found in DNS cache
== INFO:[93-0] [FTP] [STOP] ftp_state_use_port(), opened socket
== INFO:[93-0] [FTP] [STOP] ftp_state_use_port(), socket bound to port 0
== INFO:[93-0] [FTP] [STOP] ftp_state_use_port(), listening on 0
== INFO:[93-0] [TCP] send(len=58) -> 58, err=0
== INFO:[93-0] [SSL] ossl_bio_cf_out_write(len=58) -> 58, err=0
=> SEND:[93-0] EPRT |1|192.168.56.1|49138|
== INFO:[93-0] [FTP] [STOP] -> [PORT] (line 1207)
== INFO:[93-0] [TCP-ACCEPT-1] added
== INFO:[93-0] [TCP-ACCEPT-1] set filter for listen socket fd=1900 ip=192.168.56.1:49138
== INFO:[93-0] [SSL-1] added
== INFO:[93-0] pp_statematch, timeout=90000
== INFO:[93-0] [FTP] [PORT] perform, awaiting DATA connect
== INFO:[93-0] [MULTI] [DO] -> [DOING] (line 1933)
== INFO:[93-0] pp_statematch, timeout=90000
== INFO:[93-0] [TCP-ACCEPT-1] adjust_pollset, listening, POLLIN fd=1900
== INFO:[93-0] [MULTI] [DOING] ev assess pollset[fd=1604 IN, fd=1900 IN], timeouts=2
== INFO:[93-0] [MULTI] [DOING] ev new entry fd=1604
== INFO:[93-0] [MULTI] [DOING] ev entry fd=1604, added transfer #101, total=1/0 (xfer/conn)
== INFO:[93-0] [MULTI] [DOING] ev update fd=1604, action '' -> 'IN' (1/0 r/w)
== INFO:[93-0] [MULTI] [DOING] ev update call(fd=1604, ev=IN)
== INFO:[93-0] [MULTI] [DOING] ev new entry fd=1900
== INFO:[93-0] [MULTI] [DOING] ev entry fd=1900, added transfer #101, total=1/0 (xfer/conn)
== INFO:[93-0] [MULTI] [DOING] ev update fd=1900, action '' -> 'IN' (1/0 r/w)
== INFO:[93-0] [MULTI] [DOING] ev update call(fd=1900, ev=IN)
== INFO:[93-0] pp_statematch, timeout=89996
== INFO:[93-0] [TCP] recv(len=5) -> 5, err=0
== INFO:[93-0] [SSL] ossl_bio_cf_in_read(len=5) -> 5, err=0
== INFO:[93-0] [TCP] recv(len=54) -> 54, err=0
== INFO:[93-0] [SSL] ossl_bio_cf_in_read(len=54) -> 54, err=0
== INFO:[93-0] [SSL] cf_recv(len=900) -> 30, 0
<= RECV:[93-0] 200 PORT command successful.
== INFO:[93-0] [WRITE] [OUT] wrote 30 header bytes -> 30
== INFO:[93-0] [WRITE] [PAUSE] writing 30/30 bytes of type 2 -> 0
== INFO:[93-0] [WRITE] download_write header(type=2, blen=30) -> 0
== INFO:[93-0] [WRITE] client_write(type=2, len=30) -> 0
== INFO:[93-0] Connect data stream actively
== INFO:[93-0] [FTP] [PORT] -> [STOP] (line 1996)
== INFO:[93-0] [FTP] [STOP] DO phase is complete2
== INFO:[93-0] [MULTI] [DOING] -> [DOING_MORE] (line 2375)
== INFO:[93-0] [TCP-ACCEPT-1] Checking for incoming on fd=1900 ip=192.168.56.1:49138
== INFO:[93-0] [TCP-ACCEPT-1] socket_check -> 0
== INFO:[93-0] [TCP-ACCEPT-1] nothing heard from the server yet
== INFO:[93-0] [SSL-1] Curl_conn_connect(block=0) -> 0, done=0
== INFO:[93-0] [FTP] [STOP] -> [STOR_TYPE] (line 3516)
== INFO:[93-0] [TCP] send(len=41) -> 41, err=0
== INFO:[93-0] [SSL] ossl_bio_cf_out_write(len=41) -> 41, err=0
=> SEND:[93-0] STOR 30881
== INFO:[93-0] [FTP] [STOR_TYPE] -> [STOR] (line 1600)
== INFO:[93-0] pp_statematch, timeout=90000
== INFO:[93-0] [FTP] [STOR] ftp_domore_getsock()
== INFO:[93-0] [TCP-ACCEPT-1] adjust_pollset, listening, POLLIN fd=1900
== INFO:[93-0] [MULTI] [DOING_MORE] ev assess pollset[fd=1604 IN, fd=1900 IN], timeouts=2
== INFO:[93-0] [TCP-ACCEPT-1] Checking for incoming on fd=1900 ip=192.168.56.1:49138
== INFO:[93-0] [TCP-ACCEPT-1] socket_check -> 1
== INFO:[93-0] Ready to accept data connection from server
== INFO:[93-0] Connection accepted from server
== INFO:[93-0] [MULTI] [DOING_MORE] Curl_multi_will_close fd=1900
== INFO:[93-0] [MULTI] [DOING_MORE] ev socket done, call(fd=1900, ev=REMOVE)
== INFO:[93-0] [TCP-ACCEPT-1] accepted_set(sock=1804, remote=192.168.56.1 port=20)
== INFO:[93-0] [SSL-1] cf_connect()
== INFO:[93-0] [SSL-1] ossl_connect, step1
== INFO:[93-0] [SSLS] find peer slot for JOEL-W72:21:NO-VRFY-PEER:NO-VRFY-HOST:CCERT:IMPL-OpenSSL/3.0.9:G among 25 slots
== INFO:[93-0] [SSLS] took session for JOEL-W72:21:NO-VRFY-PEER:NO-VRFY-HOST:CCERT:IMPL-OpenSSL/3.0.9:G [proto=0x303, alpn=(nil), earlydata=0, quic_tp=no], 0 sessions remain
== INFO:[93-0] SSL reusing session with ALPN '-'
== INFO:[93-0] [SSLS] find peer slot for JOEL-W72:21:NO-VRFY-PEER:NO-VRFY-HOST:CCERT:IMPL-OpenSSL/3.0.9:G among 25 slots
== INFO:[93-0] [SSLS] added session for JOEL-W72:21:NO-VRFY-PEER:NO-VRFY-HOST:CCERT:IMPL-OpenSSL/3.0.9:G [proto=0x303, valid_secs=7178, alpn=(nil), earlydata=0, quic_tp=no], peer has 1 sessions now
== INFO:[93-0] [SSL-1] ossl_connect, step2
== LOG :notify app.network.secure</FTP/C/FTP Client.global.tx.30881> handshake: handshake start := before SSL initialization
== INFO:[93-0] [TCP-ACCEPT-1] send(len=1721) -> 1721, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_out_write(len=1721) -> 1721, err=0
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=5) -> -1, err=81
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=5) -> -1, err=81
== INFO:[93-0] [SSL-1] ossl_populate_x509_store, path=none, blob=0
== INFO:[93-0] [SSL-1] SSL_connect() -> err=-1, detail=2
== INFO:[93-0] [SSL-1] SSL_connect() -> want recv
== INFO:[93-0] [SSL-1] cf_connect() -> 0, done=0
== INFO:[93-0] [SSL-1] Curl_conn_connect(block=0) -> 0, done=0
== INFO:[93-0] pp_statematch, timeout=89997
== INFO:[93-0] [TCP] recv(len=5) -> 5, err=0
== INFO:[93-0] [SSL] ossl_bio_cf_in_read(len=5) -> 5, err=0
== INFO:[93-0] [TCP] recv(len=75) -> 75, err=0
== INFO:[93-0] [SSL] ossl_bio_cf_in_read(len=75) -> 75, err=0
== INFO:[93-0] [SSL] cf_recv(len=900) -> 51, 0
<= RECV:[93-0] 150 Opening ASCII mode data connection for 30881.
== INFO:[93-0] [WRITE] [OUT] wrote 51 header bytes -> 51
== INFO:[93-0] [WRITE] [PAUSE] writing 51/51 bytes of type 2 -> 0
== INFO:[93-0] [WRITE] download_write header(type=2, blen=51) -> 0
== INFO:[93-0] [WRITE] client_write(type=2, len=51) -> 0
== INFO:[93-0] [FTP] [STOR] -> [STOP] (line 2404)
== INFO:[93-0] [SSL-1] cf_connect()
== INFO:[93-0] [SSL-1] ossl_connect, step2
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=5) -> -1, err=81
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=5) -> -1, err=81
== INFO:[93-0] [SSL-1] SSL_connect() -> err=-1, detail=2
== INFO:[93-0] [SSL-1] SSL_connect() -> want recv
== INFO:[93-0] [SSL-1] cf_connect() -> 0, done=0
== INFO:[93-0] [SSL-1] Curl_conn_connect(block=0) -> 0, done=0
== INFO:[93-0] Data conn was not available immediately
== INFO:[93-0] [SSL-1] cf_connect()
== INFO:[93-0] [SSL-1] ossl_connect, step2
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=5) -> -1, err=81
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=5) -> -1, err=81
== INFO:[93-0] [SSL-1] SSL_connect() -> err=-1, detail=2
== INFO:[93-0] [SSL-1] SSL_connect() -> want recv
== INFO:[93-0] [SSL-1] cf_connect() -> 0, done=0
== INFO:[93-0] [SSL-1] Curl_conn_connect(block=0) -> 0, done=0
== INFO:[93-0] [FTP] [STOP] ftp_domore_getsock()
== INFO:[93-0] [SSL-1] adjust_pollset, POLLIN fd=1804
== INFO:[93-0] [MULTI] [DOING_MORE] ev assess pollset[fd=1604 IN, fd=1804 IN], timeouts=2
== INFO:[93-0] [MULTI] [DOING_MORE] ev new entry fd=1804
== INFO:[93-0] [MULTI] [DOING_MORE] ev entry fd=1804, added transfer #101, total=1/0 (xfer/conn)
== INFO:[93-0] [MULTI] [DOING_MORE] ev update fd=1804, action '' -> 'IN' (1/0 r/w)
== INFO:[93-0] [MULTI] [DOING_MORE] ev update call(fd=1804, ev=IN)
== INFO:[93-0] [SSL-1] cf_connect()
== INFO:[93-0] [SSL-1] ossl_connect, step2
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=5) -> 5, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=5) -> 5, err=0
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=85) -> 85, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=85) -> 85, err=0
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=5) -> 5, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=5) -> 5, err=0
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=1) -> 1, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=1) -> 1, err=0
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=5) -> 5, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=5) -> 5, err=0
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=40) -> 40, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=40) -> 40, err=0
== INFO:[93-0] [TCP-ACCEPT-1] send(len=51) -> 51, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_out_write(len=51) -> 51, err=0
== LOG :notify app.network.secure</FTP/C/FTP Client.global.tx.30881> handshake: handshake done := SSL negotiation finished successfully
== INFO:[93-0] SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384 / X25519 / UNDEF
== INFO:[93-0] [SSL-1] ossl_connect, step3
== INFO:[93-0] [SSL-1] ossl_connect, done
== INFO:[93-0] [SSL-1] cf_connect() -> 0, done=1
== INFO:[93-0] [SSL-1] Curl_conn_connect(block=0) -> 0, done=1
== INFO:[93-0] Connected 2nd connection to 192.168.56.1 port 20
== INFO:[93-0] [FTP] InitiateTransfer()
== INFO:[93-0] [MULTI] [DOING_MORE] -> [DID] (line 2399)
== INFO:[93-0] [MULTI] [DID] -> [PERFORMING] (line 2423)
== INFO:[93-0] [READ] add fread reader, len=561 -> 0
== INFO:[93-0] [READ] cr_in_read(len=561, total=561, read=561) -> 0, nread=561, eos=1
== INFO:[93-0] [READ] client_read(len=65536) -> 0, nread=561, eos=1
== INFO:[93-0] sending last upload chunk of 561 bytes
== INFO:[93-0] [TCP-ACCEPT-1] send(len=590) -> 590, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_out_write(len=590) -> 590, err=0
== INFO:[93-0] Curl_xfer_send(len=561, eos=1) -> 0, 561
== INFO:[93-0] [MULTI] [PERFORMING] shutdown start on secondary connection
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=5) -> -1, err=81
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=5) -> -1, err=81
== INFO:[93-0] [SSL-1] SSL shutdown not sent, read -> -1
== INFO:[93-0] [SSL-1] send SSL close notify
== INFO:[93-0] [TCP-ACCEPT-1] send(len=31) -> 31, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_out_write(len=31) -> 31, err=0
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=5) -> -1, err=81
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=5) -> -1, err=81
== INFO:[93-0] [SSL-1] SSL shutdown read -> -1
== INFO:[93-0] [SSL-1] SSL shutdown sent, want receive
== INFO:[93-0] [SSL-1] cf_shutdown -> 0, done=0
== INFO:[93-0] [SSL-1] shut down not done yet
== INFO:[93-0] [SSL-1] adjust_pollset, POLLIN fd=1804
== INFO:[93-0] [MULTI] [PERFORMING] ev assess pollset[fd=1804 IN], timeouts=2
== INFO:[93-0] [MULTI] [PERFORMING] ev last user gone, call(fd=1604, ev=REMOVE)
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=5) -> 5, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=5) -> 5, err=0
== INFO:[93-0] [TCP-ACCEPT-1] recv(len=26) -> 26, err=0
== INFO:[93-0] [SSL-1] ossl_bio_cf_in_read(len=26) -> 26, err=0
== INFO:[93-0] [SSL-1] SSL shutdown read -> 0
== INFO:[93-0] [SSL-1] SSL shutdown finished
== INFO:[93-0] [SSL-1] cf_shutdown -> 0, done=1
== INFO:[93-0] [SSL-1] shut down successfully
== INFO:[93-0] [TCP-ACCEPT-1] cf_socket_shutdown, fd=1804
== INFO:[93-0] [TCP-ACCEPT-1] shut down successfully
== INFO:[93-0] upload completely sent off: 561 bytes
== INFO:[93-0] [MULTI] [PERFORMING] -> [DONE] (line 1856)
== INFO:[93-0] [MULTI] [DONE] multi_done: status: 0 prem: 0 done: 0
== INFO:[93-0] Remembering we are in dir ""
== INFO:[93-0] [FTP] [STOP] closing DATA connection
== INFO:[93-0] [TCP-ACCEPT-1] cf_socket_close, fd=1804
== INFO:[93-0] [MULTI] [DONE] Curl_multi_will_close fd=1804
== INFO:[93-0] [MULTI] [DONE] ev socket done, call(fd=1804, ev=REMOVE)
== INFO:[93-0] [TCP-ACCEPT-1] destroy
== INFO:[93-0] [FTP] getFTPResponse start
== INFO:[93-0] [TCP] recv(len=5) -> -1, err=81
== INFO:[93-0] [SSL] ossl_bio_cf_in_read(len=5) -> -1, err=81
== INFO:[93-0] [SSL] cf_recv(len=900) -> -1, 81
== INFO:[93-0] [TCP] recv(len=5) -> 5, err=0
== INFO:[93-0] [SSL] ossl_bio_cf_in_read(len=5) -> 5, err=0
== INFO:[93-0] [TCP] recv(len=100) -> 100, err=0
== INFO:[93-0] [SSL] ossl_bio_cf_in_read(len=100) -> 100, err=0
== INFO:[93-0] [SSL] cf_recv(len=900) -> 76, 0
<= RECV:[93-0] 226-File accepted by server.
== INFO:[93-0] [WRITE] [OUT] wrote 30 header bytes -> 30
== INFO:[93-0] [WRITE] [PAUSE] writing 30/30 bytes of type 2 -> 0
== INFO:[93-0] [WRITE] download_write header(type=2, blen=30) -> 0
== INFO:[93-0] [WRITE] client_write(type=2, len=30) -> 0
<= RECV:[93-0] Message id 31881
== INFO:[93-0] [WRITE] [OUT] wrote 22 header bytes -> 22
== INFO:[93-0] [WRITE] [PAUSE] writing 22/22 bytes of type 2 -> 0
== INFO:[93-0] [WRITE] download_write header(type=2, blen=22) -> 0
== INFO:[93-0] [WRITE] client_write(type=2, len=22) -> 0
<= RECV:[93-0] 226 Transfer complete.
== INFO:[93-0] [WRITE] [OUT] wrote 24 header bytes -> 24
== INFO:[93-0] [WRITE] [PAUSE] writing 24/24 bytes of type 2 -> 0
== INFO:[93-0] [WRITE] download_write header(type=2, blen=24) -> 0
== INFO:[93-0] [WRITE] client_write(type=2, len=24) -> 0
== INFO:[93-0] [FTP] getFTPResponse -> result=0, nread=76, ftpcode=226
== INFO:[93-0] [FTP] [STOP] done, result=0
== INFO:[93-0] [WRITE] [OUT] done
== INFO:[93-0] [READ] client_reset, clear readers
== INFO:[93-0] Connection #0 to host JOEL-W72 left intact
== INFO:[93-0] [MULTI] [DONE] -> [COMPLETED] (line 2471)
== INFO:[93-0] [MULTI] [COMPLETED] Expire cleared
== INFO:[93-0] [MULTI] [COMPLETED] -> [MSGSENT] (line 2566)
== INFO:[93-0] [MULTI] [COMPLETED] removed, transfers=0
== LOG :info app.proto.transfer</FTP/C/FTP Client.global.tx.30881> message successfully completed

@JoelAtWisetech
Copy link
Author

This transfer worked as intended. The error is intermittent; depends on timing. If I start writing my logs to disk instead of capturing them in memory it is less likely to occur.

@JoelAtWisetech
Copy link
Author

Let me know if you need anything more.

@icing icing self-assigned this May 23, 2025
icing added a commit to icing/curl that referenced this issue May 23, 2025
When TYPE was skipped for an immediate STORE command and the server
replied fast and the EPRT data connection was not ready, the transfer
was not initated, leading to no upload.

refs curl#17394
@icing
Copy link
Contributor

icing commented May 23, 2025

@JoelAtWisetech your original suggestion was correct. I analysed what was going wrong and made #17428 as a fix.

It would be great if you could verify that in your system.

@bagder bagder closed this as completed in 745c351 May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy