Failed action with response of 500, dropping action Logstash1.5.4


(Ngọc Phạm) #1

Hi everybody, im newbie and i try use logstash, elasticsearch to
Search in my Web. One error appear and i dont know how to fix it.
Pls help me , thanks you!
i tried config file .conf look like this ,it work normal , my databse appear in my plugin /head

file: simple-out.conf

input {
jdbc {
jdbc_connection_string => "jdbc:postgresql://localhost:5432/Test"
jdbc_user => "postgres"
jdbc_password =>"lovely19"
jdbc_validate_connection => true
jdbc_driver_library => "/home/ngocpt/Downloads/postgresql-9.4-1202.jdbc4.jar"
jdbc_driver_class => "org.postgresql.Driver"
statement => "SELECT * from users"
}
}
output {
elasticsearch {
protocol => http
index => "users"
document_type => "user"
document_id => "%{id}"
host => "localhost"
}
}

But after i tried mapping one field with analyzer before run logstash index database, i get error.
my mapping look like this:
curl -XPUT "http://localhost:9200/users/" -d'
{
"mappings": {
"user": {
"properties": {
"password" : {
"analyzer" : "vi_analyzer",
"type" : "string"
},
"user_name" : {
"analyzer" : "vi_analyzer",
"type" : "string"
}
}
}
}
}'

Here is my error

failed
action with response of 500, dropping action: ["index", {:_id=>81,
:_index=>"users", :_type=>"user", :_routing=>nil},
#<LogStash::Event:0x6080f83f @metadata_accessors=#<LogStash::Util::Accessors:0xa36e532
@store={"retry_count"=>0}, @lut={}>, @cancelled=false,
@data={"id"=>81, "user_name"=>"dong ho", "password"=>"dong ho",
"sex"=>"male", "photo_id"=>1, "@version"=>"1",
"@timestamp"=>"2015-11-02T10:40:21.245Z"}, @metadata={"retry_count"=>0}, @accessors=#<LogStash::Util::Accessors:0xb7502dc
@store={"id"=>81, "user_name"=>"dong ho", "password"=>"dong
ho", "sex"=>"male", "photo_id"=>1, "@version"=>"1",
"@timestamp"=>"2015-11-02T10:40:21.245Z"},
@lut={"id"=>[{"id"=>81, "user_name"=>"dong ho",
"password"=>"dong ho", "sex"=>"male", "photo_id"=>1,
"@version"=>"1", "@timestamp"=>"2015-11-02T10:40:21.245Z"}, "id"]}>>] {:level=>:warn}

Thanks for your help


(Magnus Bäck) #2

The Elasticsearch logs probably contain additional clues.


(Ngọc Phạm) #3

maybe error in analyzer ~~
i use elastic 1.7.3 , and analyzer sp 1.7+...
error elasticslog in this :smile:

[2015-11-03 08:50:06,826][DEBUG][action.bulk ] [Angelica Jones] [users][4] failed to execute bulk item (index) index {[users][user][77], source[{"id":77,"user_name":"viet nam","password":"viet nam","sex":"female","photo_id":6,"@version":"1","@timestamp":"2015-11-03T01:49:42.702Z"}]}
java.lang.NullPointerException
at org.apache.lucene.analysis.vi.VietnameseTokenizer.(VietnameseTokenizer.java:74)
at org.apache.lucene.analysis.vi.VietnameseTokenizer.(VietnameseTokenizer.java:62)
at org.apache.lucene.analysis.vi.VietnameseAnalyzer.createComponents(VietnameseAnalyzer.java:83)
at org.apache.lucene.analysis.AnalyzerWrapper.createComponents(AnalyzerWrapper.java:113)
at org.apache.lucene.analysis.AnalyzerWrapper.createComponents(AnalyzerWrapper.java:113)
at org.apache.lucene.analysis.Analyzer.tokenStream(Analyzer.java:182)
at org.apache.lucene.document.Field.tokenStream(Field.java:554)
at org.apache.lucene.index.DefaultIndexingChain$PerField.invert(DefaultIndexingChain.java:611)
at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:359)
at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:318)
at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:241)
at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:465)
at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1526)
at org.elasticsearch.index.engine.InternalEngine.innerIndex(InternalEngine.java:441)
at org.elasticsearch.index.engine.InternalEngine.index(InternalEngine.java:364)
at org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:511)
at org.elasticsearch.action.bulk.TransportShardBulkAction.shardIndexOperation(TransportShardBulkAction.java:413)
at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:148)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase.performOnPrimary(TransportShardReplicationOperationAction.java:574)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1.doRun(TransportShardReplicationOperationAction.java:440)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:36)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)


(system) #4