hiera-eyaml
hiera-eyaml copied to clipboard
Puppet 4: Increase minimum 'highline' gem version in Gemfile
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.
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?
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.
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.
Any plans for bumping to newer highline gem or are there still issues?
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.
Sounds good; shall we just bump gemspec to >=1.6.19
?
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.
Anyone tried this perhaps?