File Input fails on FreeBSD 10.0 with NotImplementedError: stat.st_dev unsupported or native support failed to load

Description

After updating a couple of FreeBSD 9.2 boxes to FreeBSD 10.0 (amd64), Logstash stopped working with the specified error. The issue is very similar, if not identical, to https://logstash.jira.com/browse/LOGSTASH-665, apart from the affected OS. The existence of this issue has been verified on a fresh install of FreeBSD 10.0 as well.

Update 1:

It seems that the problem is caused by a bug in the jnr-ffi component, a JRuby dependency, that in turn is a Logstash dependency. I've sent a pull request (https://github.com/jnr/jnr-ffi/pull/26) you can refer to (and comment if you feel like to) in case you want to speed things up and have it merged upstream.

Update 2:

Since upstream (jnr-ffi) remains silent on this problem, I've forked that project, fixed it for FreeBSD and I will try to track upstream:

https://github.com/emcrisostomo/jnr-ffi

At the moment, it can be used as a drop-in replacement for jnr-ffi. In fact, to solve Logstash problems on FreeBSD, I've just updated the Logstash port (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194610) so that it patches the JRuby JAR shipped with Logstash and substitute the original {{jnr-ffi}} classes with the ones from the fork. I guess other *BSDs' and other OS' users may benefit from the same temporary solution as well.

However, the best solution would be upstream {{jnr-ffi}} to solve this issue: if you hit this problem and even if the above workaround solves it, please vote the PR in the {{jnr-ffi}} repository: https://github.com/jnr/jnr-ffi/pull/26.

Activity

Show:
Markus Langer
February 4, 2014, 8:50 AM

Same issue here:
Using milestone 2 input plugin 'file'. This plugin should be stable, but if you see strange behavior, please let us know! For more information on plugin milestones, see http://logstash.net/docs/1.3.3/plugin-milestones {:level=>:warn}
Using milestone 1 filter plugin 'syslog_pri'. This plugin should work, but would benefit from use by folks like you. Please let us know if you find bugs or have suggestions on how to improve this plugin. For more information on plugin milestones, see http://logstash.net/docs/1.3.3/plugin-milestones {:level=>:warn}
Exception in thread "LogStash::Runner" org.jruby.exceptions.RaiseException: (NotImplementedError) stat.st_dev unsupported or native support failed to load
at org.jruby.RubyFileStat.dev_major(org/jruby/RubyFileStat.java:394)
at RUBY._discover_file(file:/usr/local/logstash/logstash-1.3.3-flatjar.jar!/filewatch/watch.rb:140)
at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
at RUBY._discover_file(file:/usr/local/logstash/logstash-1.3.3-flatjar.jar!/filewatch/watch.rb:122)
at RUBY.watch(file:/usr/local/logstash/logstash-1.3.3-flatjar.jar!/filewatch/watch.rb:34)
at RUBY.tail(file:/usr/local/logstash/logstash-1.3.3-flatjar.jar!/filewatch/tail.rb:58)
at RUBY.run(file:/usr/local/logstash/logstash-1.3.3-flatjar.jar!/logstash/inputs/file.rb:126)
at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
at RUBY.run(file:/usr/local/logstash/logstash-1.3.3-flatjar.jar!/logstash/inputs/file.rb:126)
at RUBY.inputworker(file:/usr/local/logstash/logstash-1.3.3-flatjar.jar!/logstash/pipeline.rb:156)
at RUBY.start_input(file:/usr/local/logstash/logstash-1.3.3-flatjar.jar!/logstash/pipeline.rb:150)

Emile `iMil' Heitor
April 12, 2014, 1:26 PM

This bug also hits NetBSD 6.1/amd64, with logstash 1.4.0. Exact same stacktrace. Using OpenJDK 1.7.

Enrico Maria Crisostomo
January 28, 2015, 8:23 AM

The JRuby patch that fixes this has finally been merged into upstream (https://github.com/jnr/jnr-ffi/pull/26). Looking forward to a Logstash update including the fixed JRuby jars.

Jordan Sissel
January 28, 2015, 4:39 PM

that patch only landed 2 days ago. There is no new JRuby release which includes this at this time. Logstash will get the fix when it includes a JRuby release that includes that patch.

Enrico Maria Crisostomo
February 16, 2015, 1:04 PM

Thanks Jordan: the goal of my comment was just bringing this issue up to date with all the relevant information so that both users hitting this problem and maintainers are aware of what's in their hand to fix it. Thanks.

Assignee

Logstash Developers

Reporter

Enrico Maria Crisostomo

Affects versions

Configure