Debian Bug report logs - #863557
gpg: Prints message on stderr about primary-keyring file existence

version graph

Package: gnupg; Maintainer for gnupg is Debian GnuPG Maintainers <[email protected]>; Source for gnupg is src:gnupg2 (PTS, buildd, popcon).

Reported by: Guillem Jover <[email protected]>

Date: Sun, 28 May 2017 14:00:02 UTC

Severity: normal

Found in versions gnupg2/2.1.21-2, gnupg2/2.1.18-8~deb9u1

Done: Andreas Metzler <[email protected]>

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Debian GnuPG-Maintainers <[email protected]>:
Bug#863557; Package gnupg. (Sun, 28 May 2017 14:00:04 GMT) (full text, mbox, link).


Acknowledgement sent to Guillem Jover <[email protected]>:
New Bug report received and forwarded. Copy sent to Debian GnuPG-Maintainers <[email protected]>. (Sun, 28 May 2017 14:00:05 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Guillem Jover <[email protected]>
To: [email protected]
Subject: gpg: Prints message on stderr about primary-keyring file existence
Date: Sun, 28 May 2017 15:57:14 +0200
Package: gnupg
Version: 2.1.21-2
Severity: normal

Hi!

I've got configured my personal keyring as the primary one so that I
can add additional third-party ones, something like this:

  ,---
  # Set the primary keyring
  primary-keyring ~/.gnupg/pubring.kbx

  # Additional keyrings: Debian
  keyring /usr/share/keyrings/debian-keyring.gpg
  keyring /usr/share/keyrings/debian-maintainers.gpg
  keyring /usr/share/keyrings/debian-nonupload.gpg
  keyring /usr/share/keyrings/debian-role-keys.gpg

  # Keyservers
  keyserver hkps://hkps.pool.sks-keyservers.net
  `---

But this makes gpg, emit the following message on stderr:

 ,---
 gpg: keyblock resource '<HOME>/.gnupg/pubring.kbx': File exists
 `---

which at least messes up with mutt when sending encrypted mail, as it
detects that there is stuff on stderr and considers it a problem, and
then aborts the send action.

If the notice/warning/error was because the file is missing that would
make some sense, but as it is, it looks just unnecessarily chatty? :)

Thanks,
Guillem



Information forwarded to [email protected], [email protected], Debian GnuPG Maintainers <[email protected]>:
Bug#863557; Package gnupg. (Sun, 28 Jan 2018 22:27:05 GMT) (full text, mbox, link).


