# Got a bad response code from server, but this code is not considered retryable

**URL:** <https://discuss.elastic.co/t/got-a-bad-response-code-from-server-but-this-code-is-not-considered-retryable/124487>\
**Category:** Logstash\
**Created:** [March 19, 2018, 6:33am UTC](https://discuss.elastic.co/t/got-a-bad-response-code-from-server-but-this-code-is-not-considered-retryable/124487 "2018-03-19T06:33:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wentao](https://avatars.discourse-cdn.com/v4/letter/w/a9adbd/32.png) [@wentao](https://discuss.elastic.co/u/wentao)\
**Post date:** [March 19, 2018, 6:33am UTC](https://discuss.elastic.co/t/got-a-bad-response-code-from-server-but-this-code-is-not-considered-retryable/124487/1 "2018-03-19T06:33:28Z")

</div>

hello,i have a question when i use the logstash. everythind looks ok, but my data of my kibana is slower and slower.There is an hour gap now，eg：now time is 8:20，but the data of kibana only show up to 7:32.Simultaneously，there is a error in my logstash's logs.It's show below:  
[ERROR][logstash.outputs.elasticsearch] Got a bad response code from server, but this code is not considered retryable. Request will be dropped {:code=\>504, :response\_body=\>""}

please help me,thank you very much!!!

my logstash.conf as below:

input {  
kafka {  
bootstrap\_servers =\> "xx.xx.xx.xx:9092,xx.xx.xx.xx:9092,xx.xx.xx.xx:9092"  
group\_id =\> 'logstash\_server'  
topics =\> ['nginx\_slb\_log']  
consumer\_threads =\> 10  
decorate\_events =\> true  
codec =\> json {  
charset =\> "UTF-8"  
}  
}  
}  
filter {  
if [type] == 'nginx\_slb\_log' {  
ruby {  
init =\> "@kname = ['time\_local', 'request\_id', 'request\_time', 'remote\_addr\_port', 'status', 'request\_method', 'request\_url','server\_protocol','request\_length','bytes\_sent','upstream\_addr\_all','sent\_http\_content\_type','http\_referer','http\_user\_agent','upstream\_response\_time','upstream\_status','ssl\_cipher','ssl\_protocol','ssl\_session\_id','ssl\_session\_reused','ssl\_server\_name','ssl\_client\_verify','tcpinfo\_rtt','tcpinfo\_rttvar','tcpinfo\_snd\_cwnd','tcpinfo\_rcv\_space','request\_completion']"  
code =\> "  
new\_event = LogStash::Event.new(Hash[@kname.zip(event.get('message').split('|'))])  
new\_event.remove('@timestamp')  
event.append(new\_event)  
temp\_value = event.get('time\_local').strip  
event.set('time\_local', temp\_value[1..(temp\_value.length-2)])  
event.set('upstream\_status', event.get('upstream\_status').to\_i)  
"  
}  
if [remote\_addr\_port] {  
ruby {  
init =\> "@kname = ['remote\_addr', 'remote\_port']"  
code =\> "  
new\_event = LogStash::Event.new(Hash[@kname.zip(event.get('remote\_addr\_port').split(':'))])  
new\_event.remove('@timestamp')  
event.append(new\_event)  
"  
remove\_field =\> ["remote\_addr\_port"]  
}  
}  
if [request\_url] {  
ruby {  
code =\> "  
event.set('scheme', event.get('request\_url').split(':')[0])  
event.set('http\_host', event.get('request\_url').split('://')[-1].split('/')[0])  
event.set('request\_uri', event.get('request\_url').split('//')[-1].split('.com')[-1])  
"  
remove\_field =\> ["request\_url"]  
}  
}  
if [upstream\_addr\_all] {  
ruby {  
init =\> "@kname = ['upstream\_addr', 'upstream\_port']"  
code =\> "  
event.set('upstream\_addr\_all', event.get('upstream\_addr\_all').split('/')[-1])  
new\_event = LogStash::Event.new(Hash[@kname.zip(event.get('upstream\_addr\_all').split(':'))])  
new\_event.remove('@timestamp')  
event.append(new\_event)  
"  
}  
}  
mutate {  
convert =\> [  
"request\_time", "float",  
"upstream\_response\_time", "float",  
"bytes\_sent", "integer",  
"request\_length", "integer",  
"status", "integer"  
]  
remove\_field =\> ["beat", "offset", "@version", "message", "kafka", "request\_url", "upstream\_addr\_all"]  
}  
date {  
match =\> ["time\_local", "dd/MMM/yyyy:HH:mm:ss Z"]  
}  
}  
}  
output {  
if [type] == 'nginx\_slb\_log' {  
elasticsearch {  
hosts =\> "[xxx.es.amazonaws.com.cn:443](http://xxx.es.amazonaws.com.cn:443)"  
ssl =\> true  
index =\> "logstash-nginx-slb-%{+YYYY-MM-dd}"  
template\_overwrite =\> true  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 20, 2018, 6:29am UTC](https://discuss.elastic.co/t/got-a-bad-response-code-from-server-but-this-code-is-not-considered-retryable/124487/2 "2018-03-20T06:29:47Z")

</div>

Which version of the elasticsearch output plugin do you have?

---

<div class="post-metadata">

**Author:** ![wentao](https://avatars.discourse-cdn.com/v4/letter/w/a9adbd/32.png) [@wentao](https://discuss.elastic.co/u/wentao)\
**Post date:** [March 22, 2018, 5:48am UTC](https://discuss.elastic.co/t/got-a-bad-response-code-from-server-but-this-code-is-not-considered-retryable/124487/3 "2018-03-22T05:48:47Z")

</div>

i use the logstash5.5.2, the plugin should be 5.5.2,the es is 5.5.2 too

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 22, 2018, 6:54am UTC](https://discuss.elastic.co/t/got-a-bad-response-code-from-server-but-this-code-is-not-considered-retryable/124487/4 "2018-03-22T06:54:10Z")

</div>

The plugins are versioned independently from Logstash so your elasticsearch output plugin version is _not_ 5.5.2. Use the `logstash-plugin` command to list installed plugins and their versions. If you haven't upgraded the plugin yourself you can use the Logstash documentation to get the correct documentation: [https://www.elastic.co/guide/en/logstash/5.2/plugins-outputs-elasticsearch.html](https://www.elastic.co/guide/en/logstash/5.2/plugins-outputs-elasticsearch.html)

As that page states, 504 errors won't be retried, but if you look at the documentation for the current version of Logstash ([https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html)) you can see it states otherwise. So, upgrade Logstash or just your elasticsearch output plugin.

---

<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:** [April 19, 2018, 6:54am UTC](https://discuss.elastic.co/t/got-a-bad-response-code-from-server-but-this-code-is-not-considered-retryable/124487/5 "2018-04-19T06:54:20Z")

</div>

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