You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we got flock unsupported or native support failed to load error.
it was difficult to debug the cause until we find -Xnative.verbose=true option from JRuby source code.
it's helpful if error message shows a way to debug the cause.
actual the cause was that /tmp was mounted with noexec option.
Details
Installing a gem failed with this error:
$ embulk gem install embulk-input-jdbc
2016-02-19 18:45:43.698 -0600: Embulk v0.8.5
Fetching: embulk-input-jdbc-0.6.4.gem (100%)
NotImplementedError: flock unsupported or native support failed to load
flock at org/jruby/RubyFile.java:304
block in cache_update_path at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/remote_fetcher.rb:316
open at org/jruby/RubyIO.java:1125
open at org/jruby/RubyKernel.java:310
cache_update_path at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/remote_fetcher.rb:315
download at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/remote_fetcher.rb:174
download at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/source.rb:210
download at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/resolver/activation_request.rb:60
block in install at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/request_set.rb:160
each at org/jruby/RubyArray.java:1560
install at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/request_set.rb:150
install_gem at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:249
block in install_gems at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:299
each at org/jruby/RubyArray.java:1560
install_gems at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:295
execute at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:202
invoke_with_build_args at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/command.rb:307
process_args at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/command_manager.rb:168
run at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/command_manager.rb:138
run at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/gem_runner.rb:54
run at /home/sneisius/.embulk/bin/embulk!/embulk/command/embulk_run.rb:165
<top> at /home/sneisius/.embulk/bin/embulk!/embulk/command/embulk_main.rb:2
require at org/jruby/RubyKernel.java:939
(root) at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
<top> at file:/home/sneisius/.embulk/bin/embulk!/embulk/command/embulk_bundle.rb:51```
After digging into the source code, we found that the error happens when jruby works with jnr-posix. Then, we found -Xnative.verbose=true option that shows stacktrace. Here is the full stacktrace: https://gist.github.com/frsyuki/d762149c43315361fe19
This error possibly happens when /tmp is mounted with noexec, or execution on /tmp is prohibited by SELinux. But it was hard for us to come to this conclusion because error message doesn't suggest how to debug the cause of the failure when it loads a native library.
It would be good if the error message suggests how to debug the cause. For example:
diff --git a/core/src/main/java/org/jruby/ext/JRubyPOSIXHandler.java b/core/src/main/java/org/jruby/ext/JRubyPOSIXHandler.java
index 5c249f4..2689b7d 100644
--- a/core/src/main/java/org/jruby/ext/JRubyPOSIXHandler.java
+++ b/core/src/main/java/org/jruby/ext/JRubyPOSIXHandler.java
@@ -48,7 +48,7 @@ public class JRubyPOSIXHandler implements POSIXHandler {
}
public void unimplementedError(String method) {
- throw runtime.newNotImplementedError(method + " unsupported or native support failed to load");
+ throw runtime.newNotImplementedError(method + " unsupported or native support failed to load. Set _JAVA_OPTIONS=-Djruby.native.verbose=true environment variable to debug");
}
public void warn(WARNING_ID id, String message, Object... data) {
I used _JAVA_OPTIONS here so that the suggestion is valid even if jruby is used as a library.
Some issues might have been easier to solve with this message: #3266#3285#3409
Environment
JRuby 9.0.4.0
RedHat Enterprise Linux 7
The text was updated successfully, but these errors were encountered:
I've added a page for gathering info about native library problems in JRuby here: http://wiki.jruby.org/Native-Libraries. I will add this to relevant error messages.
Overview:
flock unsupported or native support failed to load
error.noexec
option.Details
Installing a gem failed with this error:
After digging into the source code, we found that the error happens when jruby works with jnr-posix. Then, we found -Xnative.verbose=true option that shows stacktrace. Here is the full stacktrace:
https://gist.github.com/frsyuki/d762149c43315361fe19
This error possibly happens when /tmp is mounted with noexec, or execution on /tmp is prohibited by SELinux. But it was hard for us to come to this conclusion because error message doesn't suggest how to debug the cause of the failure when it loads a native library.
It would be good if the error message suggests how to debug the cause. For example:
I used _JAVA_OPTIONS here so that the suggestion is valid even if jruby is used as a library.
Some issues might have been easier to solve with this message: #3266 #3285 #3409
Environment
The text was updated successfully, but these errors were encountered: