Skip to content

CURLE_PARTIAL_FILE error if downloading file in blocks (CURLOPT_RANGE) larger than file size #18283

@kupavcevdenis

Description

@kupavcevdenis

I did this

When trying to download file (FTP) in blocks (CURLOPT_RANGE, 0-262144) larger than file size I get CURLE_PARTIAL_FILE error

Set options.

CURLOPT_HTTPGET, 1
CURLOPT_NOBODY, 0
CURLOPT_HEADER, 0
CURLOPT_UPLOAD, 0
CURLOPT_FAILONERROR, 1
CURLOPT_FOLLOWLOCATION, 1
CURLOPT_RANGE, 0-262144

Probably the cause of the error
transfer: conn close on paused upload · curl/curl@30de937

Downloading 'http://win2022-0244:49161/CRLT/redirect/301/ftp://win2022-0244:11820/normal' 262144 bytes starting at pos 0...
CURLINFO_TEXT: Host win2022-0244:49161 was resolved.
CURLINFO_TEXT: IPv6: fe80::efaf:5e1a:1bd3:3648, 2a03:2480:68:1821:157e:98b1:4c89:ac5c
CURLINFO_TEXT: IPv4: 10.88.0.13
CURLINFO_TEXT: Trying [fe80::efaf:5e1a:1bd3:3648]:49161...
CURLINFO_TEXT: Connected to win2022-0244 (fe80::efaf:5e1a:1bd3:3648) port 49161
CURLINFO_TEXT: using HTTP/1.x
CURLINFO_HEADER_OUT: GET /CRLT/redirect/301/ftp://win2022-0244:11820/normal HTTP/1.1 Host: win2022-0244:49161 Range: bytes=0-262143 User-Agent: curl/8.0 Accept: /
CURLINFO_TEXT: Request completely sent off
CURLINFO_HEADER_IN: HTTP/1.1 301 Moved Permanently
CURLINFO_HEADER_IN: Location: ftp://win2022-0244:11820/normal
CURLINFO_HEADER_IN: Content-Type: application/octet-stream
CURLINFO_HEADER_IN: Accept-Ranges: bytes
CURLINFO_HEADER_IN: Content-Length: 13
CURLINFO_HEADER_IN: Connection: keep-alive
CURLINFO_TEXT: Ignoring the response-body
CURLINFO_TEXT: setting size while ignoring
CURLINFO_HEADER_IN:
CURLINFO_TEXT: Connection #0 to host win2022-0244 left intact
CURLINFO_TEXT: Clear auth, redirects to port from 49161 to 11820
CURLINFO_TEXT: Issue another request to this URL: 'ftp://win2022-0244:11820/normal'
CURLINFO_TEXT: Host win2022-0244:11820 was resolved.
CURLINFO_TEXT: IPv6: fe80::efaf:5e1a:1bd3:3648, 2a03:2480:68:1821:157e:98b1:4c89:ac5c
CURLINFO_TEXT: IPv4: 10.88.0.13
CURLINFO_TEXT: Trying [fe80::efaf:5e1a:1bd3:3648]:11820...
CURLINFO_TEXT: Trying 10.88.0.13:11820...
CURLINFO_TEXT: Connected to win2022-0244 (10.88.0.13) port 11820
CURLINFO_HEADER_IN: 220 Browser Ftp Server.
CURLINFO_HEADER_OUT: USER anonymous
CURLINFO_HEADER_IN: 230 User Logged In.
CURLINFO_HEADER_OUT: PWD
CURLINFO_HEADER_IN: 257 "/" is current directory.
CURLINFO_TEXT: Entry path is '/'
CURLINFO_TEXT: Request has same path as previous transfer
CURLINFO_HEADER_OUT: EPSV
CURLINFO_TEXT: Connect data stream passively
CURLINFO_HEADER_IN: 500 Command not understood.
CURLINFO_TEXT: Failed EPSV attempt. Disabling EPSV
CURLINFO_HEADER_OUT: PASV
CURLINFO_HEADER_IN: 227 Entering Passive Mode (10,88,0,13,108,79).
CURLINFO_TEXT: Skip 10.88.0.13 for data connection, reuse win2022-0244 instead
CURLINFO_TEXT: Connecting to 10.88.0.13 (10.88.0.13) port 27727
CURLINFO_TEXT: Trying 10.88.0.13:27727...
CURLINFO_TEXT: Connected 2nd connection to 10.88.0.13 port 27727
CURLINFO_HEADER_OUT: TYPE I
CURLINFO_HEADER_IN: 200 Binary transfer mode active.
CURLINFO_HEADER_OUT: SIZE normal
CURLINFO_HEADER_IN: 213 37
CURLINFO_HEADER_OUT: RETR normal
CURLINFO_HEADER_IN: 150 Opening data connection.
CURLINFO_TEXT: Maxdownload = 262144
CURLINFO_TEXT: Getting file with size: 37
CURLINFO_TEXT: abort upload
CURLINFO_TEXT: end of response with 262107 bytes missing
CURLINFO_TEXT: closing connection #1
CURLE 18, Response 150, errno 0 URL ftp://win2022-0244:11820/normal

I expected the following

This error does not reproduce in version curl 8.6.0

curl/libcurl version

lib curl 8.15.0

operating system

System: 'Microsoft Windows NT', Version: '10.0, 20348'

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions