with current portstree root@puppetserver:~ # eyaml Traceback (most recent call last): 7: from /usr/local/bin/eyaml:25:in `<main>' 6: from /usr/local/bin/eyaml:25:in `load' 5: from /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/bin/eyaml:10:in `<top (required)>' 4: from /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:31:in `find' 3: from /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:31:in `each' 2: from /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:34:in `block in find' 1: from /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:34:in `each' /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:37:in `block (2 levels) in find': undefined method `dependencies' for #<Gem::StubSpecification:0x00000008054bb0d8> (NoMethodError) root@puppetserver:~ # which eyaml /usr/local/bin/eyaml root@puppetserver:~ # pkg which /usr/local/bin/eyaml /usr/local/bin/eyaml was installed by package rubygem-hiera-eyaml-3.2.2 root@puppetserver:~ # puppet lookup still handles decryption of existing encrypted hieradata values using eyaml_lookup_key
This might look like https://github.com/rubygems/rubygems/issues/5235#issuecomment-1002519760 Hiera-eyaml’s issue report this as a ruby 3.x issue, though here we are still using ruby 2.7 https://github.com/voxpupuli/hiera-eyaml/issues/325 Though #258108 mentions al kinds of fixes for ruby 3.x
Crude fix to get it going again --- /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb.orig 2022-03-30 19:25:36.581974000 +0200 +++ /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb 2022-03-30 19:30:40.726838000 +0200 @@ -33,6 +33,7 @@ specs.each do |spec| next if @@plugins.include? spec + spec = Gem::VERSION >= "3.3.7" ? spec.to_spec() : spec dependency = spec.dependencies.find { |d| d.name == "hiera-eyaml" } next if dependency && !dependency.requirement.satisfied_by?( this_version ) Not sure about exact version numbers introducing the regression. Going to check this with the GitHub issue about the same problem
Created attachment 232847 [details] Update the sysutils/rubygem-hiera-eyaml with a patch
Created attachment 233360 [details] Update the sysutils/rubygem-hiera-eyaml with a patch Fix for better version checking
Created attachment 233362 [details] Add fix to let eyaml work with newer rubygem Using the fix from https://github.com/voxpupuli/hiera-eyaml/pull/329#pullrequestreview-932407869 instead. Works with ruby27-gems-3.3.10 / rubygem-hiera-eyaml-3.2.2 too and is cleaner
(In reply to ruben from comment #5) applied this patch manually and works for me: root@puppetserver:~ # eyaml Unknown subcommand Usage: eyaml <subcommand> Please use one of the following subcommands or help for more help: createkeys, decrypt, edit, encrypt, recrypt, version root@puppetserver:~ # Thanks
caveat: The patch is also needed after the ruby 3.0 upgrade. There is also another incompatibility that seems to manifest itself inside rubygem-highline that manifests itself as eyaml encrypt -p [hiera-eyaml-core] no implicit conversion of Hash into String echo -n foobar | eyaml encrypt --stdin can be used as a (unsafe) workaround
Created attachment 234012 [details] Add fix to let eyaml work with newer rubygem/ruby After the update to ruby 3.0 it is also required to switch from devel/rubygem-highline1 to devel/rubygem-highline. This restores eyaml encrypt -p (interactive eyaml encryption)
Ooops, I missed this PR… LGTM!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=255d614f9bc8626bd0583274f5c18ec38c7ea662 commit 255d614f9bc8626bd0583274f5c18ec38c7ea662 Author: Romain Tartière <romain@FreeBSD.org> AuthorDate: 2022-06-01 15:46:15 +0000 Commit: Romain Tartière <romain@FreeBSD.org> CommitDate: 2022-06-01 15:49:44 +0000 sysutils/rubygem-hiera-eyaml: Fix highline dependency The recent update fixed Ruby 3.0 support but `eyaml encrypt -p` remained broken. PR: 262351 Reported by: ruben@verweg.com sysutils/rubygem-hiera-eyaml/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Thanks!