Bug 847502 - yumex - yum_childtask.py - error
yumex - yum_childtask.py - error
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: yum-langpacks (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jens Petersen
Fedora Extras Quality Assurance
:
: 847555 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-12 07:17 EDT by Flóki Pálsson
Modified: 2012-08-15 00:48 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-14 05:22:42 EDT
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)
Plugins types using registerCommand (2.27 KB, text/plain)
2012-08-14 01:44 EDT, Tim Lauridsen
no flags Details

  None (edit)
Description Flóki Pálsson 2012-08-12 07:17:37 EDT
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 10:54:38 EDT
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 12:27:03 EDT
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 16:42:57 EDT
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 00:35:51 EDT
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 14:25:10 EDT
*** Bug 847555 has been marked as a duplicate of this bug. ***
Comment 6 Bill Nottingham 2012-08-13 15:50:04 EDT
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 16:14:48 EDT
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 01:44:29 EDT
Created attachment 604144 [details]
Plugins types using registerCommand
Comment 9 Tim Lauridsen 2012-08-14 01:47:32 EDT
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 05:22:42 EDT
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 10:57:47 EDT
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 00:48:06 EDT
(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

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