On Sat, Sep 13, 2008 at 2:21 PM, Chris Hostetter <[EMAIL PROTECTED]> wrote: > : $ ./post.sh *xml > : Posting file hd.xml to http://localhost:8080/solr/update > : curl: (18) transfer closed with outstanding read data remaining > > I can *NOT* reproduce this error on Linuc using any of hte stable versions > of resin:
It appears to be something funky between resin and curl (and chunked encoding of responses). I was worried about replication scripts not working with certain versions of curl in that case, but it looks like chunked encoding was only triggered by large post bodies. Sending large data from at least certain versions of curl cause curl to send "Expect: 100-continue". Sending this to Resin appears to make Resin use chunked encoding in the response, and this particular version of curl chokes on it. Workaround: using http1.0 avoids triggering what looks to be a curl bug at this point. Simply add --http1.0 to the curl arguments. -Yonik -------------------- client side small data (what the server sent back) --------------- $ curl -i $URL --data-binary '<commit/>' -H 'Content-type:text/xml; charset=utf -8' HTTP/1.1 200 OK Server: Resin/3.1.6 Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked Date: Sun, 14 Sep 2008 15:00:05 GMT <?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"><int name="status">0</int><int name="QTime">500</int> </lst> </response> -------------- what curl sent to the server ------------- $ nc -l -p 8983 POST /solr/update HTTP/1.1 User-Agent: curl/7.16.3 (i686-pc-cygwin) libcurl/7.16.3 OpenSSL/0.9.8h zlib/1.2. 3 libssh2/0.15-CVS Host: localhost:8983 Accept: */* Content-type:text/xml; charset=utf-8 Content-Length: 9 <commit/> ============================================ ---------------------- client side big file (what the server sent back) ---------------- $ curl -i $URL --data-binary @solr.xml -H 'Content-type:text/xml; charset=utf-8 ' HTTP/1.1 100 Continue Server: Resin/3.1.6 Content-Length: 0 Date: Sun, 14 Sep 2008 15:08:42 GMT HTTP/1.1 200 OK Server: Resin/3.1.6 Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked Date: Sun, 14 Sep 2008 15:08:42 GMT curl: (18) transfer closed with outstanding read data remaining -------------- what curl sent to the server ------------- $ nc -l -p 8983 POST /solr/update HTTP/1.1 User-Agent: curl/7.16.3 (i686-pc-cygwin) libcurl/7.16.3 OpenSSL/0.9.8h zlib/1.2. 3 libssh2/0.15-CVS Host: localhost:8983 Accept: */* Content-type:text/xml; charset=utf-8 Content-Length: 1808 Expect: 100-continue ================== Tomcat response ================= $ curl -i $URL --data-binary @solr.xml -H 'Content-type:text/xml; charset=utf-8 ' HTTP/1.1 100 Continue HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=UTF-8 Content-Length: 148 Date: Sun, 14 Sep 2008 15:12:17 GMT <?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"><int name="status">0</int><int name="QTime">31</int>< /lst> </response> ================ Jetty response ===================== $ curl -i $URL2 --data-binary @solr.xml -H 'Content-type:text/xml; charset=utf- 8' HTTP/1.1 100 Continue HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: 149 Server: Jetty(6.1.3) <?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"><int name="status">0</int><int name="QTime">422</int> </lst> </response> $ curl --version curl 7.16.3 (i686-pc-cygwin) libcurl/7.16.3 OpenSSL/0.9.8h zlib/1.2.3 libssh2/0.15-CVS Protocols: tftp ftp telnet dict ldap http file https ftps scp sftp Features: Largefile NTLM SSL libz