Forum OpenACS Development: Error: POST /RPC2/

Collapse
Posted by Iuri Sampaio on
Pisano and all,

In order to move oacs dev to the right forum I've opened this thread. After a xml-rpc call, it returns the following error.

It seems ns_xml has been called instead of tdom. How would we get control over the selection of those parsing libraries?

[18/Sep/2016:21:22:08][9749.a9effb70][-conn:iurix:4-] Error: POST /RPC2/, PeerAddress: 192.199.241.135
invalid command name "ns_xml"
while executing
"ns_xml doc create "1.0""
(procedure "xmlrpc_fault" line 3)
invoked from within
"xmlrpc_fault 1 "error parsing request: $doc_id""
(procedure "xmlrpc_invoke" line 4)
invoked from within
"xmlrpc_invoke $content"
(procedure "xml_rpcdispatcher" line 12)
invoked from within
"xml_rpcdispatcher"
while executing callback
ns:tclrequest xml_rpcdispatcher
(context: request proc)

Collapse
2: Re: Error: POST /RPC2/ (response to 1)
Posted by Iuri Sampaio on
Hi there,

So far, the ns_xml error remains. There was another issue in the ad_proc call, within http://ndc.iurix.com/ws-ndc/. The name and arguments were wrong.

The new call is below.

catch {xmlrpc::remote_call http://www.iurix.com/RPC2 ix_ndc.get_result -string $appkey -int $package_id -string $username -string $password -int 4 -int 44} result

error.log is slightly different. Now, it shows the connection attempts. but in the end ns_xml breaks
[18/Sep/2016:21:57:43][29294.b51e2b70][-conn:iurix:1-] Error: POST /RPC2/, PeerAddress: 192.199.241.135
invalid command name "ns_xml"
while executing
"ns_xml doc create "1.0""
(procedure "xmlrpc_fault" line 3)
invoked from within
"xmlrpc_fault 1 "error parsing request: $doc_id""
(procedure "xmlrpc_invoke" line 4)
invoked from within
"xmlrpc_invoke $content"
(procedure "xml_rpcdispatcher" line 12)
invoked from within
"xml_rpcdispatcher"
while executing callback
ns:tclrequest xml_rpcdispatcher
(context: request proc)
[18/Sep/2016:21:57:43][29294.b51e2b70][-conn:iurix:1-] Notice: 'ns_tmpnam ' is deprecated. Use 'ns_mktemp ?template?' instead.
[18/Sep/2016:21:57:43][29294.b51e2b70][-conn:iurix:1-] Warning: ns_unlink /tmp/fileWPRcPH1474235863813.xmlrpc2 is deprecated. Use 'file delete' instead!
[18/Sep/2016:21:57:43][29294.b51e2b70][-conn:iurix:1-] Error: xmlrpc::invoke: error parsing request: error "Unexpected end" at position 0
""
[18/Sep/2016:21:57:44][29294.b47e2b70][-conn:iurix:0-] Notice: error "Unterminated element" at position 1101
"
document.forms[form_name].elements[element_name].focus();

Collapse
3: Re: Error: POST /RPC2/ (response to 1)
Posted by Iuri Sampaio on
I found the following thread about ns_xml. https://openacs.org/forums/message-view?message_id=19169

However, I still see no need for ns_xml.
In my view tdom is its substitute? Isn't it? I installed TDOM package 0.8, then restarted Naviserver, but ns_xml errors remains.
tdom 0.8.3~20080525-3+nmu2 A fast XML/DOM/XPath/XSLT extension for Tcl written in C

AOLSERVER 4.5 was previously uninstalled from this server. I ran apt-get remove --purge aolserver-* , then NaviServer took place. The installation was successful.
Would aolserver's removal be a potential cause?

Collapse
4: Re: Error: POST /RPC2/ (response to 1)
Posted by Antonio Pisano on
Dear Iuri,

the errors you are reporting complain about the lack of ns_xml. Such module is likely not present on your naviserver, and, I fear, on every naviserver around.

From what I am understanding, ns_xml was a module for xml parsing required before the advent of tdom. Therefore, I fear another task required for you to get this package working again is to refactor the code so calls to ns_xml get replaced by tdom idioms. There is no magic parameter for such thing.

Please have a look at my reply on your previous post, as I am really interested in an answer about -why- you need to embark on this non trivial task. If XML-RPC is not a constraint for you, maybe better alternatives are available.

All the best

Antonio

Collapse
5: Re: Error: POST /RPC2/ (response to 1)
Posted by Gustaf Neumann on
Iuri, ns_xml was replaced ages ago in OpenACS by tdom. You might have noticed, that the last entry of the thread of the OpenACS forum, that you have cited, is from 2001 (more than 15 years ago)!!!

You might have better success with the package "xml-rpc", which you might install via the following commands from cvs HEAD:

cd packages
cvs -d:pserver:anonymous@cvs.openacs.org:/cvsroot checkout -r HEAD openacs-4/packages/xml-rpc
mv openacs-4/packages/xml-rpc .
rm -rf openacs-4
Collapse
6: Re: Error: POST /RPC2/ (response to 5)
Posted by Iuri Sampaio on
Gustaff,

That's probably there from old oacs legacy. Even though, I was pretty sure I had downloaded xml-rpc pkg from CVS, oacs-core.

Anyway, I've followed your guides, restarted Naviserver, and called http://ndc.iurix.com/ws-ndc/ and it returned the same error. The release is

https://openacs.org/repository/download/apm/xml-rpc-0.3.apm

I believe the cause is not the one we expected.

[20/Sep/2016:02:02:36][15344.b4863b70][-conn:iurix:0-] Warning: ns_httpopen POST http://www.iurix.com/RPC2 d3 30 {?xml version="1.0"?<methodCall><methodName>ix_ndc.get_result</methodName><params>
...

<i4>4</i4></value></param><param><value><i4>44</i4></value></param></params></methodCall>} is deprecated. Use 'ns_http' instead!
[20/Sep/2016:02:02:36][15344.b5263b70][-conn:iurix:1-] Notice: 'ns_tmpnam ' is deprecated. Use 'ns_mktemp ?template?' instead.
[20/Sep/2016:02:02:36][15344.b5263b70][-conn:iurix:1-] Warning: ns_unlink /tmp/fileycXivT3532794781.xmlrpc2 is deprecated. Use 'file delete' instead!
[20/Sep/2016:02:02:36][15344.b5263b70][-conn:iurix:1-] Error: POST /RPC2/, PeerAddress: 192.199.241.135
invalid command name "ns_xml"
while executing
"

