hiera-eyaml fails to start

Bug #1974059 reported by Lars Bahner
44
This bug affects 9 people
Affects Status Importance Assigned to Milestone
hiera-eyaml (Ubuntu)
Fix Released
Critical
Unassigned
Jammy
Fix Released
Critical
Patrik Lundin

Bug Description

Ever since upgrading to jammy eyaml fails completely. I thought it was related to gpgme, ruby-gpg or my GPG keys. But then I tried in a lxc container and it obviously doesn't work at all.

This also goes for both my laptop and my workstation after upgrading to jammy. I used to use eyaml everyday in both hirsute and focal.

root@u1:~# eyaml edit foo.eyaml
/usr/share/rubygems-integration/all/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:0x000055b20761a738 @extension_dir=nil, @full_gem_path=nil, @gem_dir=nil, @ignored=nil, @loaded_from="/usr/lib/ruby/gems/3.0.0/specifications/default/abbrev-0.1.0.gemspec", @data=#<Gem::StubSpecification::StubLine:0x000055b2076197c0 @name="abbrev", @version=#<Gem::Version "0.1.0">, @platform="ruby", @extensions=[], @full_name="abbrev-0.1.0", @require_paths=["lib"]>, @name=nil, @spec=nil, @base_dir="/var/lib/gems/3.0.0", @gems_dir="/var/lib/gems/3.0.0/gems", @default_gem=true> (NoMethodError)
 from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:34:in `each'
 from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:34:in `block in find'
 from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:31:in `each'
 from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:31:in `find'
 from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/bin/eyaml:10:in `<top (required)>'
 from /usr/bin/eyaml:25:in `load'
 from /usr/bin/eyaml:25:in `<main>'
root@u1:~# history
    1 apt-get update
    2 apt-get install hiera-eyaml
    3 eyaml edit foo.eyaml
    4 history
root@u1:~#

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: hiera-eyaml 3.2.2-2
ProcVersionSignature: Ubuntu 5.15.0-30.31-generic 5.15.30
Uname: Linux 5.15.0-30-generic x86_64
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Wed May 18 15:59:02 2022
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=C.UTF-8
SourcePackage: hiera-eyaml
UpgradeStatus: No upgrade log present (probably fresh install)

===

SRU-formatted update (added by Patrik Lundin)

[ Impact ]

The eyaml command is unusable as it stands, running it will lead to a backtrace.

[ Test Plan ]

Running `eyaml` will result in a backtrace:
```
$ eyaml
/usr/share/rubygems-integration/all/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:0x000055f2972067c0 @extension_dir=nil, @full_gem_path=nil, @gem_dir=nil, @ignored=nil, @loaded_from="/usr/lib/ruby/gems/3.0.0/specifications/default/abbrev-0.1.0.gemspec", @data=#<Gem::StubSpecification::StubLine:0x000055f2972057a8 @name="abbrev", @version=#<Gem::Version "0.1.0">, @platform="ruby", @extensions=[], @full_name="abbrev-0.1.0", @require_paths=["lib"]>, @name=nil, @spec=nil, @base_dir="/var/lib/gems/3.0.0", @gems_dir="/var/lib/gems/3.0.0/gems", @default_gem=true> (NoMethodError)
        from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:34:in `each'
        from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:34:in `block in find'
        from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:31:in `each'
        from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:31:in `find'
        from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/bin/eyaml:10:in `<top (required)>'
        from /usr/bin/eyaml:25:in `load'
        from /usr/bin/eyaml:25:in `<main>'
```

After installing the patched package it starts working again:
```
$ sudo dpkg -i hiera-eyaml_3.2.2-2ubuntu0.1_all.deb

$ eyaml
Unknown subcommand

Usage: eyaml <subcommand>

Please use one of the following subcommands or help for more help:
  createkeys, decrypt, edit, encrypt, recrypt, version
```

At this point the edit command reported in the original report above works
again:
```
$ eyaml createkeys
[hiera-eyaml-core] Created key directory: ./keys
[hiera-eyaml-core] Keys created OK

$ eyaml edit foo.eyaml
```

Enter some example content in the editor:
```
# | This is eyaml edit mode. This text (lines starting with # | at the top of
# | the file) will be removed when you save and exit.
# | - To edit encrypted values, change the content of the DEC(<num>)::PKCS7[]!
# | block.
# | WARNING: DO NOT change the number in the parentheses.
# | - To add a new encrypted value copy and paste a new block from the
# | appropriate example below. Note that:
# | * the text to encrypt goes in the square brackets
# | * ensure you include the exclamation mark when you copy and paste
# | * you must not include a number when adding a new block
# | e.g. DEC::PKCS7[]!
---
foo: DEC::PKCS7[bar]!
```

On save it returns:
```
[hiera-eyaml-core] foo.eyaml doesn't exist, editing new file
```

The file now contains an encrypted value:
```
$ cat foo.eyaml
---
foo: ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEh...]
```

Re-running "eyaml edit foo.eyaml" will show the contents unencrypted again.

[ Where problems could occur ]

The patch basically makes sure the returned spec is of the correct type and
changes it if necessary. I guess it could break if ruby objects stopped
supporting the ".respond_to?" method, but it seems unlikely since it is part of
the "default root of all Ruby objects" as defined in
https://ruby-doc.org/core-3.0.2/Object.html

