Project

General

Profile

Bug #7448

XMLRPC Sync failure notice is ugly/long exception from cURL rather than our usual custom message

Added by Jim Pingle 9 months ago. Updated 8 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
XmlRPC
Target version:
Start date:
04/04/2017
Due date:
% Done:

100%

Affected Version:
2.4
Affected Architecture:
All

Description

On 2.4, if an XMLRPC sync attempt fails, a notice is displayed by the firewall but it contains a cURL exception error:

CurlException calling XMLRPC method host_firmware_version #HTTP_Request2_ConnectionException: Unable to connect to tls://172.16.1.3:443. Error: Operation timed out in /usr/local/share/pear/HTTP/Request2/Adapter/Socket.php on line 332
#0 /usr/local/share/pear/HTTP/Request2/Adapter/Socket.php(332): HTTP_Request2_SocketWrapper->__construct('tls://172.16.1....', 10, Array)
#1 /usr/local/share/pear/HTTP/Request2/Adapter/Socket.php(128): HTTP_Request2_Adapter_Socket->connect()
#2 /usr/local/share/pear/HTTP/Request2.php(946): HTTP_Request2_Adapter_Socket->sendRequest(Object(HTTP_Request2))
#3 /usr/local/share/pear/XML/RPC2/Util/HTTPRequest.php(234): HTTP_Request2->send()
#4 /usr/local/share/pear/XML/RPC2/Backend/Php/Client.php(115): XML_RPC2_Util_HTTPRequest->sendRequest()
#5 /etc/inc/xmlrpc_client.inc(102): XML_RPC2_Backend_Php_Client->__call('host_firmware_v...', Array)
#6 /etc/inc/xmlrpc_client.inc(102): XML_RPC2_Backend_Php_Client->host_firmware_version('')
#7 /etc/inc/xmlrpc_client.inc(152): pfsense_xmlrpc_client->xmlrpc_internal('host_firmware_v...', '', 240)
#8 /etc/rc.filter_synchronize(95): pfsense_xmlrpc_client->xmlrpc_method('host_firmware_v...')
#9 /etc/rc.filter_synchronize(356): carp_check_version()
#10 {main} @ 2017-04-04 13:41:08

In this past this was a much more friendly error message, such as "A communications error occurred while attempting XMLRPC sync ..." and it printed the username and target URL.

Looks like we need to catch that exception and setup our own handling and notice.

Associated revisions

Revision 593f0521
Added by Jim Pingle 9 months ago

Improve XMLRPC failure messages/exception handling. Fixes #7448

History

#1 Updated by Jim Pingle 9 months ago

  • Assignee set to Jim Pingle

To me, I have a patch.

#2 Updated by Jim Pingle 9 months ago

  • Status changed from Confirmed to Feedback
  • % Done changed from 0 to 100

#3 Updated by Jim Pingle 8 months ago

  • Status changed from Feedback to Resolved

This looks much better now. Failures have a short and meaningful error message instead of a stack trace.

Also available in: Atom PDF