Sort cluster nodes by node.name breaks UI with unassigned replicas #26

Closed
mattijsf opened this Issue Jul 14, 2012 · 3 comments

Projects

None yet

2 participants

@mattijsf

When ElasticSearch is running with one or more unassigned replicas the Cluster Overview page breaks with a javascript error:

Uncaught TypeError: Cannot read property 'name' of undefined 

Can be reproduced using ElasticSearch 0.19.8 with the following index:


$ curl -XPUT 'http://localhost:9200/twitter/' -d '{
    "settings" : {
        "number_of_shards" : 3,
        "number_of_replicas" : 2
    }
}'
@mattijsf

I could fix this by making the following change inside /lib/es/widget.js:

b = second.cluster.name;into:
b = (typeof second.cluster !== "undefined") ? second.cluster.name : second.name;
@mattijsf

Or maybe it is better to guarantee to have the unassigned clusters sorted on the bottom:

if ((typeof second.cluster === "undefined")) return 0;
@mobz
Owner
mobz commented Jul 14, 2012

preferably the order would be

  • master node (at the top)
  • data nodes (in alpha order)
  • client nodes (in alpha order)
  • unassigned ( if any )

I'm on holiday at the moment - would appreciate a patch!

@mobz mobz closed this Jul 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment