# Http input plugin is throwing errors

**URL:** <https://discuss.elastic.co/t/http-input-plugin-is-throwing-errors/252970>\
**Category:** Logstash\
**Created:** [October 22, 2020, 9:11am UTC](https://discuss.elastic.co/t/http-input-plugin-is-throwing-errors/252970 "2020-10-22T09:11:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prajwalgmpp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prajwalgmpp/32/47707_2.png) [@prajwalgmpp](https://discuss.elastic.co/u/prajwalgmpp)\
**Post date:** [October 22, 2020, 9:11am UTC](https://discuss.elastic.co/t/http-input-plugin-is-throwing-errors/252970/1 "2020-10-22T09:11:14Z")

</div>

Still in the initial steps of learning Logstash.  
I have written the following pipeline in a configuration file:  
`input {`  
`stdin {`  
`codec => json`  
`}`

`http {`

`}`  
`}`

`output { stdout{ codec => rubydebug } }`

When I run logstash with this pipeline

> bin/logstash -f /home/pgangadh/pipeline.conf --path.data PATH

I get the following error:

> WARNING: Could not find logstash.yml which is typically located in $LS\_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults  
> Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console  
> [WARN] 2020-10-22 09:02:16.441 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified  
> [INFO] 2020-10-22 09:02:16.458 [LogStash::Runner] runner - Starting Logstash {"logstash.version"=\>"6.8.0"}  
> [INFO] 2020-10-22 09:02:25.751 [Converge PipelineAction::Create] pipeline - Starting pipeline {:pipeline\_id=\>"main", "pipeline.workers"=\>2, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>50}  
> [INFO] 2020-10-22 09:02:25.848 [[main]-pipeline-manager] stdin - Automatically switching from json to json\_lines codec {:plugin=\>"stdin"}  
> [INFO] 2020-10-22 09:02:26.289 [Converge PipelineAction::Create] pipeline - Pipeline started successfully {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0x7795ecd5 run\>"}  
> [INFO] 2020-10-22 09:02:26.300 [[main]\<http] http - Starting http input listener {:address=\>"0.0.0.0:8080", :ssl=\>"false"}  
> The stdin plugin is now waiting for input:  
> [INFO] 2020-10-22 09:02:26.405 [Ruby-0-Thread-1: /usr/share/logstash/lib/bootstrap/environment.rb:6] agent - Pipelines running {:count=\>1, :running\_pipelines=\>[:main], :non\_running\_pipelines=\>}  
> [ERROR] 2020-10-22 09:02:26.597 [[main]\<http] pipeline - A plugin had an unrecoverable error. Will restart this plugin.  
> Pipeline\_id:main  
> Plugin: \<LogStash::Inputs::Http id=\>"68a7302cd2a7040da73075d3ceebedb116eb8673ca09954ae0efe1b9128f3829", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_590bf824-84c8-405e-b3de-976124d833ff", enable\_metric=\>true, charset=\>"UTF-8"\>, host=\>"0.0.0.0", port=\>8080, ssl=\>false, ssl\_verify\_mode=\>"none", ssl\_handshake\_timeout=\>10000, tls\_min\_version=\>1, tls\_max\_version=\>1.2, cipher\_suites=\>["TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_GCM\_SHA384", "TLS\_ECDHE\_RSA\_WITH\_AES\_256\_GCM\_SHA384", "TLS\_ECDHE\_ECDSA\_WITH\_AES\_128\_GCM\_SHA256", "TLS\_ECDHE\_RSA\_WITH\_AES\_128\_GCM\_SHA256", "TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_CBC\_SHA384", "TLS\_ECDHE\_RSA\_WITH\_AES\_256\_CBC\_SHA384", "TLS\_ECDHE\_RSA\_WITH\_AES\_128\_CBC\_SHA256", "TLS\_ECDHE\_ECDSA\_WITH\_AES\_128\_CBC\_SHA256"], additional\_codecs=\>{"application/json"=\>"json"}, response\_headers=\>{"Content-Type"=\>"text/plain"}, remote\_host\_target\_field=\>"host", request\_headers\_target\_field=\>"headers", threads=\>2, max\_pending\_requests=\>200, max\_content\_length=\>104857600, response\_code=\>200, verify\_mode=\>"none"\>  
> Error: Address already in use  
> Exception: Java::JavaNet::BindException  
> Stack: sun.nio.ch.Net.bind0(Native Method)  
> sun.nio.ch.Net.bind(sun/nio/ch/Net.java:433)  
> sun.nio.ch.Net.bind(sun/nio/ch/Net.java:425)  
> sun.nio.ch.ServerSocketChannelImpl.bind(sun/nio/ch/ServerSocketChannelImpl.java:223)  
> io.netty.channel.socket.nio.NioServerSocketChannel.doBind(io/netty/channel/socket/nio/NioServerSocketChannel.java:130)  
> io.netty.channel.AbstractChannel$AbstractUnsafe.bind(io/netty/channel/AbstractChannel.java:558)  
> io.netty.channel.DefaultChannelPipeline$HeadContext.bind(io/netty/channel/DefaultChannelPipeline.java:1358)  
> io.netty.channel.AbstractChannelHandlerContext.invokeBind(io/netty/channel/AbstractChannelHandlerContext.java:501)  
> io.netty.channel.AbstractChannelHandlerContext.bind(io/netty/channel/AbstractChannelHandlerContext.java:486)  
> io.netty.channel.DefaultChannelPipeline.bind(io/netty/channel/DefaultChannelPipeline.java:1019)  
> io.netty.channel.AbstractChannel.bind(io/netty/channel/AbstractChannel.java:254)  
> io.netty.bootstrap.AbstractBootstrap$2.run(io/netty/bootstrap/AbstractBootstrap.java:366)  
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(io/netty/util/concurrent/AbstractEventExecutor.java:163)  
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(io/netty/util/concurrent/SingleThreadEventExecutor.java:404)  
> io.netty.channel.nio.NioEventLoop.run(io/netty/channel/nio/NioEventLoop.java:462)  
> io.netty.util.concurrent.SingleThreadEventExecutor$5.run(io/netty/util/concurrent/SingleThreadEventExecutor.java:897)  
> java.lang.Thread.run(java/lang/Thread.java:748)  
> [INFO] 2020-10-22 09:02:26.802 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=\>9600}  
> [INFO] 2020-10-22 09:02:27.616 [[main]\<http] http - Starting http input listener {:address=\>"0.0.0.0:8080", :ssl=\>"false"}  
> [ERROR] 2020-10-22 09:02:27.623 [[main]\<http] pipeline - A plugin had an unrecoverable error. Will restart this plugin.  
> Pipeline\_id:main  
> Plugin: \<LogStash::Inputs::Http id=\>"68a7302cd2a7040da73075d3ceebedb116eb8673ca09954ae0efe1b9128f3829", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_590bf824-84c8-405e-b3de-976124d833ff", enable\_metric=\>true, charset=\>"UTF-8"\>, host=\>"0.0.0.0", port=\>8080, ssl=\>false, ssl\_verify\_mode=\>"none", ssl\_handshake\_timeout=\>10000, tls\_min\_version=\>1, tls\_max\_version=\>1.2, cipher\_suites=\>["TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_GCM\_SHA384", "TLS\_ECDHE\_RSA\_WITH\_AES\_256\_GCM\_SHA384", "TLS\_ECDHE\_ECDSA\_WITH\_AES\_128\_GCM\_SHA256", "TLS\_ECDHE\_RSA\_WITH\_AES\_128\_GCM\_SHA256", "TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_CBC\_SHA384", "TLS\_ECDHE\_RSA\_WITH\_AES\_256\_CBC\_SHA384", "TLS\_ECDHE\_RSA\_WITH\_AES\_128\_CBC\_SHA256", "TLS\_ECDHE\_ECDSA\_WITH\_AES\_128\_CBC\_SHA256"], additional\_codecs=\>{"application/json"=\>"json"}, response\_headers=\>{"Content-Type"=\>"text/plain"}, remote\_host\_target\_field=\>"host", request\_headers\_target\_field=\>"headers", threads=\>2, max\_pending\_requests=\>200, max\_content\_length=\>104857600, response\_code=\>200, verify\_mode=\>"none"\>

I can make out some errors. It starts Logstash, pipeline is started successfully, starts http plugin listener, and then fails.

If I remove the http plugin from the pipeline, there wont be any error. Please help

---

<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:** [October 22, 2020, 2:31pm UTC](https://discuss.elastic.co/t/http-input-plugin-is-throwing-errors/252970/2 "2020-10-22T14:31:41Z")

</div>

> [@prajwalgmpp](#):
>
> host=\>"0.0.0.0", port=\>8080,  
> ...  
> Error: Address already in use  
> Exception: Java::JavaNet::BindException

It is telling you that something is already listening on port 8080. That is why the error goes away if you delete the http input.

---

<div class="post-metadata">

**Author:** ![prajwalgmpp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prajwalgmpp/32/47707_2.png) [@prajwalgmpp](https://discuss.elastic.co/u/prajwalgmpp)\
**Post date:** [October 23, 2020, 2:21pm UTC](https://discuss.elastic.co/t/http-input-plugin-is-throwing-errors/252970/3 "2020-10-23T14:21:03Z")

</div>

I have checked it...

> logstash# sudo netstat -tulpn | grep :8080  
> tcp6 0 0 :::8080 :::\* LISTEN 84377/java

> logstash# grep -w 8080 /etc/services  
> http-alt 8080/tcp webcache # WWW caching service  
> http-alt 8080/udp

But I dont know how to proceed with this info.

I also tried with a different port. But it is not working.

http { port =\> "Port Number" }

---

<div class="post-metadata">

**Author:** ![prajwalgmpp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prajwalgmpp/32/47707_2.png) [@prajwalgmpp](https://discuss.elastic.co/u/prajwalgmpp)\
**Post date:** [October 24, 2020, 9:53am UTC](https://discuss.elastic.co/t/http-input-plugin-is-throwing-errors/252970/4 "2020-10-24T09:53:05Z")

</div>

In the configuration file I changed the port to 9600 and host to 127.0.0.1 and now I am not getting any error.  
But now when I send a PUT 127.0.0.1:9600 through Postman, Postman is throwing an error.

---

<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 21, 2020, 9:53am UTC](https://discuss.elastic.co/t/http-input-plugin-is-throwing-errors/252970/5 "2020-11-21T09:53:12Z")

</div>

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