Good morning.

Does prod check has requirements regarding the xmlrpc calls?
I succeeded to connection this great module to all my websites but one and I see no reason why not.
- htaccess protection? I put xmlrpc on the whitelist and it does not work even when htaccess is disabled,
- wrong key? I copy paste the one from a working site and still not working,
- wrong xmlrpc activation? I activate it several times, flush any possible cache.

So I am quite lost here

As the error is "Failed to retrieve settings form from remote site, please verify the given URL and try again!", it comes from

function _prod_monitor_retrieve_functions($url, $api_key, $msg = TRUE).,

Any idea? Thanks.

Julien.

Comments

JulienThomas’s picture

For more information, I updated _prod_monitor_retrieve_functions($url, $api_key, $msg = TRUE) with

    drupal_set_message("Error is: ".var_export(xmlrpc_error(),true),
      'error'
    );

And I get

Error is: stdClass::__set_state(array( 'is_error' => true, 'code' => -32700, 'message' => 'Parse error. Not well formed', ))

And if I compare xmlrpc.php results, I see the following differences on the HTTP headers:
- working sites, port 80 (nginx) or 8080: content-length:60 -- php 5.3.3
- not working site: port 80: content-length:0, 8080: content-length:43 -- php 5.4
Can any of this be the reason?

Import is tested both with http://url/ and http://url:8080/

aklump’s picture

I too have having trouble, and with just ONE website as well.

  • prod_monitor 1.8 is running in Drupal 7.24
  • prod_check 1.8 is running on Drupal 7.23

As far as I've been able to debug, the string of XML that is returned is getting prematurely truncated in the function drupal_http_request() so that I'm able to see before line 989 is executed list($response, $result->data) = preg_split("/\r\n\r\n|\n\n|\r\r/", $response, 2); that the value of $response is truncated (see below). So the XML is malformed and the request fails.

What's interesting is that if I use a standalone REST tester, the response comes back just fine from the server; so the server (prod_check) is serving up the XML fine. This suggests that there might be a bug in drupal_http_request, potentially. But I'm stumped at this point.

$response = (string) HTTP/1.1 200 OK Date: Sat, 14 Dec 2013 03:28:18 GMT Server: Apache X-Powered-By: PHP/5.3.14 Expires: Sun, 19 Nov 1978 05:00:00 GMT Last-Modified: Sat, 14 Dec 2013 03:28:18 +0000 Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0 ETag: "1386991698" Content-Length: 5684 Connection: close Content-Type: text/xml   <?xml version="1.0"?>  <methodResponse>   <params>   <param>     <value><struct>   <member><name>settings</name><value><struct>   <member><name>title</name><value><string>Settings</string></value></member>   <member><name>description</name><value><string>Checks wether various settings are fit for a production environment.</string></value></member>   <member><name>functions</name><value><struct>   <member><name>_prod_check_error_reporting</name><value><string>Error reporting</string></value></member>   <member><name>_prod_check_user_register</name><value><string>User registration</string></value></member>   <member><name>_prod_check_site_mail</name><value><string>Site e-mail<
JulienThomas’s picture

Issue summary: View changes

I just review the new version of xmlrpc.inc and still issue (after Drupal 3.71).

I edited xmlrpc.inc

and changed function

_xmlrpc($url, $args, $options = array()) {

at line

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

to

 $message = xmlrpc_message(str_replace(array("\r", "\n"), '',trim($result->data))); 

It seems that the server added extra line between the xml header tag and the content.

Does this fix yours too, aklump?

malc0mn’s picture

Could it maybe be that this one particular site that is causing trouble, has something like this in the code somewhere:

// white line here without anything on it, safe for maybe a space
<?php

[rest of the code follows]

or maybe just a closing ?> php call at the end of a file followed by an empty line or something like that?

[code here]

?>
// white line here without anything on it, safe for maybe a space
marcoka’s picture

this is an interesting topic as i have the same problem getting \\n added infront of the tag and that makes the drupal core fail getting the root tag.

pawel.traczynski’s picture

For me the solution was to change one of my module files that was being loaded when drupal was bootstraping. THe issue was the file was in UTF with BOM. I have changed it to "UTF without BOM" and it solved the problem.

Anybody’s picture

Status: Active » Closed (outdated)