aptly-dev / aptly

aptly - Debian repository management tool
https://www.aptly.info/
MIT License
2.54k stars 369 forks source link

ERROR: unable to initialize GPG signer: unable to execute gpg #1307

Open j75 opened 6 days ago

j75 commented 6 days ago

Trying to publish a snapshot (aptly publish snapshot -gpg-key=... snapshot) generates the error in the title.

Detailed Description

I think the error comes from the fact that my keyring contains several keys; if I save only a key in a keyring and use it as the default keyring then it works.

Context

Debian 12.6 ; aptly version is 1.5.0+ds1-1+b4

j75 commented 23 hours ago

I tried to play with parameters -gpg-key, -keyring and -secret-keyring but they do not seem to be taken in account

neolynx commented 23 hours ago

please provide the full command...

j75 commented 22 hours ago

aptly publish snapshot -gpg-key=... first-snapshot

j75 commented 22 hours ago
% aptly publish snapshot  -keyring="/home/devel/.gnupg/my-pubring.gpg"
   -secret-keyring="/home/devel/.gnupg/my-secring.gpg"  first-snapshot

ERROR: unable to initialize GPG signer: unable to execute gpg: exit status 2 (is gpg installed?): /home/devel/.gnupg/pubring.gpg
------------------------------

Please note that even I specified the ~/.gnupg/my-pubring.gpg public keyring it still looks for ~/.gnupg/pubring.gpg file; these files contain only a single key (~/.gnupg/pubring.gpg and ~/.gnupg/secring.gpg contain several).

neolynx commented 21 hours ago

this works here:

aptly publish snapshot -architectures amd64 -distribution stable -keyring trustedkeys.gpg -gpg-key reposign@molior -batch -passphrase-file ./gpg-secret snapshot1 publish-test

maybe you can try without specifying the gpg full path ? it should also find the secret-keyring itself I guess...

are you using gpg1 or gpg2 ?

j75 commented 10 hours ago

On Debian 12.6 the gpg version is 2.2.40.

neolynx commented 10 hours ago

ok, thanks. the debian version is a bit older, maybe tit has problems with gpg2.

could you try this:

aptly publish snapshot  -keyring my-pubring.gpg first-snapshot

and paste the command and output if it fails...

j75 commented 7 hours ago

I deleted one obsolete key from my keyring, I have exported all other keys (including secret ones) then in a clean folder I have imported them, I have commented list-options show-photos line in the gpg.conf file... and now it works! I presume it was something wrong in my keyring...

I shall retry again the option -keyring to see what's happening, and if it works I shall close the bug.