Very interested to see how this project develops.

I've installed the dev snapshots for the DRD server on a D6 site and DRD on a D7 site. I added the sites.php file to the D6 site added the D6 site on the DRD admin page in the D7 site. The following appears beneath my listing for the site (which has the icons other than 'edit' and 'delete' highlighted in red.

Error of type Exception occured: [-32700] Parse error. Not well formed (http://www.myd6site.com/xmlrpc.php->drd.api), _drd_xmlrpc(), /home/myusername/myd7site.net/sites/all/modules/drd/drd.dashboard.inc, 643
Error of type Exception occured: [-32700] Parse error. Not well formed (http://www.myd6site.com/xmlrpc.php->drd.api), _drd_xmlrpc(), /home/myusername/myd7site.net/sites/all/modules/drd/drd.dashboard.inc, 643
Error of type Exception occured: [-32700] Parse error. Not well formed (http://www.myd6site.com/xmlrpc.php->drd.api), _drd_xmlrpc(), /home/myusername/myd7site.net/sites/all/modules/drd/drd.dashboard.inc, 643

My first (and only) thought is that I might need to do some configuration to the (D6) DRD Server, but other than enabling and disabling the module, I can't find anything that I can look at or change on my D6 site or admin pages. Maybe *that* is a problem in and of itself?

CommentFileSizeAuthor
#1 drd_debug.patch565 bytesjurgenhaas
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jurgenhaas’s picture

FileSize
565 bytes

@Splicer, sorry for having trouble with the module, I hope we can resolve this asap so that you get the benefits.

The message you're seeing makes me believe that your remote server is reponding with a HTML page instead of the requested XML response. Currently, Drupal doesn't allow access to malformed response, but with the applied patch you will be getting debugging information. Please apply that to the commin.inc and also turn debugging in the DRD settings on. You will then get additional information in watchdog. Please have a look there and let me know what's in there. We should then be able to identify the cause for the problem.

smscotten’s picture

Thank you, jurgenhaas—

You're right, it looks like the D6 server is responding with an HTML page. Does that mean that I need to bring this issue to the drd_server issue queue?

Here's the result:

[9001] Error

Exception Object
(
    [message:protected] => [-32700] Parse error. Not well formed (http://[myd6site]/xmlrpc.php->drd.api)
    [string:private] => 
    [code:protected] => 0
    [file:protected] => /home/myusername/[myd7site]/sites/all/modules/drd/drd.dashboard.inc
    [line:protected] => 643
    [trace:private] => Array
        (
            [0] => Array
                (
                    [file] => /home/myusername/[myd7site]/sites/all/modules/drd/drd.dashboard.inc
                    [line] => 184
                    [function] => _drd_xmlrpc
                    [args] => Array
                        (
                            [0] => http://[myd6site]/xmlrpc.php
                            [1] => drd.api
                            [2] => 1.0.17
                        )

                )

            [1] => Array
                (
                    [file] => /home/myusername/[myd7site]/sites/all/modules/drd/drd.dashboard.inc
                    [line] => 354
                    [function] => drd_session
                )

            [2] => Array
                (
                    [file] => /home/myusername/[myd7site]sites/all/modules/drd/drd.module
                    [line] => 136
                    [function] => drd_dashboard_server_svn_status
                    [args] => Array
                        (
                            [0] => 1
                        )

                )

            [3] => Array
                (
                    [file] => /home/myusername/[myd7site]/sites/all/modules/drd/drd.module
                    [line] => 304
                    [function] => drd_execute
                )

            [4] => Array
                (
                    [file] => /home/myusername/[myd7site]/includes/menu.inc
                    [line] => 466
                    [function] => drd_interact
                    [args] => Array
                        (
                            [0] => 1
                        )

                )

            [5] => Array
                (
                    [file] => /home/myusername/[myd7site]/index.php
                    [line] => 22
                    [function] => menu_execute_active_handler
                )

        )

)

jurgenhaas’s picture

Project: Drupal Remote Dashboard » Drupal Remote Dashboard Server
Version: 7.x-1.x-dev »
Category: bug » support

I've reassigned the issue to drd_server. However, could you please post the HTML response that you get on your drd in D7 as this is going to tell us what's going wrong.

smscotten’s picture

The HTML response from D7? I'm not sure what you're referring to. If you mean the D6 site's response to the D7 site, I'm getting a standard "The requested page could not be found" from http://[myd6site]/xmlrpc.php->drd.api

The source to that page would be mostly my theme template. Is that really what you want or is knowing it's a 404 good enough?

Seeing that made me think to check http://[myd6site]/xmlrpc.php by itself: it returns "XML-RPC server accepts POST requests only.n/a". So xmlrpc.php itself is present and seems to be functioning.

jurgenhaas’s picture

I meant HTML output *on* the D7 server (which comes *from* the D6 server). So what you provided was already helpful: it's a page not found. As far as I know the XMLRPC is not throwing a 404 ever so it sounds as if the D7 server calls the xmlrpc.php on the D6 server and doesn't find the page. This could either happen because of a typo or because the D6 server is not reachable from the D7 server. Both sounds unlikely but I have no other idea.

To find out more I attach a modified xmlrpc.php file which you should put into your D6 Drupal directory. It will write some lines into the PHP error log when the xmlrpc.php is called. Please make sure that error logging is configured and turned on.

Looking forward to seeing what goes into the error log and hope it will help us to fix this problem for you.

Note: please rename the file to xmlrpc.php

smscotten’s picture

Sorry, the link for that attachment goes to http://drupal.org/files/issues with nothing else. That might be a sitewide problem with the attachment system (?) but as of right now I can't do anything with it.

jurgenhaas’s picture

As the file isn't big anyway we can copy the content here and you should copy and paste that into your xmlrpc.php:

<?php

//File for debugging purposes only

error_log('XMLRPC 1');
include_once './includes/bootstrap.inc';
error_log('XMLRPC 2');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
error_log('XMLRPC 3');
include_once './includes/xmlrpc.inc';
error_log('XMLRPC 4');
include_once './includes/xmlrpcs.inc';
error_log('XMLRPC 5');

xmlrpc_server(module_invoke_all('xmlrpc'));
error_log('XMLRPC 6');
smscotten’s picture

OK Thank you.

Strangely enough I don't see any XMLRPC entries in my log. What does appear is:

Cannot modify header information - headers already sent by (output started at /home/steves/splicer.com/includes/common.inc:381) in /home/steves/splicer.com/includes/common.inc on line 148.

Line 148 is in drupal_set_header() and 381 is in drupal_not_found()

This seems to come up whether I access xmlrpc.php directly from the browser or if I try to access the site through DRD from my D7 site.

I'm also getting Not Found errors on modules/toolbar/toolbar.png

The part of that that makes sense is that there's no toolbar module installed or in core, so it's natural that it wouldn't be found. The part of that that doesn't make sense is that there's no toolbar module installed or in core, so what is trying to be accessed?

This may be totally unrelated. I'm just reporting what I see.

smscotten’s picture

OK, the Not Found errors are unrelated: #554124: D7 styles in 6.x-3.0-alpha3 (Missing toolbar.png)

But that made me wonder why the Admin toolbar would be called at all. Even if the system would render a regular page (to show the 404, for example) a remote request from the D7 server shouldn't have admin privileges. Nevertheless, I disabled the Administrative Menu module and tried again. I'm getting nothing in the logs at all either when I access xmlrpc.php directly (I still get "XML-RPC server accepts POST requests only.n/a" then) or when I access DRD on D7.

Either there's a level of logging that I'm completely missing or else xmlrpc.php isn't even running.

jurgenhaas’s picture

Well, when you're calling xmlrpc.php directly and you still don't get any log entries that means that error logs in php.ini are not configured. Please have a look here http://us2.php.net/manual/en/errorfunc.configuration.php#ini.error-log first and make sure you're getting the log entries first. Then, we can look again into the scenario what happens when xmlrpc.php gets called by DRD.

smscotten’s picture

OK, maybe I need some handholding here. I've been looking in the following places: /admin/reports/dblog on my D6 site, my apache logs (error_log and access_log) and my system log (var/log/syslog).

In my php.ini,

error_log = syslog
error_reporting = E_ALL
log_errors = On

I have the D6 "Database logging" and "Syslog" modules enabled.

/admin/settings/logging/dblog has one setting. I discard after 1000 rows.
/admin/settings/logging/syslog is set to LOG_LOCAL_0

What I'm missing must be an obvious and embarrassing rookie mistake, but I've run out of ideas.

jurgenhaas’s picture

PHP logging has nothing to do with error loggin in Drupal. From the config lines you're sharing here it looks as if your PHP error are logged in the system log, so you should refer to that to see if any reports are in there.

Or you change your PHP error logging to file by configuring something like this in php.ini:

error_log = "c:\temp\phperror.log"

smscotten’s picture

I know. I'm just trying to turn on every possible log and see if something shows up somewhere.

OK, I set error_log = /home/[myusername]/phperror.log for the time being.

When I try to load xmlrpc.php in my browser this shows up:

[07-Feb-2010 12:35:07] XMLRPC 1
[07-Feb-2010 12:35:07] XMLRPC 2
[07-Feb-2010 12:35:07] XMLRPC 3
[07-Feb-2010 12:35:07] XMLRPC 4
[07-Feb-2010 12:35:07] XMLRPC 5

Which means it's working. Whew.

When I load the drd page on my D7 site, I get this from the D6 site:

[07-Feb-2010 12:39:14] XMLRPC 1
[07-Feb-2010 12:39:14] XMLRPC 2
[07-Feb-2010 12:39:14] XMLRPC 3
[07-Feb-2010 12:39:14] XMLRPC 4
[07-Feb-2010 12:39:14] XMLRPC 5
[07-Feb-2010 12:39:14] XMLRPC 1
[07-Feb-2010 12:39:14] XMLRPC 2
[07-Feb-2010 12:39:15] XMLRPC 3
[07-Feb-2010 12:39:15] XMLRPC 4
[07-Feb-2010 12:39:15] XMLRPC 5
[07-Feb-2010 12:39:15] XMLRPC 1
[07-Feb-2010 12:39:15] XMLRPC 2
[07-Feb-2010 12:39:16] XMLRPC 3
[07-Feb-2010 12:39:16] XMLRPC 4
[07-Feb-2010 12:39:16] XMLRPC 5

So it looks as though xmlrpc_server(module_invoke_all('xmlrpc')); is failing on my system.

Thank you for your patience.

jurgenhaas’s picture

Good! So here is another version of the xmlrpc.php which will help us to find out which module is screwing up:

<?php

//File for debugging purposes only

error_log('XMLRPC 1');
include_once './includes/bootstrap.inc';
error_log('XMLRPC 2');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
error_log('XMLRPC 3');
include_once './includes/xmlrpc.inc';
error_log('XMLRPC 4');
include_once './includes/xmlrpcs.inc';
error_log('XMLRPC 5');

  $hook = 'xmlrpc';
  $return = array();
  foreach (module_implements($hook) as $module) {
    error_log('XMLRPC 5: '. $module);
    $function = $module .'_'. $hook;
    $result = call_user_func_array($function, array());
    error_log('XMLRPC 5: '. $module .' ok');
    if (isset($result) && is_array($result)) {
      $return = array_merge_recursive($return, $result);
    }
    else if (isset($result)) {
      $return[] = $result;
    }
  }

xmlrpc_server($return);
error_log('XMLRPC 6');
smscotten’s picture

OK, now I get

[07-Feb-2010 13:04:02] XMLRPC 1
[07-Feb-2010 13:04:02] XMLRPC 2
[07-Feb-2010 13:04:03] XMLRPC 3
[07-Feb-2010 13:04:03] XMLRPC 4
[07-Feb-2010 13:04:03] XMLRPC 5
[07-Feb-2010 13:04:03] XMLRPC 5: blogapi
[07-Feb-2010 13:04:03] XMLRPC 5: blogapi ok
[07-Feb-2010 13:04:03] XMLRPC 5: drd_server
[07-Feb-2010 13:04:03] XMLRPC 5: drd_server ok

and then the same thing again twice with subsequent seconds in the timestamp but the same messages.

jurgenhaas’s picture

Good, all modules working fine. Now let's analyze xmlrpc_server(), please replace your xmlrpc.php with this:

<?php

//File for debugging purposes only

error_log('XMLRPC 1');
include_once './includes/bootstrap.inc';
error_log('XMLRPC 2');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
error_log('XMLRPC 3');
include_once './includes/xmlrpc.inc';
error_log('XMLRPC 4');
include_once './includes/xmlrpcs.inc';
error_log('XMLRPC 5');

$callbacks = module_invoke_all('xmlrpc');

  $xmlrpc_server = new stdClass();
  // Define built-in XML-RPC method names
  $defaults = array(
      'system.multicall' => 'xmlrpc_server_multicall',
    array(
      'system.methodSignature',
      'xmlrpc_server_method_signature',
      array('array', 'string'),
      'Returns an array describing the return type and required parameters of a method.'
    ),
    array(
      'system.getCapabilities',
      'xmlrpc_server_get_capabilities',
      array('struct'),
      'Returns a struct describing the XML-RPC specifications supported by this server.'
    ),
    array(
      'system.listMethods',
      'xmlrpc_server_list_methods',
      array('array'),
      'Returns an array of available methods on this server.'),
    array(
      'system.methodHelp',
      'xmlrpc_server_method_help',
      array('string', 'string'),
      'Returns a documentation string for the specified method.')
  );
  // We build an array of all method names by combining the built-ins
  // with those defined by modules implementing the _xmlrpc hook.
  // Built-in methods are overridable.
  foreach (array_merge($defaults, (array)$callbacks) as $key => $callback) {
    // we could check for is_array($callback)
    if (is_int($key)) {
      $method = $callback[0];
      $xmlrpc_server->callbacks[$method] = $callback[1];
      $xmlrpc_server->signatures[$method] = $callback[2];
      $xmlrpc_server->help[$method] = $callback[3];
    }
    else {
      $xmlrpc_server->callbacks[$key] = $callback;
      $xmlrpc_server->signatures[$key] = '';
      $xmlrpc_server->help[$key] = '';
    }
  }

  $data = file_get_contents('php://input');
  if (!$data) {
    die('XML-RPC server accepts POST requests only.');
  }

error_log('XMLRPC 5 data: '. print_r($data, TRUE));

  $xmlrpc_server->message = xmlrpc_message($data);

error_log('XMLRPC 5 message: '. print_r($xmlrpc_server->message, TRUE));

  if (!xmlrpc_message_parse($xmlrpc_server->message)) {
    xmlrpc_server_error(-32700, t('Parse error. Request not well formed.'));
  }
  if ($xmlrpc_server->message->messagetype != 'methodCall') {
    xmlrpc_server_error(-32600, t('Server error. Invalid XML-RPC. Request must be a methodCall.'));
  }
  if (!isset($xmlrpc_server->message->params)) {
    $xmlrpc_server->message->params = array();
  }
  xmlrpc_server_set($xmlrpc_server);
  $result = xmlrpc_server_call($xmlrpc_server, $xmlrpc_server->message->methodname, $xmlrpc_server->message->params);

  if (is_object($result) && !empty($result->is_error)) {
    xmlrpc_server_error($result);
  }
  // Encode the result
  $r = xmlrpc_value($result);
  // Create the XML
  $xml = '
<methodResponse>
  <params>
  <param>
    <value>'.
    xmlrpc_value_get_xml($r)
    .'</value>
  </param>
  </params>
</methodResponse>

';
  // Send it
  xmlrpc_server_output($xml);

error_log('XMLRPC 6');
smscotten’s picture

So I added:

if (defined(xmlrpc_server)) {
xmlrpc_server($return);
}
else {
error_log('XMLRPC 5: xmlrpc_server not defined');
}

and got this:

[07-Feb-2010 13:09:02] XMLRPC 1
[07-Feb-2010 13:09:02] XMLRPC 2
[07-Feb-2010 13:09:02] XMLRPC 3
[07-Feb-2010 13:09:02] XMLRPC 4
[07-Feb-2010 13:09:02] XMLRPC 5
[07-Feb-2010 13:09:02] XMLRPC 5: blogapi
[07-Feb-2010 13:09:02] XMLRPC 5: blogapi ok
[07-Feb-2010 13:09:02] XMLRPC 5: drd_server
[07-Feb-2010 13:09:02] XMLRPC 5: drd_server ok
[07-Feb-2010 13:09:02] XMLRPC 5: xmlrpc_server not defined
[07-Feb-2010 13:09:02] XMLRPC 6

smscotten’s picture

OK made changes specified in #16. Result:

[07-Feb-2010 13:13:06] XMLRPC 1
[07-Feb-2010 13:13:06] XMLRPC 2
[07-Feb-2010 13:13:06] XMLRPC 3
[07-Feb-2010 13:13:06] XMLRPC 4
[07-Feb-2010 13:13:06] XMLRPC 5
[07-Feb-2010 13:13:06] XMLRPC 5 data: <?xml version="1.0"?>

drd.api

1.0.17
[07-Feb-2010 13:13:06] XMLRPC 5 message: stdClass Object
(
[array_structs] => Array
(
)

[array_structs_types] => Array
(
)

[current_struct_name] => Array
(
)

[message] => <?xml version="1.0"?>

drd.api

1.0.17
)
jurgenhaas’s picture

So what all that means is that it's working fine. The fact that "XMLRPC 6" is not in the error log is because xml_server_output() calls exit and hence doesn't return to xmlrpc.php

Also, in #13 you wrote that thte log sequence is in the log 3 times which also means that xmlrpc.php has been called 3 times which only happens when DRD is getting reasonable response in approach 1 and 2.

So, I can't really tell what should be finally wrong and can just offer to have a look at your system if you were able to give me access to your system. But that would have to wait until tomorrow as it's already pretty late here.

If you were OK with this please send me a PM with the details.

jurgenhaas’s picture

Status: Active » Postponed (maintainer needs more info)

@Splicer, what's the status of this, can you please give us an update of your situation?

smscotten’s picture

Since there's a new version I'll have to do a new install and see how it works now. I'm sorry, I gave up on getting it to work and don't currently have a d7 install running. I'll try it again soon.

broncomania’s picture

I got the same problem with a self developed modul. Thx at first for the xmlrpc debugging snippet. It helps me really to come closer to the problem. I also use D6 and i can't give because I need a really working solution. So has someone else any ideas where the problem is? Is it maybe a webserver configuration problem or maybe a problem in the service modul? Any help is welcome.

willhowlett’s picture

I'm also getting this error. Guessing there's been no process with it? Can look into getting the maintainer access rights to the sites in question if that helps?

jurgenhaas’s picture

@willhowlett, I'd be glad to have a look into your sites if that's possible. Please contact me via PM or on Skype (jurgenhaas) and we'll find a way to debug and resolve your problem.

willhowlett’s picture

Jurgen has very kindly had a look at our sites.

In our case it turned out the error message was displaying because the DRD Server site did not have the update status module enabled (on our multisite installation we just keep it enabled on one site in order to keep an eye on module statuses - which is something I suspect many other admins do as well). Enabling it caused the error message to disappear, and everything seems to be working properly now.

Great module, sure to be a real time saver. Many thanks.

jurgenhaas’s picture

Status: Postponed (maintainer needs more info) » Fixed

If there will be similar problems please open a separate ticket.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.