Error while adding node to cluster with provided by plugin role via CLI
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
In Progress
|
Medium
|
Swann Croiset |
Bug Description
The issue has been reproduced using fuel-plugin-
Steps to reproduce:
1) Build and install the plugin (build process, requirements, additional preparing steps for Nailgun has been described on the plugin page).
2) Try to assign nodes for cluster with provided by the plugin roles via CLI:
fuel --env 1 node set --node-id 1 --role kubernetes-
Expected result:
nodes are assigned
Actual result:
500 Server Error: Internal Server Error for url: http://
File "/usr/lib/
valid_data = method(data, **kwargs)
File "/usr/lib/
dict_
File "/usr/lib/
'cluster': cluster,
File "/usr/lib/
expression = condition[
TypeError: string indices must be integers, not str
)
Version:
Fuel 10.0, iso build #264
The error occurs in validation code here [1]. The reason is that first condition in restrictions, provided for the node role, is string and the access is done with assumption of dict. AFAIU, the first condition for all plugins will be a string because of the way restrictions object is built here [2]. So the solution will to fix code of the plugin adapter so the first restriction matches generally accepted dict format.
Please, note that the error only occurs while using CLI, in case a node is assigned to cluster via UI - everything works as expected as different API handler (and different validator) is invoked.
[0] https:/
[1] https:/
[2] https:/
Changed in fuel: | |
assignee: | Fuel Sustaining (fuel-sustaining-team) → Dmitry Guryanov (dguryanov) |
Changed in fuel: | |
assignee: | Swann Croiset (swann-w) → nobody |
Changed in fuel: | |
assignee: | nobody → Swann Croiset (swann-w) |
I'm hitting this bug on MOS 9 (iso fuel-9.0-367)
I use Elasticsearch- Kibana plugin. kibana node.
The initial deployment works fine with 1 controller + 1 elasticsearch-
After adding a new Elasticsearch- kibana node through the Fuel UI (not the CLI) I get this error:
2016-05-30 09:27:59.632 ERROR [7f1e3bfc7880] (manager) Traceback (most recent call last): python2. 7/site- packages/ nailgun/ task/manager. py", line 57, in _call_silently python2. 7/site- packages/ nailgun/ task/task. py", line 1450, in execute _check_ nodes_roles( task) python2. 7/site- packages/ nailgun/ task/task. py", line 1531, in _check_nodes_roles python2. 7/site- packages/ nailgun/ api/v1/ validators/ assignment. py", line 153, in check_roles_ requirement 'condition' ]
File "/usr/lib/
to_return = method(task, *args, **kwargs)
File "/usr/lib/
cls.
File "/usr/lib/
roles, roles_metadata, models)
File "/usr/lib/
expression = condition[
TypeError: string indices must be integers, not str
adding a print here[0] to debug the issue, the 'condition' variable is a string not a hash:
['settings: elasticsearch_ kibana. metadata. enabled == false']
[0] https:/ /github. com/openstack/ fuel-web/ blob/f38238175f 7f9424fd642d822 6d49befd62210b5 /nailgun/ nailgun/ api/v1/ validators/ assignment. py#L151