Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

If there are no shards in the cluster, the tool fails with an exception #12

Open
dgreene-r7 opened this issue May 2, 2016 · 0 comments

Comments

@dgreene-r7
Copy link
Contributor

Here's the exception:

$ drain asg --asg="my-asg" --region="us-east-1"
Cluster Health  Cluster is healthy
 Found Nodes  AutoScalingGroup: 10.1.1.1 10.1.1.2 10.1.1.3 10.1.1.4
Cluster Health  Cluster is healthy
 Drain Nodes  Draining nodes: asdf1,asdf2,asdf3,asdf4
Removing Node  Removing 10.1.1.1 from Elasticsearch cluster and my-asg AutoScalingGroup
/Users/dgreene/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/node.rb:89:in `in_recovery?': undefined method `values' for nil:NilClass (NoMethodError)
    from /Users/dgreene/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/cli.rb:80:in `remove_node'
    from /Users/dgreene/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/cli.rb:63:in `block in remove_nodes'
    from /Users/dgreene/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/cli.rb:57:in `each'
    from /Users/dgreene/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/cli.rb:57:in `remove_nodes'
    from /Users/dgreene/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/cli.rb:25:in `asg'
    from /Users/dgreene/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/dgreene/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/dgreene/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/dgreene/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/dgreene/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/elasticsearch-drain-0.0.5/bin/drain:3:in `<top (required)>'
    from /Users/dgreene/.rbenv/versions/2.1.5/bin/drain:23:in `load'
    from /Users/dgreene/.rbenv/versions/2.1.5/bin/drain:23:in `<main>'

And this is the sanitized output from the cluster health endpoint:

{
  "cluster_name": "my-cluster",
  "status": "green",
  "timed_out": false,
  "number_of_nodes": 8,
  "number_of_data_nodes": 8,
  "active_primary_shards": 0,
  "active_shards": 0,
  "relocating_shards": 0,
  "initializing_shards": 0,
  "unassigned_shards": 0,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant