# Logstash throwing Failed to execute action java.lang.IllegalStateException: error when starting the agent

**URL:** <https://discuss.elastic.co/t/logstash-throwing-failed-to-execute-action-java-lang-illegalstateexception-error-when-starting-the-agent/256875>\
**Category:** Logstash\
**Created:** [November 27, 2020, 12:43pm UTC](https://discuss.elastic.co/t/logstash-throwing-failed-to-execute-action-java-lang-illegalstateexception-error-when-starting-the-agent/256875 "2020-11-27T12:43:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Ravichandran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_ravichandran/32/53882_2.png) [@Rahul\_Ravichandran](https://discuss.elastic.co/u/Rahul_Ravichandran)\
**Post date:** [November 27, 2020, 12:43pm UTC](https://discuss.elastic.co/t/logstash-throwing-failed-to-execute-action-java-lang-illegalstateexception-error-when-starting-the-agent/256875/1 "2020-11-27T12:43:51Z")

</div>

Hey guys

- Im trying to push logs from my server to Elasticsearch endpoint through logstash.

- My server is running a 2016 server OS and the im using a logstash version 7.9.0

- This is my logstsh.conf file

```auto
input {
  file {
    path => "C:/log/*"
    start_position => "beginning"
  }
}
filter {
    if [message] =~ /{.*}/ {
        grok { match => { "message" => "(?<[@metadata][json]>({.*}))"} }
        json { source => "[@metadata][json]" remove_field => ["message"] }
    }
}

output {	
  amazon_es {
    hosts => [" ************************"]
    region => " *****"
    index => "lgst-server1-%{+YYYY.MM.dd}"
    #user => "elastic"
    #password => "changeme"
  }
}

```

- when i run this  
`c:\logstash\bin\logstash.bat -f c:\logstash\bin\logstash.conf`

- This is the output im getting

```auto
Sending Logstash logs to C:/logstash/logs which is now configured via log4j2.properties
[2020-11-27T12:30:27,546][INFO][logstash.runner] Starting Logstash {"logstash.version"=>"7.9.0", "jruby.version"=>"jruby 9.2.12.0 (2.5.7) 2020-07-01 db01a49ba6 Java HotSpot(TM) 64-Bit Server VM 25.271-b09 on 1.8.0_271-b09 +indy +jit [mswin32-x86_64]"
[2020-11-27T12:30:29,609][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2020-11-27T12:30:36,843][INFO][org.reflections.Reflections] Reflections took 109 ms to scan 1 urls, producing 22 keys and 45 values
url template
{:scheme=>"https", :user=>nil, :password=>nil, :host=>"URLTEMPLATE", :port=>443, :path=>nil}
[2020-11-27T12:30:43,577][INFO][logstash.outputs.amazonelasticsearch][main] Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[<Domain endpoint>:443/]}}
[2020-11-27T12:30:43,624][INFO][logstash.outputs.amazonelasticsearch][main] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=><Domain URL>:443/, :path=>"/"}
[2020-11-27T12:30:44,218][ERROR][logstash.agent] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create<main>, action_result: false", :backtrace=>nil}
[2020-11-27T12:30:44,796][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=>9600}
[2020-11-27T12:30:49,608][INFO][logstash.runner] Logstash shut down.
[2020-11-27T12:30:49,671][ERROR][org.logstash.Logstash] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

```

- what am i doing wrong here . Could anyone help me out please.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 27, 2020, 1:45pm UTC](https://discuss.elastic.co/t/logstash-throwing-failed-to-execute-action-java-lang-illegalstateexception-error-when-starting-the-agent/256875/2 "2020-11-27T13:45:44Z")

</div>

If you enable log.level debug do you get a more informative error message?

---

<div class="post-metadata">

**Author:** ![Rahul\_Ravichandran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_ravichandran/32/53882_2.png) [@Rahul\_Ravichandran](https://discuss.elastic.co/u/Rahul_Ravichandran)\
**Post date:** [November 27, 2020, 2:45pm UTC](https://discuss.elastic.co/t/logstash-throwing-failed-to-execute-action-java-lang-illegalstateexception-error-when-starting-the-agent/256875/3 "2020-11-27T14:45:54Z")

</div>

Im sorry, how do i enable that ?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 27, 2020, 2:48pm UTC](https://discuss.elastic.co/t/logstash-throwing-failed-to-execute-action-java-lang-illegalstateexception-error-when-starting-the-agent/256875/4 "2020-11-27T14:48:04Z")

</div>

You could edit logstash.yml or add `--log.level debug` to the command line.

---

<div class="post-metadata">

**Author:** ![Rahul\_Ravichandran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_ravichandran/32/53882_2.png) [@Rahul\_Ravichandran](https://discuss.elastic.co/u/Rahul_Ravichandran)\
**Post date:** [November 27, 2020, 3:38pm UTC](https://discuss.elastic.co/t/logstash-throwing-failed-to-execute-action-java-lang-illegalstateexception-error-when-starting-the-agent/256875/5 "2020-11-27T15:38:56Z")

</div>

Actually i tried with the logstash version 7.6.2 as my other servers are running this version and it got through with no errors. Still not sure the root cause, but using logstash version 7.6.2 solved my error

---

<div class="post-metadata">

**Author:** ![PraveenKT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveenkt/32/35483_2.png) [@PraveenKT](https://discuss.elastic.co/u/PraveenKT)\
**Post date:** [November 27, 2020, 4:41pm UTC](https://discuss.elastic.co/t/logstash-throwing-failed-to-execute-action-java-lang-illegalstateexception-error-when-starting-the-agent/256875/6 "2020-11-27T16:41:30Z")

</div>

Check the file permissions.

---

<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:** [December 25, 2020, 4:41pm UTC](https://discuss.elastic.co/t/logstash-throwing-failed-to-execute-action-java-lang-illegalstateexception-error-when-starting-the-agent/256875/7 "2020-12-25T16:41:35Z")

</div>

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