WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 18 months ago

#14037 closed defect (bug) (worksforme)

XMLRPC posts failing since upgrade from WP 2.9.2 to WP 3.0

Reported by: mark.waters Owned by:
Milestone: Priority: normal
Severity: major Version: 3.0
Component: XML-RPC Keywords: xmlrpc
Focuses: Cc:

Description

I am using the 'charm' application to post to my blog via XMLRPC but since moving to WP 3.0 (new code installation , imported databases) this now fails with the following error :-

"Error, could not automatically select blog since you have more than one."

I have blogged about my posting setup here :-

http://opensource.blogs.weloveit.info/?p=246

Attachments (4)

automated.posting.xmlrpc.wp.2.9.2.log (1.5 KB) - added by mark.waters 4 years ago.
automated.posting.xmlrpc.wp.3.0.log (572 bytes) - added by mark.waters 4 years ago.
manual.posting.xmlrpc.wp.2.9.2.log (989 bytes) - added by mark.waters 4 years ago.
manual.posting.xmlrpc.wp.3.0.log (1.2 KB) - added by mark.waters 4 years ago.

Download all attachments as: .zip

Change History (28)

comment:1 in reply to: ↑ description mark.waters4 years ago

I have just replaced xmlrpc.php with the version from 2.9.2 and it works again!

comment:2 josephscott4 years ago

Can you post details on what the errors were? We need more information to track this down.

comment:3 redsweater4 years ago

The error message cited is not coming from WordPress. It seems like this issue should start as a bug report to the "Charm" developers, and they should vet it to see whether it's possibly based on any underlying issue in WordPress.

For what it's worth, users of my XMLRPC api client application have not reported any comparable issues with 3.0 yet.

comment:4 mark.waters4 years ago

Thanks for the guidance , I have emailed the developer of charm.

comment:5 mark.waters4 years ago

I received an email this morning out of the blue from someone called 'Lydia' saying :-

"I'm looking at this, but don't have a wordpress 3.0 installation to
tinker with.

On wordpress.com, it turns out that using Charm works in all ways except
posting -- posting works, but it returns a 500 server error, which is
definitely a wordpress problem and not a Charm issue."

comment:6 westi4 years ago

  • Cc westi added

I've just been through most of the changes to xmlrpc.php over the past 6 months.

We haven't changed anything drastic here apart from add support for Multisite.

I assume you are running a 3.0 install with multisite enabled and have more than one site and charm cannot determine which one to post to from that error message?

comment:7 mark.waters4 years ago

Currently running a new installation of WP 3.0 , i just mysqldump'ed the old database (wpmu) and imported it into a new database (wordpress).

