I haven't reproduced this, but I can see that this key appears to be
in the keyserver:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x2940ABA983EF826A
And the same command worked from an amazon ec2 instance:
ubuntu@ip-10-122-105-9:~$ sudo gpg --ignore-time-conflict --no-options
--no-default-keyring --secret-keyring /etc/apt/secring.gpg
--trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg
--primary-keyring /etc/apt/trusted.gpg --keyring
/etc/apt/trusted.gpg.d//opscode-keyring.gpg --keyserver
pgpkeys.mit.edu --recv 2940ABA983EF826A
gpg: keyblock resource `/etc/apt/trusted.gpg.d//opscode-keyring.gpg':
file open error
gpg: requesting key 83EF826A from hkp server pgpkeys.mit.edu
gpg: key 83EF826A: public key "Opscode Packages packages@opscode.com" imported
gpg: Total number processed: 1
gpg: imported: 1
sort of:
ubuntu@ip-10-122-105-9:~$ echo $?
2
So, touching the file first works:
ubuntu@ip-10-122-105-9:~$ sudo touch /etc/apt/trusted.gpg.d/opscode-keyring.gpg
ubuntu@ip-10-122-105-9:~$ sudo gpg --ignore-time-conflict --no-options
--no-default-keyring --secret-keyring /etc/apt/secring.gpg
--trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg
--primary-keyring /etc/apt/trusted.gpg --keyring
/etc/apt/trusted.gpg.d/opscode-keyring.gpg --keyserver pgpkeys.mit.edu
--recv 2940ABA983EF826A
gpg: requesting key 83EF826A from hkp server pgpkeys.mit.edu
gpg: key 83EF826A: "Opscode Packages packages@opscode.com" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
ubuntu@ip-10-122-105-9:~$
It looks like gpg is broken WRT how apt-key expects it to work, maybe
not opening with O_CREAT set in the open flags? Anyway, it's not
creating a new keyring file, so this command may need a "touch
/path/to/keyring/file" for now or the apt cookbook could be fixed to
use the default keyring.
I don't know what the right way to handle this is, but you've got a
couple of options, the easier/more visible of which is to have chef
touch the file to be created.
-Peter
On Mon, Jan 9, 2012 at 10:10 AM, Till Brinkmann
till.brinkmann@9elements.com wrote:
hi all,
I´m trying to install chef by using chef-solo bootstrap installation. I face
a problem while importing gpg key from cookbook
log debug.....
[Mon, 09 Jan 2012 13:50:50 +0000] INFO: Processing execute[install-key
2940ABA983EF826A] action run
(/var/chef/cookbooks/apt/providers/repository.rb line 25)
[Mon, 09 Jan 2012 13:50:50 +0000] INFO: execute[install-key
2940ABA983EF826A] sh(apt-key adv --keyserver pgpkeys.mit.edu --recv
2940ABA983EF826A)
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring
--secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg
--keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg
--keyring /etc/apt/trusted.gpg.d//opscode-keyring.gpg --keyserver
pgpkeys.mit.edu --recv 2940ABA983EF826A
gpgkeys: key 2940ABA983EF826A not found on keyserver
[Mon, 09 Jan 2012 13:50:50 +0000] ERROR: execute[install-key
2940ABA983EF826A] (/var/chef/cookbooks/apt/providers/repository.rb line 25)
has had an error
[Mon, 09 Jan 2012 13:50:50 +0000] ERROR: apt_repository[opscode]
(gecode::default line 33) has had an error
[Mon, 09 Jan 2012 13:50:50 +0000] ERROR: apt_repository[opscode]
(/var/chef/cookbooks/gecode/recipes/default.rb:33:in `from_file') had an
error:
I´m not in touch with gpg keys so my question: could be I made a mistake on
installing basic system ?
thanks a lot
Till