Bug 1289449

Summary: "dnf makecache" crashed on repositories with metadata_expire=never: TypeError: unorderable types: NoneType() <= int()
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jmracek, jsilhan, mluscon, packaging-team-maint, pnemade, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-08 14:09:59 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:

Description Petr Pisar 2015-12-08 07:19:15 UTC
After upgrading from Fedora 22 to 23, I receive this Python backtrace on "dnf makecache":

# dnf makecache
Traceback (most recent call last):
  File "/usr/bin/dnf", line 57, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 174, in user_main
    errcode = main(args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 60, in main
    return _main(base, args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 112, in _main
    cli.run()
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 1091, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python3.4/site-packages/dnf/cli/commands/makecache.py", line 72, in run
    if not is_cache or expires_in <= 0:
TypeError: unorderable types: NoneType() <= int()

This is because the expires_in variable set by r.metadata_expire_in() has None value because my /etc/dnf/dnf.conf has metadata_expire=never in main section.

I have dnf-1.1.4-2.fc23.

With Fedora 22, I set metadata_expire=never to prevent from spurious metadata updates whenever I run dnf and I updated the metadata caches by "dnf makecache" manually when I wanted.

This seems not working with Fedora 23 anymore. Reading manual I'm confused. How can I trigger metadata update only on my discretion? "dnf clean metadata" removes all caches and redownloads even those metadata that have not changed on the server. Is "dnf clean expire-cache" followed by "dnf makecache" with "metadata_expire=never" what I need?

Comment 1 Jaroslav Mracek 2015-12-08 14:09:59 UTC

*** This bug has been marked as a duplicate of bug 1289166 ***