sous-chefs / apt

Development repository for the apt cookbook
https://supermarket.chef.io/cookbooks/apt
Apache License 2.0
202 stars 266 forks source link

apt_repository needs dirmngr installed #234

Closed palfrey closed 6 years ago

palfrey commented 6 years ago

Cookbook version

6.1.4

Chef-client version

13.7.16

Platform Details

Debian Stretch

Scenario:

Adding new apt_repository

Steps to Reproduce:

I was using nodejs::repo (https://github.com/redguide/nodejs/blob/master/recipes/repo.rb) but anything that uses apt_repository on a fresh Debian Stretch box will fail similarly. Note that this doesn't work on your current Travis tests, as the Dokken Docker Stretch box installs dirmngr (https://github.com/someara/dokken-images/blob/master/debian-9/Dockerfile)

Expected Result:

New apt repository added ok

Actual Result:

[2018-02-04T22:18:18+00:00] ERROR: apt_repository[node.js] (nodejs::repo line 5) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[install-key 1655a0ab68576280] (/var/lib/gems/2.3.0/gems/chef-13.7.16/lib/chef/provider/apt_repository.rb line 194) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of apt-key adv --recv --keyserver hkp://keyserver.ubuntu.com:80 1655a0ab68576280 ----
STDOUT: Executing: /tmp/apt-key-gpghome.0WrlgX684r/gpg.1.sh --recv --keyserver hkp://keyserver.ubuntu.com:80 1655a0ab68576280
STDERR: Warning: apt-key output should not be parsed (stdout is not a terminal)
gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.0WrlgX684r/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr
---- End output of apt-key adv --recv --keyserver hkp://keyserver.ubuntu.com:80 1655a0ab68576280 ----
Ran apt-key adv --recv --keyserver hkp://keyserver.ubuntu.com:80 1655a0ab68576280 returned 2

Relatedly, there's https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845720 but upstream has marked it as "wontfix" for some reason.

majormoses commented 6 years ago

I think its reasonable to add the package to be installed in the default recipe. Not sure how the other maintainers feel but I can certainly agree with the debian maintainer that gpg can be run without dirmgr as it is only needed if you are using a nework. As this repo/cookbook clearly takes the stance that you have a network to add keys from I think we should add it here.