Bug 1278969

Summary: dnf assumes 'n' on key import dialog when using sudo
Product: [Fedora] Fedora Reporter: Will Woods <wwoods>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 23CC: awilliam, extras-qa, foss, jmracek, jpazdziora, jshubin, jsilhan, jwakely, luto, mluscon, packaging-team-maint, pnemade, rudas64, tadej.j, tflink, vmukhame, wwoods, yuriybrisk, zenomorph.ebe
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: https://fedoraproject.org/wiki/Common_F21_bugs#fedup-repo-keys
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1066044 Environment:
Last Closed: 2015-11-09 13:44:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1066044    
Bug Blocks:    

Description Will Woods 2015-11-06 21:49:25 UTC
+++ This bug was initially created as a clone of Bug #1066044 +++

--- Additional comment from James (purpleidea) on 2015-11-04 01:52:45 EST ---

I can confirm I just experienced this in Fedora 22, when trying to upgrade to Fedora 23:

james@computer:~$ sudo dnf system-upgrade download --releasever=23 --allowerasing

(5489/5489): libreoffice-core-5.0.3.1-1.fc23.x8 141 kB/s |  74 MB     08:56
--------------------------------------------------------------------------------
Total                                           868 kB/s | 2.6 GB     53:19
warning: /var/lib/dnf/system-upgrade/efivar-libs-0.21-1.fc23.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 34ec9cba: NOKEY
Importing GPG key 0x34EC9CBA:
 Userid     : "Fedora (23) <fedora-23-primary>"
 Fingerprint: EF45 5106 80FB 0232 6B04 5AFB 3247 4CF8 34EC 9CBA
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-x86_64
Is this ok [y/N]: The downloaded packages were saved in cache till the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Didn't install any keys
james@computer:~$ sudo rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-23-x86_64

I manually ran this import command to fix the issue.

--- Additional comment from awilliam on 2015-11-04 02:55:19 EST ---

er...it doesn't look like you answered 'y' to the question whether you wanted to import the key.

--- Additional comment from James (purpleidea) on 2015-11-04 04:15:38 EST ---

(In reply to awilliam from comment #15)
> er...it doesn't look like you answered 'y' to the question whether you
> wanted to import the key.

I had the same thought, however it never prompted me, the script just exited. Either that or it had a very short timeout and I missed it somehow.

--- Additional comment from awilliam on 2015-11-04 12:26:31 EST ---

When you run dnf in some sort of non-interactive way it by default answers 'no' to all questions, you can pass '-y' to make it answer 'yes'. Possibly this is happening when you run through sudo, is my only guess? I think I usually run the dnf command directly as root, not sure about other testers.

Comment 1 James (purpleidea) 2015-11-06 22:24:34 UTC
Can someone else confirm this and make sure it isn't just a timeout?
Yum didn't have this problem, everyone runs it with sudo.

Comment 2 Jaroslav Mracek 2015-11-09 13:44:20 UTC
We cannot reproduce. When we upgraded, there were request for import gpg key. y/N and it waits until options were chosen. Incidental enter hit chose N option.
Please if you will provide a reproducer, feel free to open bug again.