Error generating a logstash image

Freshman on elastic stack here. I'm trying to generate a logstash image with the following Dockerfile:

FROM docker.elastic.co/logstash/logstash:8.1.0

RUN rm -f /usr/share/logstash/pipeline/logstash.conf && \
    bin/logstash-plugin install logstash-filter-translate

it creates it, but once run I got a kind of incompatibility exception:

 	at org.nio4r.Selector.doSelect(Selector.java:237) ~[nio4r_ext.jar:?]
logstash  | 	at org.nio4r.Selector.select(Selector.java:197) ~[nio4r_ext.jar:?]
logstash  | 	at org.nio4r.Selector$INVOKER$i$select.call(Selector$INVOKER$i$select.gen) ~[jruby.jar:?]
logstash  | 	at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneBlock.call(JavaMethod.java:577) ~[jruby.jar:?]
logstash  | 	at org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:197) ~[jruby.jar:?]
logstash  | 	at usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.puma_minus_5_dot_6_dot_9_minus_java.lib.puma.reactor.RUBY$method$select_loop$0(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/puma-5.6.9-java/lib/puma/reactor.rb:75) ~[?:?]
logstash  | 	at usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.puma_minus_5_dot_6_dot_9_minus_java.lib.puma.reactor.RUBY$method$select_loop$0$__VARARGS__(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/puma-5.6.9-java/lib/puma/reactor.rb:69) ~[?:?]
logstash  | 	at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:80) ~[jruby.jar:?]
logstash  | 	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70) ~[jruby.jar:?]
logstash  | 	at org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207) ~[jruby.jar:?]
logstash  | 	at usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.puma_minus_5_dot_6_dot_9_minus_java.lib.puma.reactor.RUBY$block$run$1(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/puma-5.6.9-java/lib/puma/reactor.rb:39) ~[?:?]
logstash  | 	at org.jruby.runtime.CompiledIRBlockBody.callDirect(CompiledIRBlockBody.java:138) ~[jruby.jar:?]
logstash  | 	at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:58) ~[jruby.jar:?]
logstash  | 	at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:52) ~[jruby.jar:?]
logstash  | 	at org.jruby.runtime.Block.call(Block.java:139) ~[jruby.jar:?]
logstash  | 	at org.jruby.RubyProc.call(RubyProc.java:318) ~[jruby.jar:?]
logstash  | 	at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:105) ~[jruby.jar:?]
logstash  | 	at java.lang.Thread.run(Thread.java:829) ~[?:?]
logstash exited with code 123

if I try to not install the plugin when generating the image:

FROM docker.elastic.co/logstash/logstash:8.1.0

# no further instructions

and I change my docker-compose.yaml like this:

    command: bash -c "bin/logstash-plugin install logstash-filter-translate && logstash -f /etc/logstash/conf.d/logstash.conf "

I get the same error. Needless to say, if I don't install the plugin, logstash runs smoothly.

How could I fix this?

Hello and welcome,

Why are you trying to install the translate filter? It is not required, this is a core filter that already comes bundled.

As mentioned, there is no need to install the translate filter, it is alreayd bundled.

1 Like

and you're perfectly right!

logstash@8e6216dd7f68:~$ ./bin/logstash-plugin  list | grep -i transl
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
io/console on JRuby shells out to stty for most operations
logstash-filter-translate
logstash@8e6216dd7f68:~$

I was just following along a course, and maybe they were using an old version of logstash, not including that plugin. Appreciated the very quick answer. thanks!

That's possible, the plugin started getting bundled on version 7.0, which was released around 7 years ago.

The course may be very old or was not updated with recent changes, so other things may not work as well.

2 Likes