Bug 1222694 - [abrt] python-dnf: comps.py:86:install_or_skip:TypeError: unsupported operand type(s) for +=: 'int' and 'TransactionBunch'
[abrt] python-dnf: comps.py:86:install_or_skip:TypeError: unsupported operand...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
22
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Honza Silhan
Fedora Extras Quality Assurance
https://retrace.fedoraproject.org/faf...
abrt_hash:ab3a0af23a75210aab9dcf29598...
:
: 1225285 1231477 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-18 16:32 EDT by Onuralp SEZER
Modified: 2015-07-24 09:02 EDT (History)
26 users (show)

See Also:
Fixed In Version: dnf-1.0.1-2.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-06-20 20:16:14 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 (1.50 KB, text/plain)
2015-05-18 16:32 EDT, Onuralp SEZER
no flags Details
File: environ (3.23 KB, text/plain)
2015-05-18 16:32 EDT, Onuralp SEZER
no flags Details

  None (edit)
Description Onuralp SEZER 2015-05-18 16:32:18 EDT
Description of problem:
I was using dnf migrate tool for yum db files and It's crashed when I used. 

Version-Release number of selected component:
python-dnf-1.0.0-1.fc22

Additional info:
reporter:       libreport-2.5.1
cmdline:        /usr/bin/python -OO /usr/bin/dnf-2 migrate
dso_list:       python-dnf-plugins-extras-migrate-0.0.7-1.fc22.noarch
executable:     /usr/bin/dnf-2
kernel:         4.0.3-300.fc22.x86_64
runlevel:       N 5
type:           Python
uid:            0

Truncated backtrace:
comps.py:86:install_or_skip:TypeError: unsupported operand type(s) for +=: 'int' and 'TransactionBunch'

Traceback (most recent call last):
  File "/usr/bin/dnf-2", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 185, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 134, in _main
    cli.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1077, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/migrate.py", line 126, in run
    self.migrate_groups()
  File "/usr/lib/python2.7/site-packages/dnf-plugins/migrate.py", line 247, in migrate_groups
    group_cmd._mark_install(installed)
  File "/usr/lib/python2.7/site-packages/dnf/cli/commands/group.py", line 240, in _mark_install
    dnf.comps.install_or_skip(solver.group_install, res.groups, types)
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 86, in install_or_skip
    count += install_fnc(grp, types, None)
TypeError: unsupported operand type(s) for +=: 'int' and 'TransactionBunch'

Local variables in innermost frame:
count: 0
grp_or_env: [<dnf.comps.Group object at 0x7fbb94074f10>]
install_fnc: <bound method Solver.group_install of <dnf.comps.Solver object at 0x7fbb94a1f8d0>>
types: 14
grp: <dnf.comps.Group object at 0x7fbb94074f10>
Comment 1 Onuralp SEZER 2015-05-18 16:32:23 EDT
Created attachment 1026865 [details]
File: backtrace
Comment 2 Onuralp SEZER 2015-05-18 16:32:24 EDT
Created attachment 1026866 [details]
File: environ
Comment 3 Honza Silhan 2015-05-20 06:02:01 EDT
Thanks for the report.
Comment 4 Matteo Settenvini 2015-05-26 07:01:38 EDT
Another user experienced a similar problem:

Trying to run dnf-2 update after updating both dnf and yum to latest version.

reporter:       libreport-2.3.0
cmdline:        /usr/bin/python -OO /usr/bin/dnf-2 migrate --verbose
dso_list:       python-dnf-plugins-extras-migrate-0.0.8-1.fc22.noarch
executable:     /usr/bin/dnf-2
kernel:         3.20.0-0.rc0.git5.1.fc22.x86_64
package:        python-dnf-1.0.0-1.fc22
reason:         comps.py:86:install_or_skip:TypeError: unsupported operand type(s) for +=: 'int' and 'TransactionBunch'
runlevel:       N 5
type:           Python
uid:            0
Comment 5 Honza Silhan 2015-05-26 09:22:34 EDT
I need more debug data to see whats going on. Can anyone upload the "/var/log/dnf.log" file just after crash and provide output of `yum group list` and `dnf group list`, please?
Comment 6 Honza Silhan 2015-05-26 09:31:27 EDT
* I need the output of `yum-deprecated group list` actually if you're running on f22+.
Comment 7 Ken Wills 2015-05-26 17:39:05 EDT
I'm seeing the same thing:

