Bug 1814596 - DNF check-update hangs and waiting for stdin
Summary: DNF check-update hangs and waiting for stdin
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 32
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2020-03-18 10:54 UTC by Martin Styk
Modified: 2021-05-25 18:01 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-05-25 18:01:08 UTC
Type: Bug

Attachments (Terms of Use)

Description Martin Styk 2020-03-18 10:54:24 UTC
Description of problem:
I tried to install Fedora 32 from scratch.
I took Fedora-32-20200317.n.1.

KS looks like this

As you can see in %post we have check-update.

Accordingly to docs - Non-interactively checks if updates of the specified packages are available.

^ This doesn't seem to be right, DNF is actually blocking execution on GPG.

However, when I traced down DNF I saw this
strace: Process 26508 attached

[anaconda root@kvm-03-guest24 /]# ls -la /proc/26508/fd/0
lrwx------. 1 root root 64 Mar 18 06:51 /proc/26508/fd/0 -> /dev/pts/0

DNF logs
[anaconda root@kvm-03-guest24 /]# cat /var/log/dnf.log  | tail -n5
2020-03-18T10:33:10Z DEBUG repo: downloading from remote: fedora-cisco-openh264
2020-03-18T10:33:13Z CRITICAL Importing GPG key 0x12C944D0:
 Userid     : "Fedora (32) <fedora-32-primary@fedoraproject.org>"
 Fingerprint: 97A1 AE57 C3A2 372C CA3A 4ABA 6C13 026D 12C9 44D0
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-32-x86_64

[anaconda root@kvm-03-guest24 /]# cat /var/log/dnf.librepo.log  | tail -n5
2020-03-18T10:33:08Z INFO Downloading: http://beaker.engineering.redhat.com/repos/8035634/repodata/a26508f0fa2702a7a2684d2b554437d0b994d6fe-primary.xml.gz
2020-03-18T10:33:08Z INFO Downloading: http://beaker.engineering.redhat.com/repos/8035634/repodata/4d30eab1e409eee31ce62c19be36f98ca5c762de-filelists.xml.gz
2020-03-18T10:33:10Z INFO Downloading: https://codecs.fedoraproject.org/openh264/32/x86_64/repodata/repomd.xml
2020-03-18T10:33:12Z INFO Downloading: https://codecs.fedoraproject.org/openh264/32/x86_64/repodata/repomd.xml.asc
2020-03-18T10:33:13Z INFO Downloading: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-32-x86_64

How reproducible:
Beaker -> Provision latest F32 -> Wait till %post

Actual results:
dnf check-update hanging for better times.

Expected results:
dnf check-update will not require input from stdin.

Additional info:

Comment 1 Daniel Mach 2020-03-18 12:39:07 UTC
When looking at this from an admin perspective,
it's probably not a good idea to automatically
import GPG keys when running check-updates.

In this case, you probably should add -y/--assumeyes to the kickstart.

DNF could be changed to fail on importing a key during check-update
to make it non-interactive again.

Comment 2 Martin Styk 2020-03-18 12:41:04 UTC
(In reply to Daniel Mach from comment #1)
> When looking at this from an admin perspective,
> it's probably not a good idea to automatically
> import GPG keys when running check-updates.
> In this case, you probably should add -y/--assumeyes to the kickstart.


> DNF could be changed to fail on importing a key during check-update
> to make it non-interactive again.

I agree. I'm completely fine with failure. Otherwise, docs should be updated accordingly.

Comment 3 Adam Williamson 2020-03-18 20:01:22 UTC
So whether this is a sensible thing to do in a kickstart is maybe up for debate, but seems there is a real new problem here. You're not supposed to have to sign off on the import of a GPG key on first use like this, IIRC. This is probably caused by the enabling of the Cisco repo by default, which was https://bugzilla.redhat.com/show_bug.cgi?id=1807679 . CCing folks from that bug here: were we expecting this kind of trust prompt? Can we make it not happen?

Comment 4 Kevin Fenzi 2020-03-18 20:24:53 UTC
Well, I think this is really https://bugzilla.redhat.com/show_bug.cgi?id=1768206 ?

ie, it always prompts for the key import even if it's been imoprted already via rpm --import due to the repodata gpg check being enabled...

Comment 5 Adam Williamson 2020-03-18 20:28:38 UTC
oh, so it's because this repo has repo_gpgcheck=1 ?

Comment 6 Dennis Gilmore 2020-03-18 20:32:13 UTC
repo_gpgcheck=1 needs the key to get imported into dnf's databases and not rpm's in order to verify the metadata has not been tampered with, and as the cisco repo bypasses mirrormanager we have no other protection for man in the middle attacks on the repo

Comment 7 Martin Styk 2020-03-19 13:29:02 UTC

this is more than bug 1768206. In this case, you have GPGs because it is part of Fedora, however, command itself (check-update) may end up hanging on read(0. Which is against the documentation - "Non-interactively checks if updates of the specified packages are available."

So the problem is still there, it is more like how you will achieve it.

Comment 8 Kevin Fenzi 2020-03-20 01:03:19 UTC
I am not a dnf developer, so I have no idea the way they want to solve this. ;) 

Perhaps dnf could pull gpg keys from rpm if they are already imported there?
Or as you say, fail if they have to ask anything in a check-update.

Comment 9 Fedora Program Management 2021-04-29 17:12:34 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Ben Cotton 2021-05-25 18:01:08 UTC
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.