Skip to content

Bundled plugins fail on Logstash 9.4+ due to removed Fixnum/Bignum constants #19391

Description

@donoghuc

Ruby unified Fixnum and Bignum into Integer in Ruby 2.4 and removed the old constants in Ruby 3.2. Logstash 9.4 and later ship JRuby 10 that targets Ruby 3.4, where Fixnum and Bignum no longer exist. Any plugin that references Fixnum or Bignum, either directly or through a dependency gem, raises NameError: uninitialized constant Fixnum (or Bignum) at runtime on Logstash 9.4+. The same plugins work on Logstash 8.x and 9.3, where the constants still exist as deprecated aliases for Integer.

Affected plugins

logstash-codec-edn references Bignum through the edn gem at edn-1.1.1/lib/edn/core_ext.rb:97.
logstash-codec-edn_lines references Bignum through the same edn gem.
logstash-input-jms references Fixnum through the jruby-jms gem at jruby-jms-1.3.0/lib/jms/map_message.rb:31.
logstash-filter-anonymize references Fixnum directly at lib/logstash/filters/anonymize.rb:64 in anonymize_murmur3, reached by the MURMUR3 algorithm.

Environment

Confirmed broken on docker.elastic.co/logstash/logstash:9.4.3 (JRuby 10.0.5.0, Ruby 3.4).
Not affected on Logstash 8.x or 9.3.

Reproduction: logstash-codec-edn

docker run --rm docker.elastic.co/logstash/logstash:9.4.3 bash -c '
  bin/logstash-plugin install logstash-codec-edn
  bin/logstash --path.data /tmp/d -e "input { generator { count => 1 } } output { stdout { codec => edn } }"
'
Failed to execute action ... Unable to configure plugins: (NameError) uninitialized constant Bignum
  RUBY.<main>(edn-1.1.1/lib/edn/core_ext.rb:97)
  RUBY.register(logstash-codec-edn-3.1.0/lib/logstash/codecs/edn.rb:22)

Reproduction: logstash-codec-edn_lines

docker run --rm docker.elastic.co/logstash/logstash:9.4.3 bash -c '
  bin/logstash-plugin install logstash-codec-edn_lines
  bin/logstash --path.data /tmp/d -e "input { generator { count => 1 } } output { stdout { codec => edn_lines } }"
'
Failed to execute action ... Unable to configure plugins: (NameError) uninitialized constant Bignum
  RUBY.<main>(edn-1.1.1/lib/edn/core_ext.rb:97)
  RUBY.register(logstash-codec-edn_lines-3.1.0/lib/logstash/codecs/edn_lines.rb:23)

Reproduction: logstash-filter-anonymize

docker run --rm docker.elastic.co/logstash/logstash:9.4.3 bash -c '
  bin/logstash-plugin install logstash-filter-anonymize
  bin/logstash --path.data /tmp/d -e "input { generator { count => 1 message => \"hello\" } } filter { anonymize { fields => [\"message\"] algorithm => \"MURMUR3\" key => \"abc\" } } output { stdout {} }"
'
Pipeline worker error, the pipeline will be stopped ... (NameError) uninitialized constant LogStash::Filters::Anonymize::Fixnum
  RUBY.anonymize_murmur3(logstash-filter-anonymize-3.0.7/lib/logstash/filters/anonymize.rb:64)
  RUBY.filter(logstash-filter-anonymize-3.0.7/lib/logstash/filters/anonymize.rb:46)

Reproduction: logstash-input-jms

Triggered when the plugin reads a JMS MapMessage. The jruby-jms gem evaluates val.class == Fixnum at jruby-jms-1.3.0/lib/jms/map_message.rb:31, which raises NameError: uninitialized constant Fixnum. Reproduction requires a JMS broker and a MapMessage on the source queue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions