Forum OpenACS Development: Re: XML-RPC String limit

12: Re: XML-RPC String limit (response to 11)
Posted by Iuri Sampaio on
I've post it before.

The logs pointed to JavaScript syntax errors within a Tcl file which is well written. I removed that JS chunk and the syntax errors still appears but in a different part of the same file.

Notice: error "Entity parsing error" at position 2006
" + '?locale='+l+'&return_url='+return_url;

Furthermore, as mentioned before if the string has less than 95 thousand chars the requests work just fine with no sintax errors.

[15/Apr/2017:19:19:40][3231.7fef5a0da700][-conn:1contact:1-] Notice: BEFORE DEBUG string range
[15/Apr/2017:19:19:40][3231.7fef5a0da700][-conn:1contact:1-] Notice: xmlrpc::invoke last chars: ''
[15/Apr/2017:19:19:40][3231.7fef5a0da700][-conn:1contact:1-] Error: xmlrpc::invoke: error parsing request: error "Unexpected end" at position 0
[15/Apr/2017:19:19:40][3231.7fef5a0da700][-conn:1contact:1-] Notice: checking entry from host_node_map -
[15/Apr/2017:19:19:40][3231.7fef5a0da700][-conn:1contact:1-] Warning: ignore untrusted host header field: ''
[15/Apr/2017:19:19:40][3231.7fef5a0da700][-conn:1contact:1-] Notice: ignore non-existing or untrusted host header, fall back to
"xml_doc_free $doc"
(procedure "xmlrpc::invoke" line 40)
invoked from within
"xmlrpc::invoke $content"
("uplevel" body line 15)
invoked from within
"uplevel {
# /packages/xml-rpc/www/index.tcl
ad_page_contract {
Accept XML-RPC POST requests and processes them. GET requests are shown
(procedure "code::tcl::/var/www/1contact/packages/xml-rpc/www/index" line 2)
invoked from within
("uplevel" body line 12)
invoked from within
"uplevel {

if { [file exists $__adp_stub.tcl] } {

# ensure that data source preparation procedure exists and is up-to-date
(procedure "adp_prepare" line 2)
invoked from within
invoked from within
"template::adp_parse [file rootname [ad_conn file]] {}"
(procedure "adp_parse_ad_conn_file" line 6)
invoked from within
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
} ad_script_abort val {
# do nothing
invoked from within
"rp_serve_concrete_file [ad_conn file]"
(procedure "::nsf::procs::rp_serve_abstract_file" line 60)
invoked from within
"rp_serve_abstract_file "$root/$extra_url""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
rp_serve_abstract_file "$root/$extra_url"
set ::tcl_url2file([ad_conn url]) [ad_conn file]
called from rp_handler
POST referred by '' peer user_id 0

Connection: close
Content-Length: 1000234
Accept: */*
User-Agent: NaviServer-Tcl/4.99
Content-type: text/xml

[15/Apr/2017:19:19:40][3231.7fef5a8db700][-conn:1contact:0-] Notice: error "Entity parsing error" at position 2006
" + '?locale='+l+'&return_url='+return_url;

13: Re: XML-RPC String limit (response to 12)
Posted by Gustaf Neumann on
We see now that in the error case, the XML text passed to xmlrpc::invoke is empty (see the two single quotes in Notice: xmlrpc::invoke last chars: ''). It seems, as the xml-rpc package has problems gracefully handling such cases. I've added a test that should handle this test more gracefully to CVS [1].

What we know now is that for whatever reason, an xml-rpc request with 100k size ends up as an empty string in xmlrpc::invoke. This means, that xmlrpc::get_content (called by the www/index.tcl returns empty). I would recommend to try to replace the body of xmlrpc::get_content by the single line (when you use NaviServer):

  return [ns_getcontent -as_file false -binary false]

Let's hope this helps.