hiera-eyaml icon indicating copy to clipboard operation
hiera-eyaml copied to clipboard

Puppet 4: Increase minimum 'highline' gem version in Gemfile

Open bombergio opened this issue 9 years ago • 8 comments

When using Puppet 4.1 and new puppet-server 2.1 hiera-eyaml throws out errors on puppet agent runs:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Resource Statement, Error from DataBinding 'hiera' while looking up 'ntp::autoupdate': cannot load Java class jline.console.ConsoleReader at /etc/puppetlabs/code/environments/production/manifests/site.pp:20:5 on node client_x

It appears that 'highline' version (1.6.19) defined in hiera-eyaml gemfile is too low. Based on 'highline' changelog, there is number of fixes for JRuby introduced in version 1.6.20 https://github.com/JEG2/highline/blob/master/Changelog.md

With upgrade of the 'highline' gem to the >= 1.6.20 version, error disappeared and hiera-eyaml works as expected.

bombergio avatar Jun 18 '15 07:06 bombergio

We set the highline version specifically in #142 because the highline gem broke semantic versioning, but apparently I'm not very good at predicting the future :)

Hopefully there won't be a really cool new feature in highline that we need in the meantime :)

I'll upgrade the dependency in the next version, probably to "~> 1.6" or something so that we can get all the 1.6.x versions, I'm not sure why I didn't do that to begin with?

TomPoulton avatar Sep 15 '15 16:09 TomPoulton

On another note, HighLine removed their JLine implementation in JEG2/highline@8a612537 (unfortunately, only released in the 2.0.0-pre gems). We've noticed that require 'highline/import' causes a call to HighLine.new which creates jline.console.ConsoleReader objects when running under JRuby. These objects persist unless their shutdown method is invoked, which causes a memory leak when Puppet Server cycles it's pool of JRuby workers.

Since HighLine is only used for the CLI, it probably shouldn't be loaded by the server-side bits of the Hiera backend.

Sharpie avatar Feb 03 '16 02:02 Sharpie

We created a Puppet Labs ticket for this which includes some more detail on what Charlie metnions: https://tickets.puppetlabs.com/browse/SERVER-1154

We're working on finding some time to put together a PR.

orodabaugh avatar Feb 19 '16 18:02 orodabaugh

Any plans for bumping to newer highline gem or are there still issues?

mbevc1 avatar Mar 07 '19 11:03 mbevc1

The JRuby issue was mitigated by PR #187 which re-factored the code so that loading the API required for decryption did not also load the troublesome CLI code.

Updating to Highline 2.0 now that it has shipped would be a good idea in order to eliminate the latent issue should a jline.console.ConsoleReader get created, but is no longer strictly necessary.

Sharpie avatar Mar 11 '19 02:03 Sharpie

Sounds good; shall we just bump gemspec to >=1.6.19?

mbevc1 avatar Mar 11 '19 16:03 mbevc1

The real question is if 2.0 brought any breaking changes that would affect the CLI usage of hiera-eyaml.

So, someone needs to try bumping the dependency to 2.0 and then running through the tests and other acceptance actions to see if anything would break.

Sharpie avatar Mar 13 '19 05:03 Sharpie

Anyone tried this perhaps?

mbevc1 avatar Apr 07 '19 18:04 mbevc1