Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotImplementedError: flock unsupported or native support failed to load when installing bundler #4291

Closed
cheister opened this issue Nov 14, 2016 · 2 comments

Comments

@cheister
Copy link

cheister commented Nov 14, 2016

Environment

Provide at least:

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)
# PATH= /usr/java/jdk1.8.0_92/bin/java -cp 'jRubyApp.jar' org.jruby.Main --version
jruby 9.1.6.0 (2.3.1) 2016-11-09 0150a76 Java HotSpot(TM) 64-Bit Server VM 25.92-b14 on 1.8.0_92-b14 +jit [linux-x86_64]
  • Operating system and platform (e.g. uname -a)
# uname -a
Linux hostname 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 23 17:05:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Other relevant info you may wish to add:

  • Gem version
# PATH= /usr/java/jdk1.8.0_92/bin/java -cp 'jRubyApp.jar' org.jruby.Main -S gem --version
io/console on JRuby shells out to stty for most operations
2.6.8
  • Environment variables
    JVM properties
awt.toolkit: sun.awt.X11.XToolkit
file.encoding.pkg: sun.io
file.encoding: UTF-8
file.separator: /
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
java.awt.printerjob: sun.print.PSPrinterJob
java.class.path: .
java.class.version: 52.0
java.endorsed.dirs: /usr/java/jdk1.8.0_92/jre/lib/endorsed
java.ext.dirs: /usr/java/jdk1.8.0_92/jre/lib/ext:/usr/java/packages/lib/ext
java.home: /usr/java/jdk1.8.0_92/jre
java.io.tmpdir: /tmp
java.library.path: /usr/local/python2.7/python/lib::/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
java.runtime.name: Java(TM) SE Runtime Environment
java.runtime.version: 1.8.0_92-b14
java.specification.name: Java Platform API Specification
java.specification.vendor: Oracle Corporation
java.specification.version: 1.8
java.vendor: Oracle Corporation
java.vendor.url.bug: http://bugreport.sun.com/bugreport/
java.vendor.url: http://java.oracle.com/
java.version: 1.8.0_92
java.vm.info: mixed mode
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name: Java Virtual Machine Specification
java.vm.specification.vendor: Oracle Corporation
java.vm.specification.version: 1.8
java.vm.vendor: Oracle Corporation
java.vm.version: 25.92-b14
line.separator: 
os.arch: amd64
os.name: Linux
os.version: 3.10.0-327.22.2.el7.x86_64
path.separator: :
sun.arch.data.model: 64
sun.boot.class.path: /usr/java/jdk1.8.0_92/jre/lib/resources.jar:/usr/java/jdk1.8.0_92/jre/lib/rt.jar:/usr/java/jdk1.8.0_92/jre/lib/sunrsasign.jar:/usr/java/jdk1.8.0_92/jre/lib/jsse.jar:/usr/java/jdk1.8.0_92/jre/lib/jce.jar:/usr/java/jdk1.8.0_92/jre/lib/charsets.jar:/usr/java/jdk1.8.0_92/jre/lib/jfr.jar:/usr/java/jdk1.8.0_92/jre/classes
sun.boot.library.path: /usr/java/jdk1.8.0_92/jre/lib/amd64
sun.cpu.endian: little
sun.cpu.isalist: 
sun.io.unicode.encoding: UnicodeLittle
sun.java.command: PrintSystemProperties
sun.java.launcher: SUN_STANDARD
sun.jnu.encoding: UTF-8
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
sun.os.patch.level: unknown
user.country: US
user.dir: /project
user.home: /root
user.language: en
user.name: root
user.timezone: 

Expected Behavior

For JRuby 9.1.5.0 this works, but fails in 9.1.6.0 with the error

# PATH= /usr/java/jdk1.8.0_92/bin/java -cp 'jRubyApp.jar' org.jruby.Main -S gem install bundler
io/console on JRuby shells out to stty for most operations
NotImplementedError: flock unsupported or native support failed to load; see http://wiki.jruby.org/Native-Libraries
                   flock at org/jruby/RubyFile.java:324
    block in read_binary at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems.rb:849
                    open at org/jruby/RubyIO.java:1141
                    open at org/jruby/RubyKernel.java:306
             read_binary at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems.rb:848
              fetch_spec at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/source.rb:146
                    spec at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/resolver/api_specification.rb:77
      add_always_install at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/resolver/installer_set.rb:78
    resolve_dependencies at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/dependency_installer.rb:474
             install_gem at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:194
   block in install_gems at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:255
            install_gems at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:251
                 execute at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:158
  invoke_with_build_args at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/command.rb:310
            process_args at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/command_manager.rb:169
                     run at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/command_manager.rb:139
                     run at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/gem_runner.rb:55
                  <main> at uri:classloader:/META-INF/jruby.home/bin/jgem:21
                    load at org/jruby/RubyKernel.java:977
                  <main> at uri:classloader:/META-INF/jruby.home/bin/gem:4