Acknowledgement sent to Phil Morrell <[email protected]>:
Extra info received and forwarded to list. Copy sent to [email protected], Debian GnuPG Maintainers <[email protected]>. (Sun, 28 Jan 2018 22:27:05 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Phil Morrell <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: Re: gpg: Prints message on stderr about primary-keyring file existence
Date: Sun, 28 Jan 2018 22:22:47 +0000
Package: gnupg
Version: 2.1.18-8~deb9u1
Followup-For: Bug #863557

etc.



-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gnupg depends on:
ii  gnupg-agent    2.1.18-8~deb9u1
ii  libassuan0     2.4.3-2
ii  libbz2-1.0     1.0.6-8.1
ii  libc6          2.24-11+deb9u1
ii  libgcrypt20    1.7.6-2+deb9u2
ii  libgpg-error0  1.26-2
ii  libksba8       1.3.5-2
ii  libreadline7   7.0-3
ii  libsqlite3-0   3.16.2-5+deb9u1
ii  zlib1g         1:1.2.8.dfsg-5

Versions of packages gnupg recommends:
ii  dirmngr     2.1.18-8~deb9u1
ii  gnupg-l10n  2.1.18-8~deb9u1

Versions of packages gnupg suggests:
ii  parcimonie  0.10.2-4
pn  xloadimage  <none>

-- no debconf information



Information forwarded to [email protected], [email protected], Debian GnuPG Maintainers <[email protected]>:
Bug#863557; Package gnupg. (Sun, 28 Jan 2018 22:57:03 GMT) (full text, mbox, link).


Acknowledgement sent to Phil Morrell <[email protected]>:
Extra info received and forwarded to list. Copy sent to [email protected], Debian GnuPG Maintainers <[email protected]>. (Sun, 28 Jan 2018 22:57:03 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Phil Morrell <[email protected]>
To: Guillem Jover <[email protected]>
Cc: Debian Bug Tracking System <[email protected]>
Subject: Re: gpg: Prints message on stderr about primary-keyring file existence
Date: Sun, 28 Jan 2018 22:52:37 +0000
[Message part 1 (text/plain, inline)]
Package: gnupg
Version: 2.1.18-8~deb9u1
Followup-For: Bug #863557



Hi Guillem,

I believe this is a documentation bug, you simply need to add
`no-default-keyring` before `primary-keyring`.

I discovered this report whilst trying to separate automatically
retrieved keys from my manual keyring. Essentially, `primary-keyring`
doesn't just "designate" the primary, it appends to the keyrings list.

    keyring ~/.gnupg/public-keys/auto.kbx
    ...
    primary-keyring ~/.gnupg/public-keys/auto.kbx

This is also not specific to the `primary-keyring` option, listing the
same keyring entry twice either via gpg.conf or cli options shows the
same unhelpful message. So a minimally reproducable test for this is:

    gpg --keyring pubring.kbx --list-keys
--
Phil Morrell (emorrp1)



-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gnupg depends on:
ii  gnupg-agent    2.1.18-8~deb9u1
ii  libassuan0     2.4.3-2
ii  libbz2-1.0     1.0.6-8.1
ii  libc6          2.24-11+deb9u1
ii  libgcrypt20    1.7.6-2+deb9u2
ii  libgpg-error0  1.26-2
ii  libksba8       1.3.5-2
ii  libreadline7   7.0-3
ii  libsqlite3-0   3.16.2-5+deb9u1
ii  zlib1g         1:1.2.8.dfsg-5

Versions of packages gnupg recommends:
ii  dirmngr     2.1.18-8~deb9u1
ii  gnupg-l10n  2.1.18-8~deb9u1

Versions of packages gnupg suggests:
ii  parcimonie  0.10.2-4
pn  xloadimage  <none>

-- no debconf information
[signature.asc (application/pgp-signature, inline)]

Reply sent to Andreas Metzler <[email protected]>:
You have taken responsibility. (Fri, 18 Apr 2025 12:51:05 GMT) (full text, mbox, link).


Notification sent to Guillem Jover <[email protected]>:
Bug acknowledged by developer. (Fri, 18 Apr 2025 12:51:05 GMT) (full text, mbox, link).


Message #20 received at [email protected] (full text, mbox, reply):

From: Andreas Metzler <[email protected]>
To: [email protected]
Subject: Re: Bug#863557: gpg: Prints message on stderr about primary-keyring file existence
Date: Fri, 18 Apr 2025 14:49:46 +0200
Verdsion: 2.4.7-1

On 2018-01-28 Phil Morrell <[email protected]> wrote:
> Package: gnupg
> Version: 2.1.18-8~deb9u1
> Followup-For: Bug #863557

> Hi Guillem,

> I believe this is a documentation bug, you simply need to add
> `no-default-keyring` before `primary-keyring`.

> I discovered this report whilst trying to separate automatically
> retrieved keys from my manual keyring. Essentially, `primary-keyring`
> doesn't just "designate" the primary, it appends to the keyrings list.

>     keyring ~/.gnupg/public-keys/auto.kbx
>     ...
>     primary-keyring ~/.gnupg/public-keys/auto.kbx

> This is also not specific to the `primary-keyring` option, listing the
> same keyring entry twice either via gpg.conf or cli options shows the
> same unhelpful message. So a minimally reproducable test for this is:

>     gpg --keyring pubring.kbx --list-keys
[...]

Yes, I think Phil nailed it, current gpg manpage says:
--primary-keyring file
              This is a varian of --keyring [...]

and --keyring 
        Add  file  to the current list of keyrings. [...]
        Note that this adds a keyring to the current list. If the  intent
        is  to  use the specified keyring alone, use --keyring along with
        --no-default-keyring.

cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 13:29:18 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.