# Can't connect to localhost port with EtcdNettyClient in plugin code

**URL:** <https://discuss.elastic.co/t/cant-connect-to-localhost-port-with-etcdnettyclient-in-plugin-code/162885>\
**Category:** Elasticsearch\
**Created:** [January 4, 2019, 2:19am UTC](https://discuss.elastic.co/t/cant-connect-to-localhost-port-with-etcdnettyclient-in-plugin-code/162885 "2019-01-04T02:19:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![poitevinpm](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@poitevinpm](https://discuss.elastic.co/u/poitevinpm)\
**Post date:** [January 4, 2019, 2:19am UTC](https://discuss.elastic.co/t/cant-connect-to-localhost-port-with-etcdnettyclient-in-plugin-code/162885/1 "2019-01-04T02:19:27Z")

</div>

Hi all!

I am developing a script plugin that uses a dynamic config via etcd. I am using elasticsearch 6.3.2.  
However, when I run an etcd cluster locally (and verify it is actually up) on the port 2379, and I try to connect to the etcd cluster (via EtcdKeyGetRequest.send()), I see this error in the logs:

```
DEBUG mousio.etcd4j.transport.EtcdNettyClient - Connection failed to http://127.0.0.1:2379

```

I don't see any reason why the connection would fail. Is there any limitation in the plugin framework?

Please let me know if you have any insight regarding my issue.

Thanks!

Pierre

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 4, 2019, 6:50am UTC](https://discuss.elastic.co/t/cant-connect-to-localhost-port-with-etcdnettyclient-in-plugin-code/162885/2 "2019-01-04T06:50:55Z")

</div>

Do you have a full stacktrace error?

May be you need to adapt this: [https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugin-authors.html#plugin-authors-jsm](https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugin-authors.html#plugin-authors-jsm)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 1, 2019, 6:51am UTC](https://discuss.elastic.co/t/cant-connect-to-localhost-port-with-etcdnettyclient-in-plugin-code/162885/3 "2019-02-01T06:51:05Z")

</div>

Closed on February 1, 2019, 6:51am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
