Error posting over XML-RPC

Found a bug? Tell us!!
Jarl Nicolson
Posts: 3
Joined: Sun Jun 04, 2006 3:31 am

Error posting over XML-RPC

Post by Jarl Nicolson »

Hey all,

Well I'm sure this isn't a bug, because I couldn't find anyone else with the same issue! I'm sure it's something to do with my setup, I just can't figure out what.

When I try and post over XML-RPC (using w.bloggar or Windows Live Writer). Using w.bloggar, I get "Posted with Success! Post ID: Entries were not successfully inserted!".

Windows Live Writer appears to work, however it doesn't.

I'm running the latest releasted version of s9y on postgresql 8.1, php 5.1.2.

It appears as though when I try to make a post using XML-RPC, a boolean field in postgres set to NOT NULL has nothing in it. For for w.bloggar, using the metaWeblog API, the moderate_comments field is null, for Windows Live Writer, using the MT API, it's the allow_comments field which is null.

In Windows Live Writer, I can select the comments to be open or closed, and that allows the post to go through, so it seems to be having problems selecting the default value for those fields. It's just strange to me that with 1 API, it gets one but not the other, and using the other API it's the reverse.

Please let me know if any more information is required. I think i've covered everything.

I should also mention that I tried it with a clean install, just installed Spartacus and the Post via XML-RPC plugins. Both WLW and w.bloggar worked (though WLW would only send through posts as drafts) until I viewed my personal settings in the s9y admin site. I didn't change anything, just viewed the profile and pressed save.

Sorry for the long post, thought i'd try and give as much information as possible.

Thanks!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Error posting over XML-RPC

Post by garvinhicking »

Hi Jarl!

Good debugging skills you have there! You are perfectly fine on track, and actually I prefer long messages to short ones.

With your help I believe I am able to fix the bug by proper useage of the serendipity_db_bool() function for the fields you mention.

I just committed a new version of the plugin with those changes:

http://php-blog.cvs.sourceforge.net/php ... 14&r2=1.15

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Hokey
Regular
Posts: 141
Joined: Wed Dec 14, 2005 3:36 pm
Location: Germany
Contact:

Off-Tpoic

Post by Hokey »

Hi!
A little bit off topic: If you're looking for blogging-software working with S9Y you should have a look at Blogdesk, which is also available in English.
Michael Harrison
Regular
Posts: 51
Joined: Sat Jan 28, 2006 12:50 pm

Post by Michael Harrison »

I'm also attempting to use blogdesk after having tried Windows Live writer and I'm getting the following error when trying to upload a post:

"An error occured while uploading the post. Error transferring the post to the server. Errorcode:104 XML error: not well-formed (invalid token) at line 17"

It appears that there's been some discussion of this in the German section but I don't know German. Anyone care to translate the solution?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Michael!

Could it be you'Re using PHP 5.2.2? IF yes, please read blog.s9y.org for a posting about that.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Michael Harrison
Regular
Posts: 51
Joined: Sat Jan 28, 2006 12:50 pm

Post by Michael Harrison »

No, I'm using 4.3.11

Thanks for the fast reply.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Michael!

Which Serendipity and XML-RPC posting plugin are you using?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Michael Harrison
Regular
Posts: 51
Joined: Sat Jan 28, 2006 12:50 pm

Post by Michael Harrison »

s9y 1.1.2 & xml plugin 1.28
Michael Harrison
Regular
Posts: 51
Joined: Sat Jan 28, 2006 12:50 pm

Post by Michael Harrison »

I just upgraded to 1.29 and get the same results.
Michael Harrison
Regular
Posts: 51
Joined: Sat Jan 28, 2006 12:50 pm

Post by Michael Harrison »

Was there a solution in this thread?

http://board.s9y.org/viewtopic.php?p=48 ... fe6d4498b9
Hokey
Regular
Posts: 141
Joined: Wed Dec 14, 2005 3:36 pm
Location: Germany
Contact:

Post by Hokey »

Hello Michael,

I'm sorry to say that there was no solution in this thread.

Maybe my my blogdesk settings will help you?

Image
Michael Harrison
Regular
Posts: 51
Joined: Sat Jan 28, 2006 12:50 pm

Post by Michael Harrison »

Unfortunately those didn't help. here are my settings

Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Michael!

Maybe enabling the debugging of the XMLRPC plugin will hepl us.

Please edit the serendipity_xmlrpc.inc.php file of the plugins/serendipity_event_xmlrpc directory.

There you change

$debug_xmlrpc = false;

to

$debug_xmlrpc = 2;

Also search and replace the occurences of "/tmp/rpc.log" with a server path where you have write and read privilege to (like /home/www/dragonseye/htdocs/blog/templates_c/rpc.log) or something like that.

