Issue with libssh2 on Amazon Linux 2

0

Some customer code touches "libssh2" provided functionality, and it seems that the latest version (specifically "libssh2-1.4.3-12.amzn2.2.4.x86_64") causes issues with downloading data via SFTP. Prior versions worked correctly, and downgrading to the prior version ("libssh2-1.4.3-12.amzn2.2.3") addresses it. The new version gives the following error:

cURL error 18: transfer closed with outstanding read data remaining

while the prior version does not, and works correctly.

Derrik
asked 8 months ago310 views
2 Answers
0

Hi,

Have a look at https://bobcares.com/blog/curl-18-transfer-closed-with-outstanding-read-data-remaining/ for solutions to fix curl error 18.

Best

Didier

profile pictureAWS
EXPERT
answered 8 months ago
0

Elaborating more on to Didiers Comment, I would like to explain here that the error states is related to content-length. Such cases arise when the server initially reports an expected transfer size, and then delivers data that doesn’t match the previously sent size. 
It means a Partial file i.e. only a part of the file was transferred.Some of the causes for this error are:

*   The connection gets timed-out due to the keep-alives not sent.
*   An incorrect Content-Length header was sent by the peer.



For connection timed-out to fix this issue, add the –keepalive-time.

The Keep-Alive general header allows the sender to hint about how the connection may be used to set a timeout and a maximum amount of requests.



Content-Length header is one of the ways to indicate the length of the message and it can be resolved by suppressing the ‘Expect: 100-continue’ header that cURL usually sends.

You can refer the below documentations for more information on this:



[+] https://bobcares.com/blog/curl-18-transfer-closed-with-outstanding-read-data-remaining/ [+] https://stackoverflow.com/questions/1759956/curl-error-18-transfer-closed-with-outstanding-read-data-remaining

AWS
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions