Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'node_name' method bug in cluster.rb recipe #271

Closed
xiangyao1989 opened this issue May 26, 2015 · 0 comments
Closed

'node_name' method bug in cluster.rb recipe #271

xiangyao1989 opened this issue May 26, 2015 · 0 comments

Comments

@xiangyao1989
Copy link

Hi there, I got a weird bug in cluster.rb recipe which node_name method prints out the wrong node name by running command rabbitmqctl eval "node()."
I'm using ubuntu 14.04 and Vagrant for my test kitchen, and here comes the result of my test:

First I used rabbitmq 3.3.4 and ran the recipes, here the error message:

buntu-1404","type":"disc"}]] action change_cluster_node_type (rabbitmq::cluster line 41)
       [2015-05-26T19:33:08+00:00] DEBUG: Platform ubuntu version 14.04 found
       [2015-05-26T19:33:08+00:00] INFO: [rabbitmq_cluster] Action change_cluster_node_type ... 
       [2015-05-26T19:33:08+00:00] DEBUG: [rabbitmq_cluster] Executing rabbitmqctl cluster_status
       [2015-05-26T19:33:09+00:00] DEBUG: [rabbitmq_cluster] rabbitmqctl cluster_status : [{nodes,[{disc,['rabbit@rabbit1-ubuntu-1404']}]}, {running_nodes,['rabbit@rabbit1-ubuntu-1404']}, {cluster_name,<<"opower">>}, {partitions,[]}]
       [2015-05-26T19:33:09+00:00] DEBUG: [rabbitmq_cluster] Executing rabbitmqctl eval "node()."
       [2015-05-26T19:33:09+00:00] DEBUG: [rabbitmq_cluster] node name : 'rabbit@rabbit1-ubuntu-1404'
       ...done.
       [2015-05-26T19:33:09+00:00] DEBUG: $$$$$$$$$$$$$$$$$$$$$
       [2015-05-26T19:33:09+00:00] DEBUG: $$$$$$$$$$$$$$$$$$$$$ node_name 'rabbit@rabbit1-ubuntu-1404'
       ...done.
       [2015-05-26T19:33:09+00:00] DEBUG: $$$$$$$$$$$$$$$$$$$$$ cluster_status [{nodes,[{disc,['rabbit@rabbit1-ubuntu-1404']}]}, {running_nodes,['rabbit@rabbit1-ubuntu-1404']}, {cluster_name,<<"opower">>}, {partitions,[]}]
       [2015-05-26T19:33:09+00:00] DEBUG: [rabbitmq_cluster] disc_nodes : 'rabbit@rabbit1-ubuntu-1404'
       [2015-05-26T19:33:09+00:00] DEBUG: ******************************** disc_nodes : ["'rabbit@rabbit1-ubuntu-1404'"]
       [2015-05-26T19:33:09+00:00] DEBUG: $$$$$$$$$$$$$$$$$$$$$ BOOLEAN!!!!! false
       [2015-05-26T19:33:09+00:00] DEBUG: $$$$$$$$$$$$$$$$$$$$$
       [2015-05-26T19:33:09+00:00] DEBUG: [rabbitmq_cluster] disc_nodes : 'rabbit@rabbit1-ubuntu-1404'
       [2015-05-26T19:33:09+00:00] DEBUG: ******************************** disc_nodes : ["'rabbit@rabbit1-ubuntu-1404'"]
       [2015-05-26T19:33:09+00:00] DEBUG: 1
       [2015-05-26T19:33:09+00:00] DEBUG: 2
       [2015-05-26T19:33:09+00:00] DEBUG: [{nodes,[{disc,['rabbit@rabbit1-ubuntu-1404']}]}, {running_nodes,['rabbit@rabbit1-ubuntu-1404']}, {cluster_name,<<"opower">>}, {partitions,[]}]
       [2015-05-26T19:33:09+00:00] DEBUG: ({ram,\[)(.*?)(\]})
       [2015-05-26T19:33:09+00:00] DEBUG: 3

       ================================================================================
       Error executing action `change_cluster_node_type` on resource 'rabbitmq_cluster[[{"name":"rabbit@rabbit1-ubuntu-1404","type":"disc"}]]'
       ================================================================================


       NoMethodError
       -------------
       undefined method `[]' for nil:NilClass

I added more debugging messages there, but you can tell that rabbitmqctl eval "node()." prints out 'rabbit@rabbit1-ubuntu-1404' ...done. instead of the correct node name, which caused error.

Then I changed my rabbitmq version to 3.4.4 which is the default version in the cookbook, and this issue disappeared. But however, I got a similar issue in node_name method since it prints out node name with single quotes and it failed in method parse_cluster_nodes_string since its result doesn't contain single quote out of it.

  var_cluster_node_type = parse_cluster_nodes_string(new_resource.cluster_nodes).select { |node| node['name'] == var_node_name }.first['type'] # ~FC039

Does this issue sound familiar to anyone? Thanks!

Xiang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants