Python-based alternative for clustercheck does not work with HAProxy

Bug #1210239 reported by Ovais Tariq on 2013-08-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraDB Cluster moved to
Fix Released

Bug Description

The Python based pyclustercheck script does not work with HAProxy, reason being that HAProxy sends an OPTIONS header first which BaseHTTPServer.HTTPServer does not understand most probably.

Following is the error that is reported: - - [09/Aug/2013 04:00:59] code 501, message Unsupported method ('OPTIONS') - - [09/Aug/2013 04:00:59] "OPTIONS / HTTP/1.0" 501 -
Traceback (most recent call last):
  File "/usr/lib64/python2.6/", line 283, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib64/python2.6/", line 309, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib64/python2.6/", line 322, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib64/python2.6/", line 617, in __init__
  File "/usr/lib64/python2.6/", line 329, in handle
  File "/usr/lib64/python2.6/", line 320, in handle_one_request
    self.send_error(501, "Unsupported method (%r)" % self.command)
  File "/usr/lib64/python2.6/", line 357, in send_error
    self.send_response(code, message)
  File "/usr/lib64/python2.6/", line 385, in send_response
    self.send_header('Date', self.date_time_string())
  File "/usr/lib64/python2.6/", line 390, in send_header
    self.wfile.write("%s: %s\r\n" % (keyword, value))
  File "/usr/lib64/python2.6/", line 324, in write
  File "/usr/lib64/python2.6/", line 303, in flush
    self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 32] Broken pipe

Seems HAProxy uses OPTIONS HTTP method to check on server health as a lightweight alternative.

The script only supports GET, so the workaround is to specify the method as GET, details here

Changed in percona-xtradb-cluster:
milestone: none → 5.5.33-23.7.6
status: New → Triaged
David Busby (d-busby) wrote :

Committed a fix here:

Differs to the do_GET method; please let me know if this does not suffice.

Changed in percona-xtradb-cluster:
status: Triaged → Fix Committed

Verified with 'curl -X OPTIONS'.

Changed in percona-xtradb-cluster:
status: Fix Committed → Fix Released

Percona now uses JIRA for bug reports so this bug report is migrated to:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers