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

Accommodate new api changes #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

asebastian-r7
Copy link

@asebastian-r7 asebastian-r7 commented May 14, 2016

There have been some upstream changes in the elasticsearch ecosystem (not sure if it's the gem or the 2.0 elasticsearch api) which require some modifications. Issues occurred using elasticsearch-{api,transport} 1.0.17 with elasticsearch-drain 0.0.5 against a 2.0.0 elasticsearch cluster.

1 - (timeout units) - fixed in 4e26005

/var/lib/gems/2.1.0/gems/elasticsearch-transport-1.0.17/lib/elasticsearch/transport/transport/base.rb:201:in `__raise_transport_error': [400] {"error":{"root_cause":[{"type":"parse_exception","reason":"Failed to parse setting [timeout] with value [60] as a time value: unit is missing or unrecognized"}],"type":"parse_exception","reason":"Failed to parse setting [timeout] with value [60] as a time value: unit is missing or unrecognized"},"status":400} (Elasticsearch::Transport::Transport::Errors::BadRequest)
    from /var/lib/gems/2.1.0/gems/elasticsearch-transport-1.0.17/lib/elasticsearch/transport/transport/base.rb:312:in `perform_request'
    from /var/lib/gems/2.1.0/gems/elasticsearch-transport-1.0.17/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
    from /var/lib/gems/2.1.0/gems/elasticsearch-transport-1.0.17/lib/elasticsearch/transport/client.rb:128:in `perform_request'
    from /var/lib/gems/2.1.0/gems/elasticsearch-api-1.0.17/lib/elasticsearch/api/namespace/common.rb:21:in `perform_request'
    from /var/lib/gems/2.1.0/gems/elasticsearch-api-1.0.17/lib/elasticsearch/api/actions/cluster/health.rb:49:in `health'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/cluster.rb:18:in `health'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/cluster.rb:22:in `healthy?'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/cli.rb:31:in `ensure_cluster_healthy'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/cli.rb:19:in `asg'
    from /var/lib/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /var/lib/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /var/lib/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /var/lib/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/bin/drain:3:in `<top (required)>'
    from /usr/local/bin/drain:23:in `load'
    from /usr/local/bin/drain:23:in `<main>'

2 - (ipaddresses no longer need to be modified) - f27eebd

/var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/node.rb:85:in `address': undefined method `[]' for nil:NilClass (NoMethodError)
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/node.rb:56:in `ipaddress'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/nodes.rb:42:in `block in nodes_in_asg'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/nodes.rb:42:in `each'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/nodes.rb:42:in `find_all'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/nodes.rb:42:in `nodes_in_asg'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain.rb:55:in `active_nodes_in_asg'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/lib/elasticsearch/drain/cli.rb:20:in `asg'
    from /var/lib/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /var/lib/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /var/lib/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /var/lib/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /var/lib/gems/2.1.0/gems/elasticsearch-drain-0.0.5/bin/drain:3:in `<top (required)>'
    from /usr/local/bin/drain:23:in `load'
    from /usr/local/bin/drain:23:in `<main>'

@athompson-r7
Copy link
Contributor

Thanks @asebastian-r7. We need to keep compatibility with 1.7.x for a while, the tests are failing on this branch. I am currently working on a refactor of the test suite to support multiple versions of the server. I hope to have something working in the coming days.

In the meantime, you might push this to a temp branch if others need the 2.x compatibility.

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

Successfully merging this pull request may close these issues.

3 participants