# Failed to flush outgoing items

**URL:** <https://discuss.elastic.co/t/failed-to-flush-outgoing-items/2215>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [June 9, 2015, 12:31pm UTC](https://discuss.elastic.co/t/failed-to-flush-outgoing-items/2215 "2015-06-09T12:31:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![msgre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/msgre/32/576_2.png) [@msgre](https://discuss.elastic.co/u/msgre)\
**Post date:** [June 9, 2015, 12:31pm UTC](https://discuss.elastic.co/t/failed-to-flush-outgoing-items/2215/1 "2015-06-09T12:31:02Z")

</div>

Hello,  
I tried set up ELB stack in single Vagrant machine based on Ubuntu 14.04 amd64 box. Whole stack was functional (ES 1.5.2, LS 1.5.0-1\_all, Kibana 4.0.2-linux-x64) until I install Watcher plugin. It seems that Logstash couldn't connect to ES:

```auto
{:timestamp=>"2015-06-09T12:13:42.021000+0000", :message=>"Got error to send bulk of actions to elasticsearch server at logger : blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];[SERVICE_UNAVAILABLE/2/no master];", :level=>:error, :file=>"logstash/o
utputs/elasticsearch.rb", :line=>"464", :method=>"flush"}
{:timestamp=>"2015-06-09T12:13:42.022000+0000", :message=>"Failed to flush outgoing items", :outgoing_count=>2, :exception=>org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];[SERVICE_UNAVAILABLE/
2/no master];, :backtrace=>["org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedException(org/elasticsearch/cluster/block/ClusterBlocks.java:151)", "org.elasticsearch.cluster.block.ClusterBlocks.globalBlockedRaiseException(org/elasticsearch/cluster/block/Cluster
Blocks.java:141)", "org.elasticsearch.action.bulk.TransportBulkAction.executeBulk(org/elasticsearch/action/bulk/TransportBulkAction.java:210)", "org.elasticsearch.action.bulk.TransportBulkAction.access$000(org/elasticsearch/action/bulk/TransportBulkAction.java:73)", "or
g.elasticsearch.action.bulk.TransportBulkAction$1.onFailure(org/elasticsearch/action/bulk/TransportBulkAction.java:148)", "org.elasticsearch.action.support.TransportAction$ThreadedActionListener$2.run(org/elasticsearch/action/support/TransportAction.java:137)", "java.ut
il.concurrent.ThreadPoolExecutor.runWorker(java/util/concurrent/ThreadPoolExecutor.java:1142)", "java.util.concurrent.ThreadPoolExecutor$Worker.run(java/util/concurrent/ThreadPoolExecutor.java:617)", "java.lang.Thread.run(java/lang/Thread.java:745)"], :level=>:warn, :fi
le=>"stud/buffer.rb", :line=>"231", :method=>"buffer_flush"}

```

When I removed Watcher plugin my ELB stack start working.

LS config:

```auto
input {
  file {
    path => "/var/log/syslog"
    type => "syslog"
  }

  udp {
    port => 30001
  }

  heartbeat {
  }
}

output {
    elasticsearch {
        host => "logger"
        cluster => "logstash"
    }
}

```

ES config:

```auto
cluster.name: "logstash"
node.name: "logger"
network.host: logger

```

/etc/hosts:

```auto
127.0.0.1	localhost
127.0.1.1 logger.vbox logger

```

---

<div class="post-metadata">

**Author:** ![jsvd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsvd/32/6203_2.png) [@jsvd](https://discuss.elastic.co/u/jsvd)\
**Post date:** [June 9, 2015, 12:44pm UTC](https://discuss.elastic.co/t/failed-to-flush-outgoing-items/2215/2 "2015-06-09T12:44:28Z")

</div>

Could you try switching "protocol =\> transport" and checking that it works?

---

<div class="post-metadata">

**Author:** ![msgre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/msgre/32/576_2.png) [@msgre](https://discuss.elastic.co/u/msgre)\
**Post date:** [June 9, 2015, 1:07pm UTC](https://discuss.elastic.co/t/failed-to-flush-outgoing-items/2215/3 "2015-06-09T13:07:07Z")

</div>

> [@jsvd](#):
>
> "protocol =\> transport"

Wow, it works! You are my hero.

(by the way, with this new config I see much more responsive logstash process; without `protocol => transport` I wasn't able to restart logstash with `service logstash restart`, I must kill it manually and then start it)

Thank you very much

---

<div class="post-metadata">

**Author:** ![vitalyb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vitalyb/32/3913_2.png) [@vitalyb](https://discuss.elastic.co/u/vitalyb)\
**Post date:** [July 30, 2015, 6:50am UTC](https://discuss.elastic.co/t/failed-to-flush-outgoing-items/2215/4 "2015-07-30T06:50:51Z")

</div>

I was having the same issue, even after I uninstalled the plugin.

Just to clarify, this what your logstash config should look like to be fixed:

```
elasticsearch {
    host => "127.0.0.1"
    manage_template => false
    index => "..."
    cluster => "..."
    protocol => "transport"
}

```

Could you elaborate on what's going on? Why did the plugin mess it up?

---

<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:** [July 6, 2017, 1:49pm UTC](https://discuss.elastic.co/t/failed-to-flush-outgoing-items/2215/5 "2017-07-06T13:49:09Z")

</div>


