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

issue with jruby under PE 3.7 #150

Closed
mpounsett opened this issue Mar 24, 2015 · 8 comments
Closed

issue with jruby under PE 3.7 #150

mpounsett opened this issue Mar 24, 2015 · 8 comments

Comments

@mpounsett
Copy link

After upgrading to PE 3.7, I'm migrating to hiera-eyaml from hiera-gpg since the latter doesn't work under PE 3.7. I've installed hiera-eyaml, and that seems to have been fine.

% sudo /opt/puppet/bin/puppetserver gem list hiera-eyaml
*** LOCAL GEMS ***
hiera-eyaml (2.0.7)

eyaml seems to be missing jruby though, and it's not part of the PE install.

% /var/opt/lib/pe-puppet-server/jruby-gems/bin/eyaml createkeys
/usr/bin/env: jruby: No such file or directory
% sudo find /opt/puppet -name jruby | wc -l
0

I've installed the system jruby (sudo apt-get install jruby) but that doesn't seem to have helped much, since the system jruby can't find the puppetserver eyaml gem.

% /var/opt/lib/pe-puppet-server/jruby-gems/bin/eyaml createkeys
Exception in thread "main" java.io.EOFException
    at java.io.DataInputStream.readFully(DataInputStream.java:197)
    at java.io.DataInputStream.readUTF(DataInputStream.java:609)
    at java.io.DataInputStream.readUTF(DataInputStream.java:564)
    at org.joda.time.tz.ZoneInfoProvider.readZoneInfoMap(ZoneInfoProvider.java:278)
    at org.joda.time.tz.ZoneInfoProvider.loadZoneInfoMap(ZoneInfoProvider.java:256)
    at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:123)
    at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:82)
    at org.joda.time.DateTimeZone.getDefaultProvider(DateTimeZone.java:490)
    at org.joda.time.DateTimeZone.setProvider0(DateTimeZone.java:444)
    at org.joda.time.DateTimeZone.<clinit>(DateTimeZone.java:116)
    at org.jruby.RubyTime.getLocalTimeZone(RubyTime.java:96)
    at org.jruby.RubyTime$1.allocate(RubyTime.java:171)
    at org.jruby.RubyClass.allocate(RubyClass.java:220)
    at org.jruby.RubyTime.newInstance(RubyTime.java:655)
    at org.jruby.RubyTime$s_method_0_0$RUBYINVOKER$newInstance.call(org/jruby/RubyTime$s_method_0_0$RUBYINVOKER$newInstance.gen:65535)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:289)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:108)
    at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
    at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
    at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.evalClassDefinitionBody(ASTInterpreter.java:196)
    at org.jruby.ast.ClassNode.interpret(ClassNode.java:141)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.ast.RootNode.interpret(RootNode.java:129)
    at org.jruby.Ruby.loadFile(Ruby.java:2553)
    at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:61)
    at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:671)
    at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:314)
    at org.jruby.runtime.load.LoadService.require(LoadService.java:357)
    at org.jruby.runtime.load.LoadService.lockAndRequire(LoadService.java:289)
    at org.jruby.RubyKernel.requireCommon(RubyKernel.java:984)
    at org.jruby.RubyKernel.require(RubyKernel.java:967)
    at org.jruby.RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$require.call(org/jruby/RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$require.gen:65535)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:319)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:309)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
    at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.ast.RootNode.interpret(RootNode.java:129)
    at org.jruby.Ruby.loadFile(Ruby.java:2553)
    at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:61)
    at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:671)
    at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:314)
    at org.jruby.runtime.load.LoadService.require(LoadService.java:357)
    at org.jruby.runtime.load.LoadService.lockAndRequire(LoadService.java:289)
    at org.jruby.RubyKernel.requireCommon(RubyKernel.java:984)
    at org.jruby.RubyKernel.require(RubyKernel.java:967)
    at org.jruby.RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$require.call(org/jruby/RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$require.gen:65535)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:319)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:309)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
    at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.ast.RootNode.interpret(RootNode.java:129)
    at org.jruby.Ruby.loadFile(Ruby.java:2553)
    at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:61)
    at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:671)
    at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:314)
    at org.jruby.runtime.load.LoadService.require(LoadService.java:357)
    at org.jruby.runtime.load.LoadService.lockAndRequire(LoadService.java:289)
    at org.jruby.RubyKernel.requireCommon(RubyKernel.java:984)
    at org.jruby.RubyKernel.require(RubyKernel.java:967)
    at org.jruby.RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$require.call(org/jruby/RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$require.gen:65535)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:319)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:309)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
    at var.opt.lib.pe_minus_puppet_minus_server.jruby_minus_gems.bin.eyaml.__file__(eyaml:9)
    at var.opt.lib.pe_minus_puppet_minus_server.jruby_minus_gems.bin.eyaml.load(eyaml)
    at org.jruby.Ruby.runScript(Ruby.java:692)
    at org.jruby.Ruby.runNormally(Ruby.java:575)
    at org.jruby.Ruby.runFromMain(Ruby.java:418)
    at org.jruby.Main.run(Main.java:286)
    at org.jruby.Main.run(Main.java:128)
    at org.jruby.Main.main(Main.java:97)
