# EBADF: Bad file descriptor

**URL:** <https://discuss.elastic.co/t/ebadf-bad-file-descriptor/148666>\
**Category:** Logstash\
**Created:** [September 14, 2018, 6:22pm UTC](https://discuss.elastic.co/t/ebadf-bad-file-descriptor/148666 "2018-09-14T18:22:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kilo](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@kilo](https://discuss.elastic.co/u/kilo)\
**Post date:** [September 14, 2018, 6:22pm UTC](https://discuss.elastic.co/t/ebadf-bad-file-descriptor/148666/1 "2018-09-14T18:22:41Z")

</div>

Logstash is throwing the following error:  
[2018-09-14T13:53:47,371][WARN][logstash.inputs.websocket] websocket input client threw exception, restarting {:exception=\>#\<Errno::EBADF: Bad file descriptor - No message available\>}

I've checked the forum here and on github, and there are reports of this, but no one appears to be doing anything to resolve it. In fact topics here get closed after a month of no activity and no responses. Is this product still supported? The websocket plugin documentation says it was released this past June. Is it still supported?

I'd be happy to provide further details and config info if needed.

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [September 15, 2018, 9:00pm UTC](https://discuss.elastic.co/t/ebadf-bad-file-descriptor/148666/2 "2018-09-15T21:00:59Z")

</div>

The Websocket Input Plugin is a community-contributed plugin that is not (currently) included in the Logstash distribution. If you have a reproducible error, we would be glad to help in getting a patch in to fix it, but the plugin does not appear to be under active development.

There are a number of reasons why Ruby's Socket library would throw a `EBADF`, mostly having to do with the socket being cleaned up out of under it by the operating system. Can you turn on debug logging? Doing so will cause the error log to include a backtrace.

A TCP dump capturing traffic on the relevant ports may also prove helpful.

---

<div class="post-metadata">

**Author:** ![kilo](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@kilo](https://discuss.elastic.co/u/kilo)\
**Post date:** [September 17, 2018, 1:04pm UTC](https://discuss.elastic.co/t/ebadf-bad-file-descriptor/148666/3 "2018-09-17T13:04:56Z")

</div>

New to Logstash. How do I turn on the debug logging, and where would the logs end up?

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [September 17, 2018, 4:55pm UTC](https://discuss.elastic.co/t/ebadf-bad-file-descriptor/148666/4 "2018-09-17T16:55:04Z")

</div>

You can use the `--log.level debug` command-line flag, or you can set `log.level: debug` in your `logstash.yml`. Additional information about logging, and where logs go based on what distribution you are using (e.g., tarball, deb, rpm), can be found here:

[https://www.elastic.co/guide/en/logstash/current/logging.html](https://www.elastic.co/guide/en/logstash/current/logging.html)

---

<div class="post-metadata">

**Author:** ![kilo](https://avatars.discourse-cdn.com/v4/letter/k/0ea827/32.png) [@kilo](https://discuss.elastic.co/u/kilo)\
**Post date:** [September 17, 2018, 6:50pm UTC](https://discuss.elastic.co/t/ebadf-bad-file-descriptor/148666/5 "2018-09-17T18:50:01Z")

</div>

Got the debug logging. How much of the log do you want to see? I don't see a backtrace on the error.

[2018-09-17T14:46:16,104][DEBUG][logstash.pipeline] Pushing flush onto pipeline {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0x24df9a4a sleep\>"}  
[2018-09-17T14:46:17,009][WARN][logstash.inputs.websocket] websocket input client threw exception, restarting {:exception=\>#\<Errno::EBADF: Bad file descriptor - No message available\>}  
[2018-09-17T14:46:17,352][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=\>"ParNew"}  
[2018-09-17T14:46:17,352][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=\>"ConcurrentMarkSweep"}  
[2018-09-17T14:46:21,116][DEBUG][logstash.pipeline] Pushing flush onto pipeline {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0x24df9a4a sleep\>"}  
[2018-09-17T14:46:22,364][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=\>"ParNew"}  
[2018-09-17T14:46:22,364][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=\>"ConcurrentMarkSweep"}  
[2018-09-17T14:46:26,123][DEBUG][logstash.pipeline] Pushing flush onto pipeline {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0x24df9a4a sleep\>"}  
[2018-09-17T14:46:27,387][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=\>"ParNew"}  
[2018-09-17T14:46:27,387][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=\>"ConcurrentMarkSweep"}  
[2018-09-17T14:46:31,128][DEBUG][logstash.pipeline] Pushing flush onto pipeline {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0x24df9a4a sleep\>"}  
[2018-09-17T14:46:32,403][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=\>"ParNew"}  
[2018-09-17T14:46:32,403][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=\>"ConcurrentMarkSweep"}  
[2018-09-17T14:46:36,140][DEBUG][logstash.pipeline] Pushing flush onto pipeline {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0x24df9a4a sleep\>"}  
[2018-09-17T14:46:37,419][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=\>"ParNew"}  
[2018-09-17T14:46:37,419][DEBUG][logstash.instrument.periodicpoller.jvm] collector name {:name=\>"ConcurrentMarkSweep"}  
[2018-09-17T14:46:39,057][WARN][logstash.inputs.websocket] websocket input client threw exception, restarting {:exception=\>#\<Errno::EBADF: Bad file descriptor - No message available\>}

---

<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:** [October 15, 2018, 6:54pm UTC](https://discuss.elastic.co/t/ebadf-bad-file-descriptor/148666/6 "2018-10-15T18:54:54Z")

</div>

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