Bug 1289449 - "dnf makecache" crashed on repositories with metadata_expire=never: TypeError: unorderable types: NoneType() <= int()
Summary: "dnf makecache" crashed on repositories with metadata_expire=never: TypeError...
Keywords:
Status: CLOSED DUPLICATE of bug 1289166
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-08 07:19 UTC by Petr Pisar
Modified: 2015-12-08 14:09 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-08 14:09:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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


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