Bug 961915 - Fedora 19: jruby expects JRE 1.6
Fedora 19: jruby expects JRE 1.6
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: puppet (Show other bugs)
19
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Mo Morsi
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-10 14:15 EDT by deesto
Modified: 2013-07-20 15:23 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-05-13 04:46:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description deesto 2013-05-10 14:15:53 EDT
Description of problem:
Puppet depends on ruby, which has moved to jruby, which depends on java. jruby seems to expect and require JRE 1.6, while 1.7 is installed instead by default.

Version-Release number of selected component (if applicable):
puppet-3.1.1-3.fc19
jruby-1.7.2-1.fc19
java-1.7.0-openjdk-1.7.0.19-2.3.9.6.fc19

How reproducible:
Install and run puppet or jruby.

Steps to Reproduce:
1. yum -y install puppet (installs jruby dependency)
2. puppet agent --test (or simply try to run jruby or ruby)
  
Actual results:
/usr/bin/jruby: line 405: /usr/lib/jvm/java-6-openjdk/jre/bin/java: No such file or directory

Expected results:
{a puppet run)

Additional info:
Latest Fedora 19 alpha with latest updates.
A quick hack attempt to link JRE 1.7 to 1.6 ends up with:
Error: Could not find or load main class org.jruby.Main
Comment 1 deesto 2013-05-10 16:13:03 EDT
I think this is a self-inflicted error: jruby was assuming the 1.6 path due to a user-set $JAVA_HOME; unsetting this alleviated the above error.

But in a new development:
$ puppet --version
LoadError: no such file to load -- puppet/util/command_line
  require at org/jruby/RubyKernel.java:1027
  require at /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45
   (root) at /usr/bin/puppet:3

$ ll /usr/share/ruby/vendor_ruby/puppet/util/command_line/
total 44
drwxr-xr-x.  2 root root  4096 May  9 15:23 ./
drwxr-xr-x. 12 root root  4096 May  9 15:23 ../
-rw-r--r--.  1 root root  3201 Mar  8 18:03 puppet_option_parser.rb
-rw-r--r--.  1 root root 28859 Mar  8 18:03 trollop.rb

Not sure whether this is a legitimate system problem (and whether it's ruby/jruby/puppet) or also self-inflicted.
Comment 2 Vít Ondruch 2013-05-13 04:46:11 EDT
1. I cannot confirm that puppet would require JRuby, nor I could reproduce it.
2. Installing JRuby, it seems to work just fine.

Here is my log:

http://paste.fedoraproject.org/11772/43461113/
Comment 3 deesto 2013-05-13 10:51:47 EDT
Hi Vit,

(In reply to comment #2)
> 1. I cannot confirm that puppet would require JRuby, nor I could reproduce
> it.
> 2. Installing JRuby, it seems to work just fine.
> 
> Here is my log:
> 
> http://paste.fedoraproject.org/11772/43461113/

I mentioned that although I no longer believe this is solely due to jruby, certainly something still seems wrong:

$ rpm -q puppet
puppet-3.1.1-3.fc19.noarch
$ rpm -q jruby
jruby-1.7.2-1.fc19.noarch
$ rpm -q java
package java is not installed
$ rpm -q java-1.7.0-openjdk
java-1.7.0-openjdk-1.7.0.19-2.3.9.6.fc19.x86_64
$ puppet --version
LoadError: no such file to load -- puppet/util/command_line
  require at org/jruby/RubyKernel.java:1027
  require at /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45
   (root) at /usr/bin/puppet:3

Perhaps you could point this ticket in the proper direction?

Thanks!
Comment 4 deesto 2013-05-13 16:47:48 EDT
The puppet package installs jruby as a dependency, but it does not also install the ruby 'stub', which puppet seems to require and which results in this error. I'm a bit surprised that 'ruby' is not part of the base OS install, especially since `ruby --version` does not fail and responds with the jruby version, unless the 'ruby' stub package is installed.

BTW, I just tried to revisit your log paste to verify whether ruby was preinstalled in your test system, but it looks like Varnish has a problem.

Error 503 Service Unavailable
Service Unavailable
Guru Meditation:
XID: 1759763300
Comment 5 Bohuslav "Slavek" Kabrda 2013-05-15 04:14:29 EDT
> $ ll /usr/share/ruby/vendor_ruby/puppet/util/command_line/

JRuby doesn't touch Ruby's vendor dir so it can't see those files. It's probably caused by Puppet being built for MRI only (we don't have any viable JRuby-specific packaging guidelines yet, so there is no usable vendor JRuby dir right now...)
Comment 6 John Florian 2013-07-20 15:23:27 EDT
(In reply to deesto from comment #3)

I just stumbled upon this exact error:

> LoadError: no such file to load -- puppet/util/command_line
>   require at org/jruby/RubyKernel.java:1027
>   require at /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:45
>    (root) at /usr/bin/puppet:3


I got there with a Fedora 19 minimal install.  After that completed I did the following:

yum -y update && yum -y install puppet && reboot

My next step was to run 'puppet agent --test' to sent the certificate signing request to my master so that I could let puppet finish configuring this host.  I've never had such an issue before.  In fact, this is actually the 3rd F19 host I've put together this way.  The first two went without a hitch.  Has something changed that needs to be fixed?

I think this BZ needs to be reopened, personally.  Fortunately, from the above, I was able to guess a workaround of:

yum install ruby

This action brought in ruby and rubygem-bigdecimal (for dependencies) and all seems okay now.  I this just a case of the puppet package needing a 'Requires: ruby'?

Note You need to log in before you can comment on or make changes to this bug.