Revision history for this message
Lars Bahner (bahner) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in hiera-eyaml (Ubuntu):
status: New → Confirmed
Revision history for this message
Patrik Lundin (eest) wrote :

This bug should be fixed upstream in https://github.com/voxpupuli/hiera-eyaml/pull/329

Attached is a debdiff that backports that change to the version in 22.04.

For some reason the diff printed by "debdiff" also removes the debian/.gitattributes file, i have removed this from my uploaded file since it is not relevant for what I am trying to fix. It is possible I have cooked it up wrong given that there seems to be dgit stuff involved in debian upstream handling of the package, and I have just added an additional patch via quilt. Let me know if I should be using some other workflow if this is the case.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "1-3.2.2-2ubuntu1.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Simon Quigley (tsimonq2) wrote :

Hi Patrik, thanks for your interest in this bug! I apologize it took so long for us to get to it.

Could you please review our SRU guidelines? https://wiki.ubuntu.com/StableReleaseUpdates

The patch looks good to me, besides the version number (which is easy to fix). If you're willing to modify the bug description to fit those guidelines and test it once it's uploaded, I'll be happy to sponsor!

As for right now, I'm unsubscribing ~ubuntu-sponsors. Please re-subscribe us once the description is all set.

Thank you!

Changed in hiera-eyaml (Ubuntu Jammy):
status: New → Confirmed
Changed in hiera-eyaml (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Patrik Lundin (eest) wrote :
Revision history for this message
Patrik Lundin (eest) wrote :

Updated patch with (hopefully) correct version number, and appended SRU-formatted data to the bug report. Re-subscribed ubuntu sponsors.

description: updated
Revision history for this message
Simon Quigley (tsimonq2) wrote :

Thanks, this looks good to me. I've uploaded it to the Jammy queue, and it's now awaiting a review from the SRU Team.

Please don't forget to test the fix once accepted.

Thank you very much for your contribution to Ubuntu!

Changed in hiera-eyaml (Ubuntu Jammy):
status: Confirmed → In Progress
assignee: nobody → Patrik Lundin (eest)
importance: Undecided → Critical
Changed in hiera-eyaml (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Lars, or anyone else affected,

Accepted hiera-eyaml into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/hiera-eyaml/3.2.2-2ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in hiera-eyaml (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Patrik Lundin (eest) wrote :
Download full text (4.0 KiB)

I have tested the package and it seems to work as expected, steps taken:

First, some machine info:
```
root@ubuntu-test:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy

root@ubuntu-test:~# uname -a
Linux ubuntu-test 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
```

Then we install the currently available version and verify it is broken:
```
root@ubuntu-test:~# apt install hiera-eyaml

root@ubuntu-test:~# dpkg -l hiera-eyaml
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-====================================
ii hiera-eyaml 3.2.2-2 all OpenSSL Encryption backend for Hiera

root@ubuntu-test:~# eyaml
/usr/share/rubygems-integration/all/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:0x000055a0108727f0 @extension_dir=nil, @full_gem_path=nil, @gem_dir=nil, @ignored=nil, @loaded_from="/usr/lib/ruby/gems/3.0.0/specifications/default/abbrev-0.1.0.gemspec", @data=#<Gem::StubSpecification::StubLine:0x000055a010871850 @name="abbrev", @version=#<Gem::Version "0.1.0">, @platform="ruby", @extensions=[], @full_name="abbrev-0.1.0", @require_paths=["lib"]>, @name=nil, @spec=nil, @base_dir="/var/lib/gems/3.0.0", @gems_dir="/var/lib/gems/3.0.0/gems", @default_gem=true> (NoMethodError)
 from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:34:in `each'
 from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:34:in `block in find'
 from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:31:in `each'
 from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:31:in `find'
 from /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.2.2/bin/eyaml:10:in `<top (required)>'
 from /usr/bin/eyaml:25:in `load'
 from /usr/bin/eyaml:25:in `<main>'
```

Then we enable -proposed as detailed in https://wiki.ubuntu.com/Testing/EnableProposed:
```
root@ubuntu-test:~# cat <<EOF >/etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list
# Enable Ubuntu proposed archive
deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe
EOF

root@ubuntu-test:~# cat <<EOF >/etc/apt/preferences.d/proposed-updates
# Configure apt to allow selective installs of packages from proposed
Package: *
Pin: release a=$(lsb_release -cs)-proposed
Pin-Priority: 400
EOF
```

Update apt and install the fixed package:
```
root@ubuntu-test:~# apt update

root@ubuntu-test:~# apt install -t jammy-proposed hiera-eyaml

root@ubuntu-test:~# dpkg -l hiera-eyaml
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status...

Read more...

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I verified the test results and am satisfied that they show the executed planned test case, and that the results are correct.

The package built correctly in all architectures and Ubuntu releases it was meant for.

There are no DEP8 regressions.

There is no SRU freeze ongoing at the moment.

There is no halted phasing on the previous update.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package hiera-eyaml - 3.2.2-2ubuntu0.1

---------------
hiera-eyaml (3.2.2-2ubuntu0.1) jammy; urgency=medium

  * Backport upstream fix to make eyaml command work (LP: #1974059)

 -- Patrik Lundin <email address hidden> Tue, 27 Jan 2023 19:41:41 +0000

Changed in hiera-eyaml (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Update Released

The verification of the Stable Release Update for hiera-eyaml has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.