Before indexing reference, it should check whether the python list data type is empty in order to make the code more robust
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack DBaaS (Trove) |
In Progress
|
Undecided
|
tianhui |
Bug Description
I used the 'trove cluster-create' cli build a mongodb cluster named 'c1', then used 'trove cluster-instance c1' to see the cluster intances informations.i got the error below in the log file:
Error: "/usr/lib/
Finally, i figure out that the error is caused by my improper network configuration, I got get_visible_
it's obviously the get_visible_
Changed in trove: | |
assignee: | nobody → Janice-Chen (784059080-c) |
summary: |
- Python list type data before indexing reference should check whether the - List is empty in order to make the code more robust + Before indexing reference, it should check whether the python list data + type is empty in order to make the code more robust |
Changed in trove: | |
status: | New → Invalid |
With trove/ocata over ubuntu/xenial, this bug also arises when deploying mariadb/galera cluster:
2017-07-07 12:41:24.250 7 ERROR oslo_messaging. rpc.server Traceback (most recent call last): rpc.server File "/var/lib/ kolla/venv/ local/lib/ python2. 7/site- packages/ oslo_messaging/ rpc/server. py", line 155, in _process_incoming rpc.server res = self.dispatcher .dispatch( message) rpc.server File "/var/lib/ kolla/venv/ local/lib/ python2. 7/site- packages/ oslo_messaging/ rpc/dispatcher. py", line 222, in dispatch rpc.server return self._do_ dispatch( endpoint, method, ctxt, args) rpc.server File "/var/lib/ kolla/venv/ local/lib/ python2. 7/site- packages/ oslo_messaging/ rpc/dispatcher. py", line 192, in _do_dispatch rpc.server result = func(ctxt, **new_args) rpc.server File "/var/lib/ kolla/venv/ local/lib/ python2. 7/site- packages/ osprofiler/ profiler. py", line 153, in wrapper rpc.server return f(*args, **kwargs) rpc.server File "/var/lib/ kolla/venv/ local/lib/ python2. 7/site- packages/ trove/taskmanag er/manager. py", line 395, in create_cluster rpc.server cluster_ tasks.create_ cluster( context, cluster_id) rpc.server File "/var/lib/ kolla/venv/ local/lib/ python2. 7/site- packages/ trove/common/ strategies/ cluster/ experimental/ galera_ common/ taskmanager. py", line 141, in create_cluster rpc.server _create_cluster() rpc.server File "/var/lib/ kolla/venv/ local/lib/ python2. 7/site- packages/ trove/common/ strategies/ cluster/ experimental/ galera_ common/ taskmanager. py", line 88, in _create_cluster rpc.server cluster_ips = [self.get_ ip(instance) for instance in instances] rpc.server File "/var/lib/ kolla/venv/ local/lib/ python2. 7/site- packages/ trove/taskmanag er/models. py", line 215, in get_ip rpc.server return instance. get_visible_ ip_addresses( )[0] rpc.server IndexError: list index out of range rpc.server
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.
2017-07-07 12:41:24.250 7 ERROR oslo_messaging.