# Unable to connect to slack from elastic notification alerting

**URL:** <https://discuss.elastic.co/t/unable-to-connect-to-slack-from-elastic-notification-alerting/242539>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [July 24, 2020, 4:50pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-slack-from-elastic-notification-alerting/242539 "2020-07-24T16:50:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_Mightiev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_mightiev/32/62186_2.png) [@A\_Mightiev](https://discuss.elastic.co/u/A_Mightiev)\
**Post date:** [July 24, 2020, 4:50pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-slack-from-elastic-notification-alerting/242539/1 "2020-07-24T16:50:39Z")

</div>

I have an issue connecting to slack from elasticsearch action notifications.  
to access https from the node, I need to use a proxy i.e.  
if I do a

```auto
[]# curl -v https://hooks.slack.com -x http://proxy.domain.com:5050 
* About to connect() to proxy proxy.domain.com port 5050 (#0)
* Trying (IP)
* Connected to proxy.domain.com (ip) port 5050 (#0)
* Establish HHTP proxy tunnel to hooks.slack.co:443
> CONNECT hooks.slack.com:443

```

It says HTTP/1.1 200 Connection Established

In my Action I specify the proxy:

```auto
"actions":{
    "slack_1": {
      "slack":{
         "proxy":{
            "host": "http://proxy.domain.com"
             "port": 5050
         }
       }
    }
   }
}

```

But I get the following error:

```auto
[2020-07-24T18:33:17,736][ERROR][o.e.x.w.n.s.SlackService] [elastic] failed to execute slack api http request
java.net.UnknownHostException: http://proxy.domain.com: Name or service not known
       at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:?]
       at java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:930) ~[?:?]
       at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1499) ~[?:?]
       at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:849) ~[?:?]
       at java.net.InetAddress.getAllByName0(InetAddress.java:1489) ~[?:?]
       at java.net.InetAddress.getAllByName(InetAddress.java:1348) ~[?:?]
       at java.net.InetAddress.getAllByName(InetAddress.java:1282) ~[?:?]
       at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45) ~[httpclient-4.5.10.jar:4.5.10]
       at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112) ~[httpclient-4.5.10.jar:4.5.10]
       at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374) ~[httpclient-4.5.10.jar:4.5.10]
       at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:401) ~[httpclient-4.5.10.jar:4.5.10]
       at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) ~[httpclient-4.5.10.jar:4.5.10]
       at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) ~[httpclient-4.5.10.jar:4.5.10]
       at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.10.jar:4.5.10]
       at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[httpclient-4.5.10.jar:4.5.10]
       at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[httpclient-4.5.10.jar:4.5.10]
       at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72) ~[httpclient-4.5.10.jar:4.5.10]

```

Looks to me that is not even trying the port. my web hook I'm specifying it in the key store.  
Any ideas what is wrong?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 29, 2020, 2:12pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-slack-from-elastic-notification-alerting/242539/2 "2020-07-29T14:12:11Z")

</div>

What Elasticsearch version are you trying this on?

---

<div class="post-metadata">

**Author:** ![A\_Mightiev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_mightiev/32/62186_2.png) [@A\_Mightiev](https://discuss.elastic.co/u/A_Mightiev)\
**Post date:** [July 30, 2020, 12:14pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-slack-from-elastic-notification-alerting/242539/3 "2020-07-30T12:14:39Z")

</div>

> [@A\_Mightiev](#):
>
> `"host": "http://proxy.domain.com"`

Changing it to

```auto
"host": "proxy.domain.com"

```

worked

---

<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:** [August 27, 2020, 12:14pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-slack-from-elastic-notification-alerting/242539/4 "2020-08-27T12:14:40Z")

</div>

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