Bug 1051869 - [abrt] dnf: comps.py:62:_by_pattern:TypeError: expected string or buffer
Summary: [abrt] dnf: comps.py:62:_by_pattern:TypeError: expected string or buffer
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ales Kozumplik
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:75c4414c968c0031860ada041b8...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-12 11:42 UTC by Maciek Borzecki
Modified: 2014-09-30 23:42 UTC (History)
7 users (show)

Fixed In Version: dnf-plugins-core-0.0.8-2.fc20
Clone Of:
Environment:
Last Closed: 2014-05-31 23:58:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (7.74 KB, text/plain)
2014-01-12 11:42 UTC, Maciek Borzecki
no flags Details
File: environ (1.82 KB, text/plain)
2014-01-12 11:42 UTC, Maciek Borzecki
no flags Details

Description Maciek Borzecki 2014-01-12 11:42:00 UTC
Description of problem:
Tried dnf gouprerase 'Xfce Desktop' (group name as found through dnf grouplist).
Printing all groups in comps.py showed that there is no group named 'Xfce Desktop'.
So either dnf uses incorrect source for group information when doing grouperase
or grouplist prints incorrect results.

Version-Release number of selected component:
dnf-0.4.11-1.fc20

Additional info:
reporter:       libreport-2.1.11
cmdline:        /usr/bin/python /bin/dnf grouperase 'Xfce Desktop'
executable:     /bin/dnf
kernel:         3.12.6-300.fc20.x86_64
runlevel:       N 5
type:           Python
uid:            0

Truncated backtrace:
#1 _by_pattern in /usr/lib/python2.7/site-packages/dnf/comps.py:62
#2 groups_by_pattern in /usr/lib/python2.7/site-packages/dnf/comps.py:263
#3 group_remove in /usr/lib/python2.7/site-packages/dnf/base.py:1345
#4 removeGroups in /usr/lib/python2.7/site-packages/dnf/cli/cli.py:921
#5 run in /usr/lib/python2.7/site-packages/dnf/cli/commands.py:724
#6 run in /usr/lib/python2.7/site-packages/dnf/cli/cli.py:1456
#7 _main in /usr/lib/python2.7/site-packages/dnf/cli/main.py:122
#8 main in /usr/lib/python2.7/site-packages/dnf/cli/main.py:63
#9 user_main in /usr/lib/python2.7/site-packages/dnf/cli/main.py:240
#10 <module> in /bin/dnf:35

Comment 1 Maciek Borzecki 2014-01-12 11:42:06 UTC
Created attachment 848878 [details]
File: backtrace

Comment 2 Maciek Borzecki 2014-01-12 11:42:09 UTC
Created attachment 848879 [details]
File: environ

Comment 3 Ales Kozumplik 2014-01-13 07:15:03 UTC
Indeed an issue. Thanks for the report, we'll take a look.

Comment 4 Ales Kozumplik 2014-03-10 19:19:15 UTC
(possibly dupe of bug 1063666)

Maciek what happens with dnf-0.4.17 or later when the same command is issued:

dnf grouperase 'Xfce Desktop'

Comment 5 Maciek Borzecki 2014-03-10 20:40:02 UTC
Picked this build from koji: https://koji.fedoraproject.org/koji/buildinfo?buildID=502565

[mborzecki@localhost:~]$ sudo dnf grouperase 'Xfce Desktop'
Problem with repo 'fedorautils': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried, disabling.
Traceback (most recent call last):
  File "/bin/dnf", line 35, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 242, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 124, in _main
    cli.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1428, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/commands.py", line 732, in run
    return self.base.removeGroups(extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 886, in removeGroups
    cnt += self.group_remove(group_string)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 1374, in group_remove
    groups = self.comps.groups_by_pattern(grp_spec)
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 263, in groups_by_pattern
    return _by_pattern(pattern, case_sensitive, self.groups)
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 62, in _by_pattern
    matching = [g for g in sqn if match(g.name) or match(g.id)]
TypeError: expected string or buffer

I think I know the source of the problem. I have RedHat KDE repo added in the system. The groups.xml file may potentially have incorrect data. Take a look at this file: http://mirror.unl.edu/kde-redhat/fedora/20/x86_64/stable/groups.xml
Shouldn't _id and _name nodes be named id and name like in other group.xml files?

Comment 6 Maciek Borzecki 2014-03-10 20:57:57 UTC
meanwhile I asked form some input on Fedora-KDE list https://lists.fedoraproject.org/pipermail/kde/2014-March/013190.html

Comment 7 Rex Dieter 2014-03-11 13:32:20 UTC
I went ahead and simply removed the group metadata files from kde-redhat repos.  

As far as I can tell, though, fedora's comps uses the same style with <id>, <_name>, <_description> tags, see:
https://git.fedorahosted.org/cgit/comps.git/tree/comps-f20.xml.in

Comment 8 Ales Kozumplik 2014-04-08 14:54:12 UTC
Fixed with several 0.5.0 commits up to 6efc9d6.

Comment 9 Fedora Update System 2014-05-02 08:31:51 UTC
dnf-0.5.1-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/dnf-0.5.1-1.fc20

Comment 10 Fedora Update System 2014-05-02 21:04:24 UTC
Package dnf-0.5.1-1.fc20, hawkey-0.4.14-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-0.5.1-1.fc20 hawkey-0.4.14-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-5937/hawkey-0.4.14-1.fc20,dnf-0.5.1-1.fc20
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2014-05-28 12:09:42 UTC
dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/libsolv-0.6.1-1.git6d968f1.fc20,hawkey-0.4.16-1.fc20,dnf-0.5.2-1.fc20,dnf-plugins-core-0.0.8-2.fc20

Comment 12 Fedora Update System 2014-05-28 23:49:40 UTC
Package dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-plugins-core-0.0.8-2.fc20 libsolv-0.6.1-1.git6d968f1.fc20 hawkey-0.4.16-1.fc20 dnf-0.5.2-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-6789/libsolv-0.6.1-1.git6d968f1.fc20,hawkey-0.4.16-1.fc20,dnf-0.5.2-1.fc20,dnf-plugins-core-0.0.8-2.fc20
then log in and leave karma (feedback).

Comment 13 Fedora Update System 2014-05-31 23:58:11 UTC
dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


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