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]>

Full log


🔗 View this message in rfc822 format

MIME-Version: 1.0
X-Mailer: MIME-tools 5.509 (Entity 5.509)
X-Loop: [email protected]
From: "Debian Bug Tracking System" <[email protected]>
To: Andreas Metzler <[email protected]>
Subject: Bug#863557: marked as done (gpg: Prints message on stderr about
 primary-keyring file existence)
Message-ID: <[email protected]>
References: <[email protected]>
 <[email protected]>
X-Debian-PR-Message: closed 863557
X-Debian-PR-Package: gnupg
X-Debian-PR-Source: gnupg, gnupg2
Reply-To: [email protected]
Date: Fri, 18 Apr 2025 12:51:05 +0000
Content-Type: multipart/mixed; boundary="----------=_1744980665-1564035-0"
[Message part 1 (text/plain, inline)]
Your message dated Fri, 18 Apr 2025 14:49:46 +0200
with message-id <[email protected]>
and subject line Re: Bug#863557: gpg: Prints message on stderr about primary-keyring file existence
has caused the Debian Bug report #863557,
regarding gpg: Prints message on stderr about primary-keyring file existence
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
863557: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863557
Debian Bug Tracking System
Contact [email protected] with problems
[Message part 2 (message/rfc822, inline)]
From: Guillem Jover <[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
[Message part 3 (message/rfc822, inline)]
From: Andreas Metzler <[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 17:59:13 2025; Machine Name: bembo

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.