Collapse
7: Re: Error: POST /RPC2/ (response to 6)
Posted by Iuri Sampaio on
Gustaff,

Right there! I did install ns_xmlrpc within <rootdir>/tcl/. I removed it and the error is gone. It seems ns_xmlrpc was overlapping /packages/xml-rpc

Best wishes

[20/Sep/2016:02:47:15][22190.b47d9b70][-conn:iurix:0-] Warning: /RPC2/ has no doc(title) set, fallback to instance_name.
...

<i4>4</i4></value></param><param><value><i4>44</i4></value></param></params></methodCall>} is deprecated. Use 'ns_http' instead!
[20/Sep/2016:02:47:20][22190.b51d9b70][-conn:iurix:1-] Notice: Running ad_proc ws_ndc.get_result...
[20/Sep/2016:02:47:20][22190.b51d9b70][-conn:iurix:1-] Error: xmlrpc_invoke: error in xmlrpc method REQUEST: ?xml version="1.0"?<methodCall><methodName>ix_ndc.get_result</methodName><params><param><value><string>ix-ndc</string></value></param><param><value><i4>414835</i4></value></param><param><value><string/></value></param><param><value><string/></value></param><param><value><i4>4</i4></value></param><param><value><i4>44</i4></value></param></params></methodCall> RESULT: ?xml version="1.0"?<methodResponse><fault><value><struct><member><name>faultCode</name><value><i4>1</i4></value></member><member><name>faultString</name><value><string>Email required</string></value></member></struct></value></fault></methodResponse>
Email required
while executing
"lars_blog_auth_for_xmlrpc -username $username -password $password"
(procedure "ix_ndc.get_result" line 4)
invoked from within