Or maybe even replace

'/tmp/rpc.log'

with

dirname(__FILE__) . '/rpc.log'

which should put the rpc.log file into your plugin directory. If you fetched the directory via spartacus, it should be writable then.

Then try to post your article, and post the rpc.log file here. Make sure to strip the cleartext password out of the log!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Michael Harrison
Regular
Posts: 51
Joined: Sat Jan 28, 2006 12:50 pm

Post by Michael Harrison »

Thanks Garvin. Here are the results. One interesting note is that after making the log changes the error message changed from the one shown above to:

"XML parsing error: Malformed comment, '--' not allowed inside comment starting at position 40"

Here's the log:


[05.06.2007 10:55]<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>metaWeblog.newPost</methodName>
<params>
<param>
<value>
<string>1</string>
</value>
</param>
<param>
<value>
<string>Michael Harrison</string>
</value>
</param>
<param>
<value>
<string>xxx</string>
</value>
</param>
<param>
<value>
<struct>
<member>
<name>title</name>
<value>
<string>test post</string>
</value>
</member>
<member>
<name>description</name>
<value>
<string>test</string>
</value>
</member>
<member>
<name>mt_text_more</name>
<value>
<string>more text</string>
</value>
</member>
<member>
<name>mt_allow_comments</name>
<value>
<i4>1</i4>
</value>
</member>
<member>
<name>mt_allow_pings</name>
<value>
<i4>1</i4>
</value>
</member>
<member>
<name>categories</name>
<value>
<array>
<data>
<value>
<string>Musings - Michael</string>
</value>
</data>
</array>
</value>
</member>
</struct>
</value>
</param>
<param>
<value>
<boolean>1</boolean>
</value>
</param>
</params>
</methodCall>

Array
(
[serendipity] => Array
(
[old_session] => 995fabff07f1abdd74cba6818fc86ef4
)

)

<?xml version="1.0" encoding="UTF-8"?>
<!-- PEAR XML_RPC SERVER DEBUG INFO:

vvv POST DATA RECEIVED BY SERVER vvv
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>metaWeblog.newPost</methodName>
<params>
<param>
<value>
<string>1</string>
</value>
</param>
<param>
<value>
<string>Michael Harrison</string>
</value>
</param>
<param>
<value>
<string>xxx</string>
</value>
</param>
<param>
<value>
<struct>
<member>
<name>title</name>
<value>
<string>test post</string>
</value>
</member>
<member>
<name>description</name>
<value>
<string>test</string>
</value>
</member>
<member>
<name>mt_text_more</name>
<value>
<string>more text</string>
</value>
</member>
<member>
<name>mt_allow_comments</name>
<value>
<i4>1</i4>
</value>
</member>
<member>
<name>mt_allow_pings</name>
<value>
<i4>1</i4>
</value>
</member>
<member>
<name>categories</name>
<value>
<array>
<data>
<value>
<string>Musings - Michael</string>
</value>
</data>
</array>
</value>
</member>
</struct>
</value>
</param>
<param>
<value>
<boolean>1</boolean>
</value>
</param>
</params>
</methodCall>

^^^ END POST DATA ^^^
-->
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>104</int></value>
</member>
<member>
<name>faultString</name>
<value><string>XML error: not well-formed (invalid token) at line 17</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>vvv POST DATA RECEIVED BY SERVER vvv
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>metaWeblog.newPost</methodName>
<params>
<param>
<value>
<string>1</string>
</value>
</param>
<param>
<value>
<string>Michael Harrison</string>
</value>
</param>
<param>
<value>
<string>xxx</string>
</value>
</param>
<param>
<value>
<struct>
<member>
<name>title</name>
<value>
<string>test post</string>
</value>
</member>
<member>
<name>description</name>
<value>
<string>test</string>
</value>
</member>
<member>
<name>mt_text_more</name>
<value>
<string>more text</string>
</value>
</member>
<member>
<name>mt_allow_comments</name>
<value>
<i4>1</i4>
</value>
</member>
<member>
<name>mt_allow_pings</name>
<value>
<i4>1</i4>
</value>
</member>
<member>
<name>categories</name>
<value>
<array>
<data>
<value>
<string>Musings - Michael</string>
</value>
</data>
</array>
</value>
</member>
</struct>
</value>
</param>
<param>
<value>
<boolean>1</boolean>
</value>
</param>
</params>
</methodCall>

^^^ END POST DATA ^^^

---------------------------------------
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

The changed error message is just because the server emits debugging info.

The actual error tells me that there is a problem on line 17 of your XML input.

Line 17 sadly is your password, which you've replaced to "xxx". :)

Could it be you used special characters in your password, like umlauts or the "&" sign? Or "<" or ">"? Those characters are not allowed there.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply