After adding a apt_repository resource to one of our recipes client nodes are now returning a chef failure as follows.
================================================================================
Error executing action `add` on resource 'apt_repository[ffmpeg4-repository]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
execute[install-key 374C7797FB006459] (/opt/chef/embedded/lib/ruby/gems/3.0.0/gems/chef-17.6.18/lib/chef/resource/apt_repository.rb line 305) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of apt-key adv --no-tty --recv --keyserver hkp://keyserver.ubuntu.com:80 374C7797FB006459 ----
STDOUT: Executing: /tmp/apt-key-gpghome.eaZG1jysyT/gpg.1.sh --no-tty --recv --keyserver hkp://keyserver.ubuntu.com:80 374C7797FB006459
STDERR: Warning: apt-key output should not be parsed (stdout is not a terminal)
gpg: keyserver receive failed: No data
---- End output of apt-key adv --no-tty --recv --keyserver hkp://keyserver.ubuntu.com:80 374C7797FB006459 ----
Ran apt-key adv --no-tty --recv --keyserver hkp://keyserver.ubuntu.com:80 374C7797FB006459 returned 2
Is there a way to avoid this? The apt-key is required for installation and we do not want to disable gpg checks. The resources are defined as follows.
apt_repository 'ffmpeg4-repository' do
uri node['ffmpeg4']['apt_uri']
distribution node['foo']['dist_release']
components %w(main)
key '374C7797FB006459'
keyserver 'keyserver.ubuntu.com'
action :add
end
apt_repository 'ffmpeg5-repository' do
uri node['ffmpeg5']['apt_uri']
distribution node['foo']['dist_release']
components %w(main)
key '374C7797FB006459'
keyserver 'keyserver.ubuntu.com'
action :add
end