R: postForm from the RCurl package and issues API call -
does have experience limitations of postform rcurl package?
i pulling data off server , out of got error message * http 1.0, assume close after body , 500 internal server error. tested configurations , seemed fine. i've created clean database , re-uploaded database 20/30 cases @ time while repeatedly pulling data api/postform call r. works should until around 150 cases error message appears. regardless of order upload cases in error appears around 150/160 cases , total files size around 11 12 mb. in other words, error doesn't seem dependent on specific cases not same cases breaks it
any advice appreciated.
i've attached screenshot spice rather boring post bit , make not having working example,

update 2013-08-24 19:33:18z
here curlversion()$version , sessioninfo() information,
> curlversion()$version [1] "7.22.0" > sessioninfo() r version 3.0.1 (2013-05-16) platform: i686-pc-linux-gnu (32-bit) locale: [1] lc_ctype=en_us.utf-8 lc_numeric=c [3] lc_time=en_us.utf-8 lc_collate=en_us.utf-8 [5] lc_monetary=en_us.utf-8 lc_messages=en_us.utf-8 [7] lc_paper=c lc_name=c [9] lc_address=c lc_telephone=c [11] lc_measurement=en_us.utf-8 lc_identification=c attached base packages: [1] stats graphics grdevices utils datasets methods base other attached packages: [1] rcurl_1.95-4.1 bitops_1.0-6 update 2013-08-26 05:39:26z
as suggested in hadley's comment i've added verbose rcurl output call works , call fails, see below
the call works less 150 cases in database
> r.object.api <- postform(r.object.url, token=r.object.token, content="record", type="flat", format="csv", raworlabel="label", .opts=curloptions(ssl.verifypeer=true, cainfo=r.object.crt, verbose=true)) * connect() research.org port 443 (#0) * trying xx.xx.xxx.xxx... * connected * set certificate verify locations: * cafile: /home/dir/research.cert capath: /etc/ssl/certs * ssl connection using dhe-rsa-aes256-sha * server certificate: * subject: c=xx; postalcode=xxxxx-xxxx; st=xx; l=xxxxxx; street=xxx; street=xx xxxxxx xx; o=xxxx, xxx; ou=xxx; cn=research.org * start date: 2013-02-04 00:00:00 gmt * expire date: 2016-02-04 23:59:59 gmt * subjectaltname: research.org matched * issuer: c=us; o=xxxxxx; ou=xxxxxx; cn=xxxxxx server xx * ssl certificate verify ok. > post /api/ http/1.1 host: research.org accept: */* content-length: 573 expect: 100-continue content-type: multipart/form-data; boundary=----------------------------xxxxxxxxxxxx < http/1.1 100 continue < http/1.1 200 ok < date: mon, 26 aug 2013 05:16:44 gmt < server: apache/2.2.15 (red hat) < x-powered-by: php/5.3.3 < expires: 0 < cache-control: no-store, no-cache, must-revalidate < pragma: no-cache < connection: close < transfer-encoding: chunked < content-type: text/html; charset=utf-8 < * closing connection #0 > the call fails more 150 cases in database
> r.object.api <- postform(r.object.url, token=r.object.token, content="record", type="flat", format="csv", raworlabel="label", .opts=curloptions(ssl.verifypeer=true, cainfo=r.object.crt, verbose=true)) * connect() research.org port 443 (#0) * trying xx.xx.xxx.xxx... * connected * set certificate verify locations: * cafile: /home/dir/research.cert capath: /etc/ssl/certs * ssl connection using dhe-rsa-aes256-sha * server certificate: * subject: c=xx; postalcode=xxxxx-xxxx; st=xx; l=xxxxxx; street=xxx; street=xx xxxxxx xx; o=xxxx, xxx; ou=xxx; cn=research.org * start date: 2013-02-04 00:00:00 gmt * expire date: 2016-02-04 23:59:59 gmt * subjectaltname: research.org matched * issuer: c=us; o=xxxxxx; ou=xxxxxx; cn=xxxxxx server xx * ssl certificate verify ok. > post /api/ http/1.1 host: research.org accept: */* content-length: 573 expect: 100-continue content-type: multipart/form-data; boundary=----------------------------xxxxxxxxxxxx < http/1.1 100 continue * http 1.0, assume close after body < http/1.0 500 internal server error < date: mon, 26 aug 2013 05:15:05 gmt < server: apache/2.2.15 (red hat) < x-powered-by: php/5.3.3 < expires: 0 < cache-control: no-store, no-cache, must-revalidate < pragma: no-cache < content-length: 276 < connection: close < content-type: text/html; charset=utf-8 < * closing connection #0 error: internal server error
doesnt answer question relates options , keepalive:
rcurl uses libcurl library. different curl command line tool. need @ libcurl options here. curlopt_tcp_keepalive maybe want. in rcurl listed tcp.keepalive if present in listcurloptions().
from easyopt man page added in 7.25.0. can check version of libcurl rcurl using running
> curlversion()$version [1] "7.22.0" unfortunately version of libcurl rcurl using doesnt handle keep alives yet.
Comments
Post a Comment