Bug 503682 - message = pieces[2].strip(" '"): index out of range
Summary: message = pieces[2].strip(" '"): index out of range
Keywords:
Status: CLOSED DUPLICATE of bug 481053
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rhn-client-tools
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Pradeep Kilambi
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-02 07:16 UTC by Radek Bíba
Modified: 2009-06-02 14:20 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-06-02 14:20:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Radek Bíba 2009-06-02 07:16:07 UTC
Description of problem:
Suddenly all attempts to talk to an RHN satellite started failing with this traceback when rhn-profile-sync was run:

Traceback (most recent call last):
  File "/usr/sbin/rhn-profile-sync", line 54, in ?
    cli.run()
  File "/usr/share/rhn/up2date_client/rhncli.py", line 65, in run
    sys.exit(self.main() or 0)
  File "/usr/sbin/rhn-profile-sync", line 38, in main
    if not self._testRhnLogin():
  File "/usr/share/rhn/up2date_client/rhncli.py", line 114, in _testRhnLogin
    up2dateAuth.updateLoginInfo()
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 202, in updateLoginInfo
    login(forceUpdate=True)
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 184, in login
    li = server.up2date.login(systemId)
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 62, in __call__
    message = pieces[2].strip(" '")
exceptions.IndexError: list index out of range

Or a similar traceback when yum was used:

  File "/usr/bin/yum", line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 229, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 84, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 184, in getOptionsConfig
    enabled_plugins=self.optparser._splitArg(opts.enableplugins))
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 205, in _getConf
ig
    self.plugins.run('init')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 176, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/rhnplugin.py", line 126, in init_hook
    svrChannels = rhnChannel.getChannelDetails()
  File "/usr/share/rhn/up2date_client/rhnChannel.py", line 86, in getChannelDeta
ils
    sourceChannels = getChannels()
  File "/usr/share/rhn/up2date_client/rhnChannel.py", line 108, in getChannels
    up2dateChannels = s.up2date.listChannels(up2dateAuth.getSystemId())
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 62, in __call__
    message = pieces[2].strip(" '")
IndexError: list index out of range

Version-Release number of selected component (if applicable):
rhn-client-tools-0.4.19-17.el5

How reproducible:
Not sure, looks like it was a transient problem on the satellite since everything went back to normal eventually (after a few hours AFAICS).

Additional info:
However, this part of /usr/share/rhn/up2date_client/rhnserver.py is suspicious:

if len(pieces) >= 2:
    message = pieces[2].strip(" '")

What happens when len(pieces) equals two? Isn't pieces[2] out of range then? Could it be this was the case and the reason of the tracebacks?

Comment 1 Pradeep Kilambi 2009-06-02 14:20:27 UTC

*** This bug has been marked as a duplicate of bug 481053 ***


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