# dnf-2 migrate
2108 YUMDB records found, 0 migrated, 2108 skipped/preserved
Migrating groups data...
Yum command has been deprecated, use dnf instead.
See 'man dnf' and 'man yum2dnf' for more information.

Traceback (most recent call last):
  File "/bin/dnf-2", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 185, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 134, in _main
    cli.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1077, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/migrate.py", line 126, in run
    self.migrate_groups()
  File "/usr/lib/python2.7/site-packages/dnf-plugins/migrate.py", line 247, in migrate_groups
    group_cmd._mark_install(installed)
  File "/usr/lib/python2.7/site-packages/dnf/cli/commands/group.py", line 240, in _mark_install
    dnf.comps.install_or_skip(solver.group_install, res.groups, types)
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 86, in install_or_skip
    count += install_fnc(grp, types, None)
TypeError: unsupported operand type(s) for +=: 'int' and 'TransactionBunch'



# yum-deprecated group list
Yum command has been deprecated, use dnf instead.
See 'man dnf' and 'man yum2dnf' for more information.

Loaded plugins: langpacks
Available environment groups:
   Minimal Install
   Fedora Server
   Fedora Workstation
   Fedora Cloud Server
   KDE Plasma Workspaces
   Xfce Desktop
   LXDE Desktop
   LXQt Desktop
   Cinnamon Desktop
   MATE Desktop
   Sugar Desktop Environment
   Development and Creative Workstation
   Web Server
   Infrastructure Server
   Basic Desktop
Installed groups:
   Development Tools
   LibreOffice
Available Groups:
   3D Printing
   Administration Tools
   Audio Production
   Authoring and Publishing
   Books and Guides
   C Development Tools and Libraries
   Cloud Infrastructure
   Cloud Management Tools
   Container Management
   D Development Tools and Libraries
   Design Suite
   Domain Membership
   Editors
   Educational Software
   Electronic Lab
   Engineering and Scientific
   Fedora Eclipse
   FreeIPA Server
   Games and Entertainment
   Headless Management
   MATE Applications
   MATE Compiz
   Medical Applications
   Milkymist
   Network Servers
   Office/Productivity
   RPM Development Tools
   Robotics
   Security Lab
   Sound and Video
   System Tools
   Text-based Internet
   Window Managers
Done
Comment 8 Ting-Wei Lan 2015-05-27 02:30:16 EDT
I also see the same thing:

# cat /var/log/dnf.log
May 27 14:02:41 INFO --- logging initialized ---
May 27 14:02:41 DDEBUG timer: config: 10 ms
May 27 14:02:41 DEBUG cachedir: /var/cache/dnf/x86_64/22

# yum-deprecated group list
Loaded plugins: auto-update-debuginfo, copr, etckeeper, fastestmirror, langpacks, list-data, merge-conf, priorities, ps
Loading mirror speeds from cached hostfile
Available environment groups:
   Minimal Install
   Fedora Server
   Fedora Workstation
   Fedora Cloud Server
   KDE Plasma Workspaces
   Xfce Desktop
   LXDE Desktop
   LXQt Desktop
   Cinnamon Desktop
   MATE Desktop
   Sugar Desktop Environment
   Development and Creative Workstation
   Web Server
   Infrastructure Server
   Basic Desktop
Installed groups:
   3D Printing
   Administration Tools
   Authoring and Publishing
   C Development Tools and Libraries
   Cloud Infrastructure
   Design Suite
   Development Tools
   Editors
   Educational Software
   Electronic Lab
   Fedora Eclipse
   LibreOffice
   Milkymist
   Network Servers
   Office/Productivity
   RPM Development Tools
   Security Lab
   Sound and Video
   System Tools
   Text-based Internet
   Window Managers
Available Groups:
   Audio Production
   Books and Guides
   Cloud Management Tools
   Container Management
   D Development Tools and Libraries
   Domain Membership
   Engineering and Scientific
   FreeIPA Server
   Games and Entertainment
   Headless Management
   MATE Applications
   MATE Compiz
   Medical Applications
   Robotics
Done

# dnf group list
Last metadata expiration check performed 0:00:00 ago on Wed May 27 14:23:43 2015.
Available environment groups:
   Minimal Install
   Fedora Server
   Fedora Workstation
   Fedora Cloud Server
   KDE Plasma Workspaces
   Xfce Desktop
   LXDE Desktop
   LXQt Desktop
   Cinnamon Desktop
   MATE Desktop
   Sugar Desktop Environment
   Development and Creative Workstation
   Web Server
   Infrastructure Server
   Basic Desktop
