# Logstash 5.1.2 starting with errors

**URL:** <https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188>\
**Category:** Logstash\
**Created:** [January 19, 2017, 3:58pm UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188 "2017-01-19T15:58:16Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![kodo83](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@kodo83](https://discuss.elastic.co/u/kodo83)\
**Post date:** [January 19, 2017, 3:58pm UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188/1 "2017-01-19T15:58:16Z")

</div>

Hi,  
I'm new in logstash and elasticsearch.  
i want to index mysql database to elasticsearch using logstash. i downloded the last versions 5.1.2 (of logstash and elasticsearch).  
elasticsearch start without problems.  
for logstash, i downloaded mysql connector jar, and put it in bin folder, i also created a file with "logstash.conf" in bin folder :  
input {  
jdbc {  
jdbc\_driver\_library =\> "mysql-connector-java-5.1.38.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/ecommerce"  
jdbc\_user =\> "root"  
jdbc\_password =\> "root"  
schedule =\> "\* \* \* \* \*"  
statement =\> "select \* from products"  
}  
}  
output {  
#stdout { codec =\> json\_lines }  
elasticsearch {  
index =\> "products"  
document\_type =\> "product"  
document\_id =\> "%{ProductID}"  
hosts =\> "[localhost:9200]"  
}

}

when i start logstash with **logstash -f logstash.conf** , i get this errors, and my database not indexed 😥

Could not find log4j2 configuration at path /MYENV/outils/elastic512/logstash51  
2/config/log4j2.properties. Using default config which logs to console  
15:40:42.816 [[main]-pipeline-manager] ERROR logstash.agent - Pipeline aborted d  
ue to error {:exception=\>#\<Psych::SyntaxError: (): 'reader' unacceptabl  
e character ' ' (0x0) special characters are not allowed  
in "'reader'", position 0 at line 0 column 0\>, :backtrace=\>["org/jruby/ext/psych  
/PsychParser.java:232:in `parse'", "C:/MYENV/outils/elastic512/logstash512/vend or/jruby/lib/ruby/1.9/psych.rb:375:in`parse\_stream'", "C:/MYENV/outils/elastic  
512/logstash512/vendor/jruby/lib/ruby/1.9/psych.rb:323:in `parse'", "C:/MYENV/o utils/elastic512/logstash512/vendor/jruby/lib/ruby/1.9/psych.rb:250:in`load'",  
"C:/MYENV/outils/elastic512/logstash512/vendor/bundle/jruby/1.9/gems/logstash-i  
nput-jdbc-4.1.3/lib/logstash/inputs/jdbc.rb:206:in `register'", "C:/MYENV/outil s/elastic512/logstash512/logstash-core/lib/logstash/pipeline.rb:353:in`start\_in  
puts'", "org/jruby/RubyArray.java:1613:in `each'", "C:/MYENV/outils/elastic512/ logstash512/logstash-core/lib/logstash/pipeline.rb:352:in`start\_inputs'", "C:/E  
NV\_AT/outils/elastic512/logstash512/logstash-core/lib/logstash/pipeline.rb:228:i  
n `start_workers'", "C:/MYENV/outils/elastic512/logstash512/logstash-core/lib/l ogstash/pipeline.rb:183:in`run'", "C:/MYENV/outils/elastic512/logstash512/logs  
tash-core/lib/logstash/agent.rb:292:in `start\_pipeline'"]}  
15:40:42.915 [Api Webserver] INFO logstash.agent - Successfully started Logstas  
h API endpoint {:port=\>9600}  
15:40:45.816 [LogStash::Runner] WARN logstash.agent - stopping pipeline {:id=\>"  
main"}

have you any ideao about this problem ?

i have jdk1.8.0\_91 on my machine.

thanks.

---

<div class="post-metadata">

**Author:** ![kodo83](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@kodo83](https://discuss.elastic.co/u/kodo83)\
**Post date:** [January 19, 2017, 5:25pm UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188/2 "2017-01-19T17:25:32Z")

</div>

this error will make me crazy.  
i tested with version 2.2.0 and i had the same error but with less messages :

C:\MYENV\esproject\logstash-2.2.0\bin\>logstash -f logstash.mysql.conf  
io/console not supported; tty will not be manipulated  
Settings: Default pipeline workers: 8  
The error reported is:  
(): 'reader' unacceptable character ' ' (0x0) special characters are  
not allowed  
in "'reader'", position 0 at line 0 column 0

is there a problem in my config file ?

---

<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:** [January 20, 2017, 6:47am UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188/3 "2017-01-20T06:47:51Z")

</div>

It looks like $USER\_HOME/.logstash\_jdbc\_last\_run exists but isn't valid YAML. Fix what's broken about the file, or perhaps just delete it?

---

<div class="post-metadata">

**Author:** ![kodo83](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@kodo83](https://discuss.elastic.co/u/kodo83)\
**Post date:** [January 20, 2017, 4:36pm UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188/4 "2017-01-20T16:36:17Z")

</div>

thanks magnus for your reply,  
where can i find .logstash\_jdbc\_last\_run ?

---

<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:** [January 22, 2017, 1:42pm UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188/5 "2017-01-22T13:42:50Z")

</div>

It should be in your home directory. I don't know why the documentation mentions $USER\_HOME. It should say $HOME.

---

<div class="post-metadata">

**Author:** ![kodo83](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@kodo83](https://discuss.elastic.co/u/kodo83)\
**Post date:** [January 23, 2017, 11:31pm UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188/6 "2017-01-23T23:31:48Z")

</div>

thanks for the reply magnusbaeck.  
what should i modify in $HOME ?  
i returned to the version 2.4.1 and my problems are solved.i think it is more stable than the 5.1.2

---

<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:** [January 24, 2017, 6:47am UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188/7 "2017-01-24T06:47:30Z")

</div>

> what should i modify in $HOME ?

As I said, fix what's wrong in .logstash\_jdbc\_last\_run (the error message suggests broken YAML) or delete the file.

---

<div class="post-metadata">

**Author:** ![kodo83](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@kodo83](https://discuss.elastic.co/u/kodo83)\
**Post date:** [January 24, 2017, 10:25am UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188/8 "2017-01-24T10:25:30Z")

</div>

thanks again for the reply magnusbaeck.  
i searched logstash\_jdbc\_last\_run file, find it in (c:/users/user), and i deleted it. it s OK 😭  
i have 5 records in my table products, when i go to : [http://localhost:9200/products/product/\_search](http://localhost:9200/products/product/_search)  
i have just the last record as result:  
{"took":29,"timed\_out":false,"\_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max\_score":1.0,"hits":[{"\_index":"products","\_type":"product","\_id":"%{ProductID}","\_score":1.0,"\_source":{"productid":991,"productsku":"00035","productname":"Ampoule","productprice":10.0,"productweight":10.0,"productcartdesc":"Ampoule","productshortdesc":"AmpouleAmpoule","productlongdesc":"AmpouleAmpouleAmpouleAmpoule","productthumb":"","productimage":"","productcategoryid":null,"productupdatedate":"2017-01-18T15:03:40.000Z","productstock":100.0,"productlive":false,"productunlimited":true,"productlocation":null,"@version":"1","@timestamp":"2017-01-24T10:18:00.318Z"}}]}}

any idea please ?

---

<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:** [January 24, 2017, 10:39am UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188/9 "2017-01-24T10:39:33Z")

</div>

That's because the document id is "%{ProductID}". The event has no `ProductID` field, but it does have a field named `productid`.

---

<div class="post-metadata">

**Author:** ![kodo83](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@kodo83](https://discuss.elastic.co/u/kodo83)\
**Post date:** [January 24, 2017, 10:49am UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188/10 "2017-01-24T10:49:16Z")

</div>

thanks magnusbaeck.  
it s OK

---

<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:** [February 21, 2017, 10:49am UTC](https://discuss.elastic.co/t/logstash-5-1-2-starting-with-errors/72188/11 "2017-02-21T10:49:23Z")

</div>

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