# "Fetched and Invalid Config" Error

**URL:** <https://discuss.elastic.co/t/fetched-and-invalid-config-error/74568>\
**Category:** Logstash\
**Created:** [February 9, 2017, 9:35pm UTC](https://discuss.elastic.co/t/fetched-and-invalid-config-error/74568 "2017-02-09T21:35:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonarmani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonarmani/32/15399_2.png) [@jonarmani](https://discuss.elastic.co/u/jonarmani)\
**Post date:** [February 9, 2017, 9:35pm UTC](https://discuss.elastic.co/t/fetched-and-invalid-config-error/74568/1 "2017-02-09T21:35:30Z")

</div>

Getting the official Logstash Docker container running on CentOS 7. Strange error after 15 or 30 seconds of launching the instance:

> Sending Logstash's logs to /var/log/logstash which is now configured via log4j2.properties  
> 21:32:34.666 [LogStash::Runner] ERROR logstash.agent - fetched an invalid config {:config=\>"input {\n syslog {}\n tcp {\n port =\> 1514\n type =\> syslog\n }\n udp {\n port =\> 1514\n type =\> syslog\n }\n gelf {}\n}\noutput {\n redis {\n host =\> "logging-redis"\n data\_type =\> "list"\n key =\> "logstash:redis"\n }\n}\n\n", :reason=\>"Expected one of #, if, ", ', } at line 2, column 1 (byte 9) after input {\n"}  
> 2017-02-09 21:32:34,722 Api Webserver ERROR No log4j2 configuration file found. Using default configuration: logging only errors to the console.

My logstash.conf just looks like this (as referenced in the error above):  
input {  
syslog {}  
tcp {  
port =\> 1514  
type =\> syslog  
}  
udp {  
port =\> 1514  
type =\> syslog  
}  
gelf {}  
}  
output {  
redis {  
host =\> "logging-redis"  
data\_type =\> "list"  
key =\> "logstash:redis"  
}  
}

I don't understand what's going on. I'm not even using "log4j2."

---

<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:** [February 10, 2017, 8:17am UTC](https://discuss.elastic.co/t/fetched-and-invalid-config-error/74568/2 "2017-02-10T08:17:42Z")

</div>

Never mind log4j2, that's noise. There's something on or near line 2 that Logstash doesn't like. Do you have an invisible garbage character right before "syslog{}" or thereabouts? You can inspect the file with e.g. `hexdump -C`.

---

<div class="post-metadata">

**Author:** ![jonarmani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonarmani/32/15399_2.png) [@jonarmani](https://discuss.elastic.co/u/jonarmani)\
**Post date:** [February 10, 2017, 5:59pm UTC](https://discuss.elastic.co/t/fetched-and-invalid-config-error/74568/3 "2017-02-10T17:59:11Z")

</div>

![](https://us1.discourse-cdn.com/elastic/original/2X/5/5651715d27baf01cf835e2e51b9d8b419b1709fa.png)

---

<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:** [February 13, 2017, 6:55am UTC](https://discuss.elastic.co/t/fetched-and-invalid-config-error/74568/4 "2017-02-13T06:55:45Z")

</div>

See those sequences of `c2 a0` everywhere? They're non-breaking spaces and they don't belong in your configuration file. Use regular spaces.

[http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=c2+a0&mode=bytes](http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=c2+a0&mode=bytes)

---

<div class="post-metadata">

**Author:** ![jonarmani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonarmani/32/15399_2.png) [@jonarmani](https://discuss.elastic.co/u/jonarmani)\
**Post date:** [February 13, 2017, 4:16pm UTC](https://discuss.elastic.co/t/fetched-and-invalid-config-error/74568/5 "2017-02-13T16:16:44Z")

</div>

That worked, thanks @magnusbaeck !

---

<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:** [March 13, 2017, 4:16pm UTC](https://discuss.elastic.co/t/fetched-and-invalid-config-error/74568/6 "2017-03-13T16:16:54Z")

</div>

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