Bug #77075 Mysql Fabric wrong fabric server host return - using python connector
Submitted: 18 May 2015 15:21 Modified: 26 May 2015 10:38
Reporter: Hai La Son Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Fabric Severity:S2 (Serious)
Version:1.5.4 OS:Linux
Assigned to: Paulo Jesus CPU Architecture:Any

[18 May 2015 15:21] Hai La Son
Description:
When using python connector to connect to fabric node (different hosts), during connection initialization, fabric host value return is '0.0.0.0' which is protocol.xmlrpc config rather than fabric's actual address. 

Hence the next steps fail, result in error:

InterfaceError: Connection with Fabric failed: <urlopen error [Errno 111] Connection refused>

How to repeat:
At Fabric node (x.x.x.A): 

fabric.cfg
...
[protocol.xmlrpc]
address = 0.0.0.0:32274
....

Application host (x.x.x.B):

python
>> import mysql.connector as connector
>> fabric_params = dict(host='x.x.x.A', username='admin', ...)
>> connector.connect(fabric=fabric_params, user='group', password='', autocommit=True)

DEBUG: 
... mysql/connector/fabric/connection.py

    449         # Update the Fabric servers
                print fabrics                     # DEBUG line
    450         for fabric in fabrics:
    451             inst = FabricConnection(self, fabric['host'], fabric['port'],
    452                                     connect_attempts=self._connect_attempts,
    453                                     connect_delay=self._connect_delay)
    454             inst_uuid = inst.uuid

>> [{'host': '0.0.0.0', 'port': 32274}]  # host should be 'x.x.x.A' ??

Suggested fix:
Check and return fabric node actual address instead.
[25 May 2015 14:42] Paulo Jesus
Thank you for the bug report.

Can you please indicate what version of connector/python are being used?
[26 May 2015 7:02] Hai La Son
I used python connector from mysql utilities 1.5.4 on python 2.7.3
[26 May 2015 10:01] Paulo Jesus
Thank you. 

As a workaround you can replace 0.0.0.0 by the specific IP address for your Fabric node.

Note: connector/python version used 2.0.2.
[26 May 2015 10:38] Hai La Son
Thank you for you response.

Right it is 'MySQL Connector Python/2.0.2' when I checked request header. It works like charm when change config to actual node host address.
[26 May 2015 14:26] Paulo Jesus
You are welcome. Thank you for your feedback.
[6 Jul 2017 19:19] Bugs System
Status updated to 'Won't fix' (Fabric is now covered under Oracle Lifetime Sustaining Support)