Available groups:
   3D Printing
   Administration Tools
   Audio Production
   Authoring and Publishing
   Books and Guides
   C Development Tools and Libraries
   Cloud Infrastructure
   Cloud Management Tools
   Container Management
   D Development Tools and Libraries
   Design Suite
   Development Tools
   Domain Membership
   Fedora Eclipse
   Editors
   Educational Software
   Electronic Lab
   Engineering and Scientific
   FreeIPA Server
   Games and Entertainment
   Headless Management
   LibreOffice
   MATE Applications
   MATE Compiz
   Medical Applications
   Milkymist
   Network Servers
   Office/Productivity
   Robotics
   RPM Development Tools
   Security Lab
   Sound and Video
   System Tools
   Text-based Internet
   Window Managers
Comment 9 ben_redhat 2015-05-27 18:19:25 EDT
Same here


# last output of yum2dnf
[...]
2194 YUMDB records found, 26 migrated, 2168 skipped/preserved
Migrating groups data...
Yum command has been deprecated, use dnf instead.
See 'man dnf' and 'man yum2dnf' for more information.

Traceback (most recent call last):
  File "/usr/bin/dnf-2", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 185, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 134, in _main
    cli.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1077, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/migrate.py", line 126, in run
    self.migrate_groups()
  File "/usr/lib/python2.7/site-packages/dnf-plugins/migrate.py", line 247, in migrate_groups
    group_cmd._mark_install(installed)
  File "/usr/lib/python2.7/site-packages/dnf/cli/commands/group.py", line 240, in _mark_install
    dnf.comps.install_or_skip(solver.group_install, res.groups, types)
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 86, in install_or_skip
    count += install_fnc(grp, types, None)
TypeError: unsupported operand type(s) for +=: 'int' and 'TransactionBunch'



# tail /var/log/dnf.log
May 28 00:05:57 INFO 2194 YUMDB records found, 26 migrated, 2168 skipped/preserved
May 28 00:05:57 INFO Migrating groups data...
May 28 00:06:01 DEBUG_2 Getting group metadata
May 28 00:06:01 DEBUG_2 Adding group file from repository: fedora
May 28 00:06:01 DEBUG_2 Adding group file from repository: updates
May 28 00:06:01 DEBUG_2 timer: loading comps: 210 ms
May 28 00:06:01 DEBUG_2 Cleaning up.



# dnf group list
Last metadata expiration check performed 1:31:15 ago on Wed May 27 22:47:26 2015.
Available environment groups:
   Minimal Install
   Fedora Server
   Fedora Workstation
   Fedora Cloud Server
   KDE Plasma Workspaces
   Xfce Desktop
   LXDE Desktop
   LXQt Desktop
   Cinnamon Desktop
   MATE Desktop
   Sugar Desktop Environment
   Development and Creative Workstation
   Web Server
   Infrastructure Server
   Basic Desktop
Available groups:
   3D Printing
   Administration Tools
   Audio Production
   Authoring and Publishing
   Books and Guides
   C Development Tools and Libraries
   Cloud Infrastructure
   Cloud Management Tools
   Container Management
   D Development Tools and Libraries
   Design Suite
   Development Tools
   Domain Membership
   Fedora Eclipse
   Editors
   Educational Software
   Electronic Lab
   Engineering and Scientific
   FreeIPA Server
   Games and Entertainment
   Headless Management
   LibreOffice
   MATE Applications
   MATE Compiz
   Medical Applications
   Milkymist
   Network Servers
   Office/Productivity
   Robotics
   RPM Development Tools
   Security Lab
   Sound and Video
   System Tools
   Text-based Internet
   Window Managers





# yum-deprecated group list
Yum command has been deprecated, use dnf instead.
See 'man dnf' and 'man yum2dnf' for more information.

Loaded plugins: etckeeper, fastestmirror, langpacks, protectbase
Loading mirror speeds from cached hostfile
 * fedora: ftp.halifax.rwth-aachen.de
 * updates: ftp.halifax.rwth-aachen.de
0 packages excluded due to repository protections
Available environment groups:
   Minimal Install
   Fedora Server
   Fedora Workstation
   Fedora Cloud Server
   KDE Plasma Workspaces
   Xfce Desktop
   LXDE Desktop
   LXQt Desktop
   Cinnamon Desktop
   MATE Desktop
   Sugar Desktop Environment
   Development and Creative Workstation
   Web Server
   Infrastructure Server
   Basic Desktop