/usr/lib/jruby//lib/ruby/site_ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem hiera-eyaml (>= 0) (Gem::LoadError)

    from /usr/lib/jruby//lib/ruby/site_ruby/1.8/rubygems.rb:211:in `activate'
    from /usr/lib/jruby//lib/ruby/site_ruby/1.8/rubygems.rb:1056:in `gem'
    from /var/opt/lib/pe-puppet-server/jruby-gems/bin/eyaml:22

There's nothing about this in the install readme, and I googling hasn't produced any results. Am I missing something obvious here?

@elyscape
Copy link
Contributor

For command-line support, you'll need to install the gem again using the regular Ruby interpreter with sudo /opt/puppet/bin/gem install hiera-eyaml and then call it via /opt/puppet/bin/eyaml.

@fbacchella
Copy link

Don't work neither in Centos 6 with puppetserver 2.2.1. jruby is not provided, even when installed with puppetserver gem install hiera-eyaml.
Puppet was installer with RPM.

@elyscape
Copy link
Contributor

elyscape commented Mar 2, 2016

jruby is not provided, even when installed with puppetserver gem install hiera-eyaml.

What? Puppet Server runs on and ships with JRuby.

@fbacchella
Copy link

I'm talking about the jruby as a standalone binary. The eyaml command expect it, the first line is "/usr/bin/env jruby"

@sihil
Copy link
Collaborator

sihil commented Mar 3, 2016

Interesting - that must get substituted somehow during installation. As you can see we just use ruby:
https:/TomPoulton/hiera-eyaml/blob/master/bin/eyaml

Potentially something wrong with how the gem is being installed? As @elyscape says you'll need to install it into your normal ruby environment to use the command line tool. The installation in the puppet server path is solely for decrypting and not for editing.

@fbacchella
Copy link

I installed using :

/opt/puppetlabs/bin/puppetserver gem install hiera-eyaml

And to use it I now type:

/opt/puppetlabs/bin/puppetserver ruby /opt/puppetlabs/server/data/puppetserver/jruby-gems/bin/eyaml

So it's more a documentation problem than a real bug.

@sihil
Copy link
Collaborator

sihil commented Mar 3, 2016

Arguably yes. The documentation hasn't kept up with changes to puppet and having to install it differently for editing isn't always clear. I imagine most people don't have puppetserver running on the machine they are using to edit manifests so it's generally not a problem.

@Dan33l
Copy link
Member

Dan33l commented Sep 26, 2018

it can be reopened if it's reproducible on the latest Puppet 4 or newer

@Dan33l Dan33l closed this as completed Sep 26, 2018
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

5 participants