Bug 1289449 - "dnf makecache" crashed on repositories with metadata_expire=never: TypeError: unorderable types: NoneType() <= int()
"dnf makecache" crashed on repositories with metadata_expire=never: TypeError...
Status: CLOSED DUPLICATE of bug 1289166
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-12-08 02:19 EST by Petr Pisar
Modified: 2015-12-08 09:09 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-12-08 09:09:59 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Petr Pisar 2015-12-08 02:19:15 EST
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
  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 09:09:59 EST

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

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