# ":error\_message=\>"undefined method \`sanitized'"

**URL:** <https://discuss.elastic.co/t/error-message-undefined-method-sanitized/104088>\
**Category:** Logstash\
**Created:** [October 16, 2017, 12:11pm UTC](https://discuss.elastic.co/t/error-message-undefined-method-sanitized/104088 "2017-10-16T12:11:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyderNBK117](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hyderNBK117](https://discuss.elastic.co/u/hyderNBK117)\
**Post date:** [October 16, 2017, 12:11pm UTC](https://discuss.elastic.co/t/error-message-undefined-method-sanitized/104088/1 "2017-10-16T12:11:58Z")

</div>

Hi,

My Elastic Stack solution works fine until, seemingly at random, logstash instances starts to log this exception and stops inputting into the elastic search cluster.

```
[2017-10-16T13:00:57,215][ERROR][logstash.outputs.elasticsearch] Encountered an unexpected error submitting a bulk request! Will retry. {:error_message=>"undefined method `sanitized' for \"http://10.44.129.198:9200/_bulk\":String", :class=>"NoMethodError", :backtrace=>["c:/Work/files/ELK/logstash-5.6.2/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:249:in `safe_bulk'", "c:/Work/files/ELK/logstash-5.6.2/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:222:in `safe_bulk'", "c:/Work/files/ELK/logstash-5.6.2/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:119:in `submit'", "c:/Work/files/ELK/logstash-5.6.2/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:87:in `retrying_submit'", "c:/Work/files/ELK/logstash-5.6.2/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-7.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:38:in `multi_receive'", "c:/Work/files/ELK/logstash-5.6.2/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:13:in `multi_receive'", "c:/Work/files/ELK/logstash-5.6.2/logstash-core/lib/logstash/output_delegator.rb:49:in `multi_receive'", "c:/Work/files/ELK/logstash-5.6.2/logstash-core/lib/logstash/pipeline.rb:436:in `output_batch'", "org/jruby/RubyHash.java:1342:in `each'", "c:/Work/files/ELK/logstash-5.6.2/logstash-core/lib/logstash/pipeline.rb:435:in `output_batch'", "c:/Work/files/ELK/logstash-5.6.2/logstash-core/lib/logstash/pipeline.rb:381:in `worker_loop'", "c:/Work/files/ELK/logstash-5.6.2/logstash-core/lib/logstash/pipeline.rb:342:in `start_workers'"]}

```

Please, what is the cause of this issue and how can I fix it?

Kind Regards,

Hyder

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 19, 2017, 9:22am UTC](https://discuss.elastic.co/t/error-message-undefined-method-sanitized/104088/3 "2017-10-19T09:22:40Z")

</div>

Please show your config and provide the version you are running.

---

<div class="post-metadata">

**Author:** ![hyderNBK117](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hyderNBK117](https://discuss.elastic.co/u/hyderNBK117)\
**Post date:** [October 19, 2017, 9:46am UTC](https://discuss.elastic.co/t/error-message-undefined-method-sanitized/104088/4 "2017-10-19T09:46:20Z")

</div>

Hi,

Logstash version 5.6.2 and the config is below:

```
input {
  jdbc {
    jdbc_driver_library => "C:\Program Files\Java\sqljdbc_6.2\enu\mssql-jdbc-6.2.1.jre8.jar"
    jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    jdbc_connection_string => "jdbc:sqlserver://xxxxxxxx;databaseName=xxxxxxxx"
	jdbc_validate_connection => true
    jdbc_user => "xxxxxx"
    jdbc_password => "xxxxxx"
    statement => "SELECT * FROM [Database].[dbo].[Table] with (NOLOCK) where [RecordedTime] > '2017-10-13'"
	type => "CustomType"
	jdbc_fetch_size => 15
  }
}
output {
  elasticsearch 
  {
    hosts => ["10.34.29.37:9200","10.34.29.12:9200","10.34.29.50:9200"] 
    index => "test-%{+YYYY.MM.dd}" 
    document_type => "CustomType" 
	document_id => "%{id}"
	http_compression => true
	user => xxxxxxx
    password => xxxxxxx
  }
  stdout { codec => rubydebug }
}

```

I think it is Elastic Search rejecting the bulk request due to its size but Logstash is retrying the request hence then getting stuck in an endless loop. I came to this conclusion as I upgraded to 5.6.3 and got a different error, more info is [here](https://discuss.elastic.co/t/logstash-5-6-1-inifinite-loop-encountered-a-retryable-error/101753/18?u=hydernbk117)

---

<div class="post-metadata">

**Author:** ![hyderNBK117](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hyderNBK117](https://discuss.elastic.co/u/hyderNBK117)\
**Post date:** [October 31, 2017, 2:29pm UTC](https://discuss.elastic.co/t/error-message-undefined-method-sanitized/104088/5 "2017-10-31T14:29:50Z")

</div>

@warkolm Any update? I found the below question and I replied to it as well as think these two issues are related.

> [@Logstash 5.6.1 inifinite loop? Encountered a retryable error](https://discuss.elastic.co/t/logstash-5-6-1-inifinite-loop-encountered-a-retryable-error/101753/18):
>
> I have the same issue, I originally had Logstash 5.6.2 and got the santized error message. I upgraded to 5.6.3 and now get the reported error message. [logstash.outputs.elasticsearch] Encountered a retryable error. Will Retry with exponential backoff {:code=\>400, :url=\> I'm importing data from Sql using the JDBC. Is this where a message is too big for elastic search and it fails? I have another Logstash input which is running with smaller document sizes and it processes for hours before tha…

---

<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:** [November 28, 2017, 2:29pm UTC](https://discuss.elastic.co/t/error-message-undefined-method-sanitized/104088/6 "2017-11-28T14:29:56Z")

</div>

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