Bug 1400081 - Crash with empty includepkgs list in repository configuration file
Summary: Crash with empty includepkgs list in repository configuration file
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf   
(Show other bugs)
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords: Regression
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-30 12:32 UTC by Petr Pisar
Modified: 2016-12-15 12:17 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-15 12:17:44 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Petr Pisar 2016-11-30 12:32:34 UTC
dnf from python3-dnf-2.0.0-0.rc1.4.fc26 crashes if a YUM repository configuration file contains includepkgs directive with an empty list. E.g. having /etc/yum.repos.d/koji.repo with this content:

[f26-build]
name=Fedora 26 on Koji
baseurl=http://kojipkgs.fedoraproject.org/repos/f26-build/latest/$basearch
enabled=0
includepkgs=
gpgcheck=0
metadata_expire=30m

dnf will crash like this:

# dnf help
Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 170, in user_main
    errcode = main(args)
  File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 60, in main
    return _main(base, args)
  File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 93, in _main
    cli.configure(list(map(ucd, args)))
  File "/usr/lib/python3.5/site-packages/dnf/cli/cli.py", line 888, in configure
    self._configure_repos(opts)
  File "/usr/lib/python3.5/site-packages/dnf/cli/cli.py", line 717, in _configure_repos
    self.base.read_all_repos(opts)
  File "/usr/lib/python3.5/site-packages/dnf/base.py", line 331, in read_all_repos
    for repo in reader:
  File "/usr/lib/python3.5/site-packages/dnf/conf/read.py", line 48, in __iter__
    for r in self._get_repos(repofn):
  File "/usr/lib/python3.5/site-packages/dnf/conf/read.py", line 103, in _get_repos
    thisrepo = self._build_repo(parser, section, repofn)
  File "/usr/lib/python3.5/site-packages/dnf/conf/read.py", line 59, in _build_repo
    repo._populate(parser, id_, repofn, dnf.conf.PRIO_REPOCONFIG)
  File "/usr/lib/python3.5/site-packages/dnf/conf/config.py", line 533, in _populate
    opt._set(value, priority)
  File "/usr/lib/python3.5/site-packages/dnf/conf/config.py", line 182, in _set
    self._actual = Value(self._default.value + new.value, priority)
TypeError: can only concatenate list (not "NoneType") to list

This is a regression against dnf-1.1.10-2.fc26.

Comment 1 Michael Mráka 2016-12-01 13:17:38 UTC
Fixed in
https://github.com/rpm-software-management/dnf/pull/668


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