r-lib / httr

httr: a friendly http package for R
https://httr.r-lib.org
Other
986 stars 1.99k forks source link

httr 1.4.7: Option seekfunction (20167) has unknown or unsupported type #746

Closed rmoff closed 1 year ago

rmoff commented 1 year ago

With version 1.4.6 of httr the following code ran just fine:

aws.s3::s3saveRDS(x = nyc_data,
                  object = paste0(branch,"/nyc/","nyc_permits.R"), 
                  bucket = repo_name, 
                  region="",
                  use_https=useHTTPS)

Since 1.4.7 it fails with

Error in curl::handle_setopt(handle, .list = req$options): Option seekfunction (20167) has unknown or unsupported type.
Traceback:

1. s3saveRDS(x = df, bucket = "quickstart", object = paste0(branch, 
 .     "/weather/", "data.R"), base_url = baseurl, region = "", 
 .     use_https = FALSE)
2. put_object(file = tmp, bucket = bucket, object = object, ...)
3. s3HTTP(verb = "PUT", bucket = bucket, path = paste0("/", object), 
 .     headers = headers, request_body = file, verbose = verbose, 
 .     show_progress = show_progress, ...)
4. httr::PUT(url, H, body = httr::upload_file(request_body), query = query, 
 .     show_progress, ...)
5. request_perform(req, hu$handle$handle)
6. curl::handle_setopt(handle, .list = req$options)

I'm wondering if it's perhaps related to this commit?

The code is from this notebook.

jcrodriguez1989 commented 1 year ago

Same error here when using googleCloudStorageR::gcs_upload function.

hadley commented 1 year ago

CURLOPT_SEEKFUNCTION was added in curl 7.18.0. curl 7.18.0 was released in January 28 2008, so you'll need to figure out why you're using a 15+ year old version of curl.

eblondel commented 1 year ago

The issue occurs if you don't update properly curl R package (to get new features introduced at https://github.com/jeroen/curl/issues/307 - see answer provided at https://github.com/jeroen/curl/issues/315), and although you might have curl version >= 7.18.0. I got the issue with R curl 3.0.0 (although running with curl 7.84.0 - 1 year old)

hadley commented 1 year ago

Ah thanks for letting me know — I'll bump the version of curl that httr requires.