# Error registering plugin Beats input

**URL:** <https://discuss.elastic.co/t/error-registering-plugin-beats-input/295596>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [January 27, 2022, 3:29pm UTC](https://discuss.elastic.co/t/error-registering-plugin-beats-input/295596 "2022-01-27T15:29:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![florinb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/florinb/32/80377_2.png) [@florinb](https://discuss.elastic.co/u/florinb)\
**Post date:** [January 27, 2022, 3:29pm UTC](https://discuss.elastic.co/t/error-registering-plugin-beats-input/295596/1 "2022-01-27T15:29:50Z")

</div>

i'm running a dockerised Logstash 6.8.23 on java 1.8 image with all dependencies fulfilled:

```auto
$ java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-b07)
OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)

```

My input config:

```auto
input {
    # tcp {
    # port => 5000
    # type => syslog
    # }
    # udp {
    # port => 5000
    # type => syslog
    # }
    http {
        host => "0.0.0.0"
        port => 31311
        type => beats
    }
    beats {
        port => 5044
        type => beats
    }
}

```

The error logged:

```auto
[...]
[2022-01-27T15:17:10,897][ERROR][logstash.pipeline] Error registering plugin {:pipeline_id=>"main", :plugin=>"<LogStash::Inputs::Beats type=>\"beats\", port=>5044, id=>\"840eeb77b933eb9066c905954b4cec9b4bf46659fc89db69da6cfa80b817493c\", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>\"plain_ca059b48-3e22-4644-be42-bdc75af18c82\", enable_metric=>true, charset=>\"UTF-8\">, host=>\"0.0.0.0\", ssl=>false, add_hostname=>true, ssl_verify_mode=>\"none\", ssl_peer_metadata=>false, include_codec_tag=>true, 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\"], client_inactivity_timeout=>60, executor_threads=>1>", :error=>"cannot link Java class io.netty.handler.ssl.OpenSsl, probable missing dependency: Could not initialize class io.netty.handler.ssl.OpenSsl", :thread=>"#<Thread:0x52a754a9@/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:173 run>"}
[2022-01-27T15:17:11,990][ERROR][logstash.pipeline] Pipeline aborted due to error {:pipeline_id=>"main", :exception=>#<NameError: cannot link Java class io.netty.handler.ssl.OpenSsl, probable missing dependency: Could not initialize class io.netty.handler.ssl.OpenSsl>, :backtrace=>["org/jruby/javasupport/JavaClass.java:292:in `for_name'", "org/jruby/javasupport/JavaClass.java:288:in `for_name'", "org/jruby/javasupport/JavaUtilities.java:38:in `get_proxy_class'", "uri:classloader:/jruby/java/core_ext/object.rb:44:in `block in java_import'", "org/jruby/RubyArray.java:2577:in `map'", "uri:classloader:/jruby/java/core_ext/object.rb:37:in `java_import'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-beats-5.1.11-java/lib/logstash/inputs/beats.rb:146:in `register'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:259:in `register_plugin'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:270:in `block in register_plugins'", "org/jruby/RubyArray.java:1792:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:270:in `register_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:413:in `start_inputs'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:311:in `start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:217:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:176:in `block in start'"], :thread=>"#<Thread:0x52a754a9@/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:173 run>"}

```

I am just adding Logstash from .deb manually and installing plugins, my Dockerfile:

```auto
FROM mydockerrepo/java/jdk/8:master

# for some reason logstash depends on logrotate...
RUN apt-get update && \
    apt-get install -y logrotate && \
    apt-get install -y zip && \
    apt-get install apt-transport-https

# logstash looks for /usr/bin/java and this base image has it installed somewhere else
RUN ln -s /usr/local/openjdk-8/bin/java /usr/bin/java

RUN curl -s "https://artifacts.elastic.co/downloads/logstash/logstash-6.8.23.deb" --output /tmp/logstash.deb && \
    dpkg -i /tmp/logstash.deb ; \
    apt-get -f -y install && \
    rm -rf /tmp/logstash.deb && \
    /usr/share/logstash/bin/logstash-plugin install logstash-output-elasticsearch && \
    /usr/share/logstash/bin/logstash-plugin install logstash-codec-collectd && \
    /usr/share/logstash/bin/logstash-plugin install logstash-input-syslog && \
    /usr/share/logstash/bin/logstash-plugin install logstash-input-kafka && \
    /usr/share/logstash/bin/logstash-plugin install logstash-filter-grok && \
    /usr/share/logstash/bin/logstash-plugin install logstash-input-beats && \
    /usr/share/logstash/bin/logstash-plugin install logstash-input-dead_letter_queue

ADD initdlogstash /etc/init.d/logstash
RUN chmod +x /etc/init.d/logstash

[copy conf files commands here]

RUN mkdir -p /usr/share/logstash/patterns
COPY patterns-2 /usr/share/logstash/patterns/2
COPY patterns-gc /usr/share/logstash/patterns/gc
RUN chown -R logstash:logstash /usr/share/logstash/patterns

RUN chown -R logstash:logstash /var/lib/logstash

CMD init.sh

```

My base image:

```auto
FROM openjdk:8-jdk-slim-buster

ENV RUN_USER="myuser"
RUN echo "Add runtime user ${RUN_USER}.." \
    && useradd \
        --create-home \
        --user-group \
        ${RUN_USER} \
    && echo "Done"

RUN echo "Install commonly used packages.." \
    && apt-get update \
    && apt-get install --no-install-recommends -y \
        ca-certificates \
        curl \
        procps \
        sysstat \
    && apt-get clean \
    && apt-get autoremove -y \
    && rm -rf /var/lib/apt/lists/* \
    && echo "Done."

```

What could cause the my Beats pipeline to crash with `"cannot link Java class io.netty.handler.ssl.OpenSsl, probable missing dependency: Could not initialize class io.netty.handler.ssl.OpenSsl"`?  
I want to mention that SSL is set to false - `ssl=>false` and I even tried to set `cipher_suites` empty to `cipher_suites => []`.

---

<div class="post-metadata">

**Author:** ![florinb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/florinb/32/80377_2.png) [@florinb](https://discuss.elastic.co/u/florinb)\
**Post date:** [January 28, 2022, 9:29am UTC](https://discuss.elastic.co/t/error-registering-plugin-beats-input/295596/2 "2022-01-28T09:29:32Z")

</div>

After digging for **hours** on end together with a colleague we have found that the cause for this is _having two inputs_ **in the same pipline file** (the `http` and `beats` one). Leaving one or the other in the pipeline will have logstash working. This makes no sense as there is no records of this being a breaking change and furthermore, it is even detailed on official Elastic doc pages that it works:

> **[Stitching Together Multiple Input and Output Plugins | Logstash Reference...](https://www.elastic.co/guide/en/logstash/6.8/multiple-input-output-plugins.html)**

Is there any way I can make my single-file pipline work with the two inputs `http` and `beats`?

---

<div class="post-metadata">

**Author:** ![florinb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/florinb/32/80377_2.png) [@florinb](https://discuss.elastic.co/u/florinb)\
**Post date:** [January 28, 2022, 11:04am UTC](https://discuss.elastic.co/t/error-registering-plugin-beats-input/295596/3 "2022-01-28T11:04:28Z")

</div>

this is nothing else but **pure madness**... if i change the input order, with `beats` first and `http` second, the pipeline works properly... what the actual hell elastic?

```auto
input {
    # tcp {
    # port => 5000
    # type => syslog
    # }
    # udp {
    # port => 5000
    # type => syslog
    # }
    beats {
        port => 5044
        type => beats
    }
    http {
        host => "0.0.0.0"
        port => 31311
        type => beats
    }
}

```

---

<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 25, 2022, 11:05am UTC](https://discuss.elastic.co/t/error-registering-plugin-beats-input/295596/4 "2022-02-25T11:05:21Z")

</div>

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