Previously I was running WPMU 2.9.2
As expected I could enable XMLRPC posting for specific blogs and post to them using charm , I had the MythTV system post automatically to our mythtv recordings blog and I posted to our microblog while testing ( http://micro.blogs.weloveit.info/?p=13432 )

charm uses a configuration file in which you specify which site you want to post to , but since the move to WP 3.0 I see the "Error, could not automatically select blog since you have more than one." message.
Unfortunately charm doesn't seem to have a switch to be more verbose when posting.

I am using dnsmasq for internal DNS on our LAN which uses a wildcard record to point all *.blogs.weloveit.info addresses to the same webserver.
address=/.blogs.weloveit.info/192.168.0.13

The Apache blogs.weloveit.info vhost is set using the following :-
ServerName blogs.weloveit.info
ServerAlias *.blogs.weloveit.info
Which is working perfectly.

I don't think the problem is dnsmasq or apache2 , I only mention them for completeness.

comment:8 redsweater4 years ago

Mark - it's great that Lydia (presumably from the charm project) was able to reproduce a problem with WordPress.com. Instead of westi or somebody else on the WordPress team having to grasp at straws wondering how and why the "500 error" she saw occurred, it would be great if you could follow up with her to ask:

What specifically goes over the network to WordPress.com when posting, and what comes back from WordPress.com, when the 500 error occurs?

Since other clients besides charm seem to be able to post without issue, it seems likely that something subtle in the way charm puts the XML request together is probably important to reproducing this issue, whether it turns out to ultimately be a problem in WordPress or in charm.

Daniel

comment:9 westi4 years ago

I think I may have tracked down the cause of this.

Tested with charm on my local install.

  • With both the main domain and a subdomain having XMLRPC enabled all is fine
  • With only the subdomain having it enabled charm cannot get a list of sites for a user

I get:

( Fetching blogs... )
Error in retrieving blogs (<Fault 405: 'XML-RPC services are disabled on this site.  An admin user can enable them at http://tester.multisite.domain/wp-admin/options-writing.php'>).

Charm could not retrieve any blogs for you. This may because of an
authentication error, or because you have not yet created a blog
on your blogging service.

Note: If I try this against WordPress.com all is fine.

comment:10 westi4 years ago

This all comes from [12852] being converted over from the old MU way.

It looks like you have to have XMLRPC enabled on the root site for a network for this to work - as that is how the code discovers the blogs you can use.

Not sure whether of not to class this as a feature or a bug!

comment:11 mark.waters4 years ago

Sorry , it still isn't working for me.
I enabled XMLRPC posting on blog #1 ( blogs.weloveit.info ) , then I moved back the original WP 3.0 xmlrpc.php file and get :-

mark@core6:/var/lib/mythtv/recordings$ post_mythtv_recording_to_wordpress 7335_20100628201600.mpg
/usr/share/charm/ljcharm.py:41: DeprecationWarning: the md5 module is deprecated; use hashlib instead

import md5

/usr/share/charm/ljcharm.py:50: DeprecationWarning: the sha module is deprecated; use the hashlib module instead

import sha

Error, could not automatically select blog since you have more than one.

So I move back the WP 2.9.2 xmlrpc.php again and try again :-

mark@core6:/var/lib/mythtv/recordings$ post_mythtv_recording_to_wordpress 7335_20100628201600.mpg
/usr/share/charm/ljcharm.py:41: DeprecationWarning: the md5 module is deprecated; use hashlib instead

import md5

/usr/share/charm/ljcharm.py:50: DeprecationWarning: the sha module is deprecated; use the hashlib module instead

import sha

Posted.

comment:12 westi4 years ago

Could you try the following:

  • Run charm in step by step mode without all the command line options with both 2.9.2 and 3.0 - Do you see only one blog with 2.9.2 and more than one with 3.0 ?
  • Capture the comms between WordPress and charm using the XML-RPC debugging log functionality - $xmlrpc_logging = 1 in xmlrpc.php and then ensure the log contains no password info and attach to this trac ticket as that may help in debugging.

comment:13 mark.waters4 years ago

Sure , there you go!

I was surprised to see that manual posting worked when using the WP 3.0 xmlrpc.php file.

You can see the manual posts on our mythtv recordings blog :-
http://mythtv.blogs.weloveit.info/2010/06/29/1234567890/
http://mythtv.blogs.weloveit.info/2010/06/29/0987654321/

comment:14 follow-up: westi4 years ago

Thanks.

Ok. So that confirms that it is the getUsersOfBlogs call it has issue with.

  • When you were manually posting did you have to pick a blog to post to?
  • Could you try capturing the response as well - you may be able to hack either charm or WordPress to do this or you can use WireShark to capture the comms on the wire

comment:15 in reply to: ↑ 14 skinnydog4 years ago

  • Cc skinnydog added
  • Keywords xmlrpc added
  • Severity changed from normal to major

Replying to westi:

Is this being resolved? Still an issue for us after upgrading a WordPress MU install to 3.0.

I wonder if it is from this change:

On 2.9.2 Line 442...

if( !function_exists( 'is_site_admin' ) ) {

On 3.0 Line 441...

if ( !is_multisite() ) {

When upgrading an MU install you do not have to define Mult-isite is that the issue?

comment:16 nacin4 years ago

is_multisite() checks for a few different constants and will return true for a new MS network, or for an updated MU network.

comment:17 follow-ups: hakre4 years ago

Is this problem solved after setting the constant for multisite?

comment:18 in reply to: ↑ 17 skinnydog4 years ago

Replying to hakre:

Is this problem solved after setting the constant for multisite?

I was told not to define this in a MU -> 3.0 install.

comment:19 in reply to: ↑ 17 wpmuguru4 years ago

Replying to hakre:

Is this problem solved after setting the constant for multisite?

Upgraded MU installs don't use the MULTISITE constant. Adding that to an upgraded MU install takes down the main site.

comment:20 nacin3 years ago

  • Milestone changed from Awaiting Review to Future Release

This still a problem, I imagine? westi?

comment:21 skinnydog3 years ago

Wee still have problems with this one and at version 3.0.4 everything was fine post 3.0x .
We were using MU prior to upgrade.

comment:22 markoheijnen18 months ago

I'm curious if we can close this ticket. In 22 months no traction and we already are a few releases further.

comment:23 wpmuguru18 months ago

XMLRPC was refactored in 3.4. This should be safe to close.

comment:24 SergeyBiryukov18 months ago

  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Feel free to reopen with steps to reproduce if there's still a problem.

Note: See TracTickets for help on using tickets.