Installed groups:
   LibreOffice
Available Groups:
   3D Printing
   Administration Tools
   Audio Production
   Authoring and Publishing
   Books and Guides
   C Development Tools and Libraries
   Cloud Infrastructure
   Cloud Management Tools
   Container Management
   D Development Tools and Libraries
   Design Suite
   Development Tools
   Domain Membership
   Editors
   Educational Software
   Electronic Lab
   Engineering and Scientific
   Fedora Eclipse
   FreeIPA Server
   Games and Entertainment
   Headless Management
   MATE Applications
   MATE Compiz
   Medical Applications
   Milkymist
   Network Servers
   Office/Productivity
   RPM Development Tools
   Robotics
   Security Lab
   Sound and Video
   System Tools
   Text-based Internet
   Window Managers
Done
Comment 10 Ken Wills 2015-06-04 15:47:39 EDT
After adding some additional logging to /usr/lib/python2.7/site-packages/dnf/comps.py I can confirm the issue was occuring on my Development Tools group.

I know this isn't right, but changing to this allows the migration to complete:

******** WARNING DON'T USE THIS ***********

+++ /usr/lib/python2.7/site-packages/dnf/comps.py	2015-06-04 14:42:42.829784103 -0500
@@ -84,7 +84,7 @@
     for grp in grp_or_env:
         try:
             count += install_fnc(grp, types, None)
-        except dnf.comps.CompsError as e:
+        except Exception as e:
             logger.warning("%s, %s", str(e)[:-1], _("skipping."))
             grp_or_env.remove(grp)
     return count

I assume catching TypeError here would be inappropriate?
Comment 11 Honza Silhan 2015-06-05 12:50:19 EDT
Thanks to all for the help.
PR: https://github.com/rpm-software-management/dnf/pull/288
Comment 12 Neil 2015-06-07 18:36:33 EDT
Another user experienced a similar problem:

dnf-2 migrate

reporter:       libreport-2.5.1
cmdline:        /usr/bin/python -OO /bin/dnf-2 migrate
dso_list:       python-dnf-plugins-extras-migrate-0.0.8-1.fc22.noarch
event_log:      2015-06-07-17:36:07> ('report_uReport' completado con éxito)
executable:     /bin/dnf-2
kernel:         4.0.4-303.fc22.x86_64
package:        python-dnf-1.0.0-1.fc22
reason:         comps.py:86:install_or_skip:TypeError: unsupported operand type(s) for +=: 'int' and 'TransactionBunch'
runlevel:       N 3
type:           Python
uid:            0
Comment 13 Neil 2015-06-07 18:49:23 EDT
[root@infinity duff]# dnf group mark install Cinnamon
Last metadata expiration check performed 0:16:53 ago on Sun Jun  7 17:28:45 2015.
Traceback (most recent call last):
  File "/bin/dnf", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 185, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 134, in _main
    cli.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1077, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/commands/group.py", line 379, in run
    return self._mark_install(extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/commands/group.py", line 240, in _mark_install
    dnf.comps.install_or_skip(solver.group_install, res.groups, types)
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 86, in install_or_skip
    count += install_fnc(grp, types, None)
TypeError: unsupported operand type(s) for +=: 'int' and 'TransactionBunch'
Comment 14 Benjamin 2015-06-08 00:18:50 EDT
after applying the pull request from #11 manually, both #12 (dnf-2 migrate) and #13 (group mark install) are working fine.
Comment 15 Fedora Update System 2015-06-12 05:05:34 EDT
dnf-1.0.1-2.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/dnf-1.0.1-2.fc22
Comment 16 Fedora Update System 2015-06-14 13:33:31 EDT
Package dnf-1.0.1-2.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-1.0.1-2.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-10004/dnf-1.0.1-2.fc22
then log in and leave karma (feedback).
Comment 17 Honza Silhan 2015-06-16 05:11:06 EDT
*** Bug 1225285 has been marked as a duplicate of this bug. ***
Comment 18 Fedora Update System 2015-06-20 20:16:14 EDT
dnf-1.0.1-2.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 19 Honza Silhan 2015-07-24 09:02:59 EDT
*** Bug 1231477 has been marked as a duplicate of this bug. ***

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