Bug 847502

Summary: yumex - yum_childtask.py - error
Product: [Fedora] Fedora Reporter: Flóki Pálsson <flokip>
Component: yum-langpacksAssignee: Jens Petersen <petersen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: i18n-bugs, james.antill, notting, petersen, tim.lauridsen, usdanskys
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-14 09:22:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Plugins types using registerCommand none

Description Flóki Pálsson 2012-08-12 11:17:37 UTC
Description of problem:
Error in yumex.  

Version-Release number of selected component (if applicable):
yumex-3.0.6-1.fc17.noarch


How reproducible:
always

Steps to Reproduce:
1.  start yumex
2.
3.
  
Actual results:

10:43:25 : network interface em1 (r8169) is connected
10:43:25 : Connected to an network
10:43:25 : network interface em1 (r8169) is connected
10:43:25 : Starting yum child process
10:43:31 : YUM: Yum Version : 3.4.3
10:43:31 : YUM: Loaded plugins: langpacks, presto
10:43:31 : YUM: Traceback (most recent call last):
10:43:31 : YUM:   File "/usr/share/yumex/yum_childtask.py", line 66, in <module>
10:43:31 : YUM:     my = YumServer(debuglevel, plugins, offline, repos, yum_conf)
10:43:31 : YUM:   File "/usr/lib/python2.7/site-packages/yumexbackend/yum_server.py", line 188, in __init__
10:43:31 : YUM:     self.doLock()
10:43:31 : YUM:   File "/usr/lib/python2.7/site-packages/yumexbackend/yum_server.py", line 261, in doLock
10:43:31 : YUM:     yum.YumBase.doLock(self)
10:43:31 : YUM:   File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1963, in doLock
10:43:31 : YUM:     if self.conf.uid != 0:
10:43:31 : YUM:   File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1017, in <lambda>
10:43:31 : YUM:     conf = property(fget=lambda self: self._getConfig(),
10:43:31 : YUM:   File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 372, in _getConfig
10:43:31 : YUM:     startupconf.pluginconfpath,disabled_plugins,enabled_plugins)
10:43:31 : YUM:   File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 619, in doPluginSetup
10:43:31 : YUM:     plugin_types, confpath, disabled_plugins, enabled_plugins)
10:43:31 : YUM:   File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 165, in __init__
10:43:31 : YUM:     self.run('config')
10:43:31 : YUM:   File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 187, in run
10:43:31 : YUM:     func(conduitcls(self, self.base, conf, **kwargs))
10:43:31 : YUM:   File "/usr/lib/yum-plugins/langpacks.py", line 133, in config_hook
10:43:31 : YUM:     conduit.registerCommand(LanginstallCommand())
10:43:31 : YUM:   File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 553, in registerCommand
10:43:31 : YUM:     raise Errors.ConfigError(_('registration of commands not supported'))
10:43:31 : YUM: yum.Errors.ConfigError: registration of commands not supported


Expected results:
no error

Additional info:

Comment 1 Tim Lauridsen 2012-08-12 14:54:38 UTC
Does yum command lines work ?

It looks like a problem in yum-langpacks.

what version of yum-langpacks is installed ?

Try running 'yumex --noplugins'

Comment 2 Tim Lauridsen 2012-08-12 16:27:03 UTC
Ok, this is caused by yum-langpacks-0.3.0-1 from updates-testing

a TYPE_CORE plugin should not use registerCommand to register extra command line commands, only TYPE_INTERACTIVE should do that. 

At least it should catch these kind of exception and not blowup.

Comment 3 Flóki Pálsson 2012-08-12 20:42:57 UTC
Coment #1
>Does yum command lines work ?
yes 

>what version of yum-langpacks is installed ?
yum-langpacks-0.3.0-1.fc17.noarch

>Try running 'yumex --noplugins'
Yes. It works.

Comment 4 Tim Lauridsen 2012-08-13 04:35:51 UTC
registerCommand is a member of cli.YumBaseCli (the yum cli main class), but don't exist in yum.YumBase (the yum api main class), so the plugin will blow up if any api users there has enabled plugins.

solutions:

1. change plugin type to TYPE_INTERACTIVE (most api users only uses TYPE_CORE plugins)

2. check if registerCommand exists ( if hasattr(self._base,'registerCommand'): )

3. catch the exception raises by the plugin conduit.

Comment 5 Bill Nottingham 2012-08-13 18:25:10 UTC
*** Bug 847555 has been marked as a duplicate of this bug. ***

Comment 6 Bill Nottingham 2012-08-13 19:50:04 UTC
1. Done.
2/3. - changed to check for registerCommand. Only one plugin in yum-utils does this from a brief check.

Comment 7 Fedora Update System 2012-08-13 20:14:48 UTC
yum-langpacks-0.3.0-2.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/yum-langpacks-0.3.0-2.fc17

Comment 8 Tim Lauridsen 2012-08-14 05:44:29 UTC
Created attachment 604144 [details]
Plugins types using registerCommand

Comment 9 Tim Lauridsen 2012-08-14 05:47:32 UTC
The updated fixes the issue.

Checked plugins in yum-utils, all plugin there uses registerCommand is TYPE_INTERACTIVE except versionlock and it has the check for registerCommand is available, so all is safe there.

(See attachment)

Thanks !!

Comment 10 Fedora Update System 2012-08-14 09:22:42 UTC
yum-langpacks-0.3.0-2.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Bill Nottingham 2012-08-14 14:57:47 UTC
Thanks for the note - given that, I think TYPE_CORE w/checks is more appropriate for yum-langpacks than TYPE_INTERACTIVE.

Comment 12 Tim Lauridsen 2012-08-15 04:48:06 UTC
(In reply to comment #11)
> Thanks for the note - given that, I think TYPE_CORE w/checks is more
> appropriate for yum-langpacks than TYPE_INTERACTIVE.

I agree to that too, yum-langpacks does some actions typical for a TYPE_CORE plugin with some addon commands there is more typical TYPE_INTERACTIVE