@cheister
Copy link
Author

cheister commented Nov 14, 2016

Attaching a file with the output from adding -verbose:jni
jruby9.1.6.0-install-bundler.txt

@cheister
Copy link
Author

Ok. I had time to re-visit this issue. It looks like something in our build system was not pulling in the com.github.jnr.jffi jar after the update.

By running the above command with -Djruby.native.verbose=true we got a more useful error message

Failed to load native POSIX impl; falling back on Java impl. Stacktrace follows.
java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider
    at jnr.ffi.provider.InvalidProvider$1.loadLibrary(InvalidProvider.java:48)
    at jnr.ffi.LibraryLoader.load(LibraryLoader.java:325)
    at jnr.ffi.Library.loadLibrary(Library.java:127)
    at jnr.posix.POSIXFactory$DefaultLibCProvider$SingletonHolder.<clinit>(POSIXFactory.java:279)
    at jnr.posix.POSIXFactory$DefaultLibCProvider.getLibC(POSIXFactory.java:283)
    at jnr.posix.BaseNativePOSIX.<init>(BaseNativePOSIX.java:37)
    at jnr.posix.LinuxPOSIX.<init>(LinuxPOSIX.java:18)
    at jnr.posix.POSIXFactory.loadLinuxPOSIX(POSIXFactory.java:143)
    at jnr.posix.POSIXFactory.loadNativePOSIX(POSIXFactory.java:121)
    at jnr.posix.POSIXFactory.loadPOSIX(POSIXFactory.java:90)
    at jnr.posix.LazyPOSIX.loadPOSIX(LazyPOSIX.java:36)
    at jnr.posix.LazyPOSIX.posix(LazyPOSIX.java:32)
    at jnr.posix.LazyPOSIX.isNative(LazyPOSIX.java:378)
    at org.jruby.RubyGlobal.prepareStdioChannel(RubyGlobal.java:295)
    at org.jruby.RubyGlobal.initSTDIO(RubyGlobal.java:272)
    at org.jruby.RubyGlobal.createGlobals(RubyGlobal.java:199)
    at org.jruby.Ruby.init(Ruby.java:1190)
    at org.jruby.Ruby.newInstance(Ruby.java:334)
    at org.jruby.Main.internalRun(Main.java:271)
    at org.jruby.Main.run(Main.java:232)
    at org.jruby.Main.main(Main.java:204)
Caused by: java.lang.NoClassDefFoundError: com/kenai/jffi/Type
    at jnr.ffi.provider.jffi.NativeRuntime.jafflType(NativeRuntime.java:193)
    at jnr.ffi.provider.jffi.NativeRuntime.buildTypeMap(NativeRuntime.java:76)
    at jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:57)
    at jnr.ffi.provider.jffi.NativeRuntime.<init>(NativeRuntime.java:41)
    at jnr.ffi.provider.jffi.NativeRuntime$SingletonHolder.<clinit>(NativeRuntime.java:53)
    at jnr.ffi.provider.jffi.NativeRuntime.getInstance(NativeRuntime.java:49)
    at jnr.ffi.provider.jffi.Provider.<init>(Provider.java:29)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.getInstance(FFIProvider.java:68)
    at jnr.ffi.provider.FFIProvider$SystemProviderSingletonHolder.<clinit>(FFIProvider.java:57)
    at jnr.ffi.provider.FFIProvider.getSystemProvider(FFIProvider.java:35)
    at jnr.ffi.Library.loadLibrary(Library.java:114)
    ... 18 more
Caused by: java.lang.ClassNotFoundException: com.kenai.jffi.Type
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 34 more

Which lead to us to looking into why com/kenai/jffi/Type was missing from the jar.

@enebo enebo added this to the Invalid or Duplicate milestone Feb 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants