Bug 1051869 - [abrt] dnf: comps.py:62:_by_pattern:TypeError: expected string or buffer
[abrt] dnf: comps.py:62:_by_pattern:TypeError: expected string or buffer
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
20
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ales Kozumplik
Fedora Extras Quality Assurance
https://retrace.fedoraproject.org/faf...
abrt_hash:75c4414c968c0031860ada041b8...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-12 06:42 EST by Maciek Borzecki
Modified: 2014-09-30 19:42 EDT (History)
7 users (show)

See Also:
Fixed In Version: dnf-plugins-core-0.0.8-2.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-05-31 19:58:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Maciek Borzecki 2014-01-12 06:42:00 EST
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 06:42:06 EST
Created attachment 848878 [details]
File: backtrace
Comment 2 Maciek Borzecki 2014-01-12 06:42:09 EST
Created attachment 848879 [details]
File: environ
Comment 3 Ales Kozumplik 2014-01-13 02:15:03 EST
Indeed an issue. Thanks for the report, we'll take a look.
Comment 4 Ales Kozumplik 2014-03-10 15:19:15 EDT
(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 16:40:02 EDT
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 16:57:57 EDT
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 09:32:20 EDT
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 10:54:12 EDT
Fixed with several 0.5.0 commits up to 6efc9d6.
Comment 9 Fedora Update System 2014-05-02 04:31:51 EDT
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 17:04:24 EDT
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 08:09:42 EDT
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 19:49:40 EDT
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 19:58:11 EDT
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.