RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1730244 - Yum commands fails with "IndexError: tuple index out of range"
Summary: Yum commands fails with "IndexError: tuple index out of range"
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum
Version: 7.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 7.8
Assignee: Packaging Maintenance Team
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-16 09:37 UTC by Christophe Besson
Modified: 2019-10-31 13:40 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-18 13:16:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 4284051 0 Troubleshoot None Yum commands fails with "IndexError: tuple index out of range" 2019-07-16 14:16:00 UTC

Description Christophe Besson 2019-07-16 09:37:30 UTC
Description of problem:

There is a MalformedURIError which isn't caught explicitly by the yum-cli.py python code, in the function getOptionsConfig(). Instead, it is caught by the yum.errors.ConfigError exception, which fails to print an error message with this input value.


Version-Release number of selected component (if applicable):
yum-3.4.3-161.el7.noarch

How reproducible:


Steps to Reproduce:
1. Modify the directive serverURL from /etc/sysconfig/rhn/up2date with a malformed URL. For example, a missing semi-colon (:) or an empty value leads to this error.
2. Execute any yum command.

Actual results:
# yum update
Loaded plugins: enabled_repos_upload, fastestmirror, package_upload, product-id, rhnplugin, search-disabled-repos, subscription-manager
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 375, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 170, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 283, in getOptionsConfig
    e = '%s: %s' % (to_unicode(e.args[1]), repr(e.filename))
IndexError: tuple index out of range
Uploading Enabled Repositories Report
Loaded plugins: fastestmirror, product-id, rhnplugin, subscription-manager
Unable to upload Enabled Repositories Report

Expected results:

Currently, it is difficult to identify the issue, since printing the error message caught itself an exception. We can expect an output looking like:

# yum update
Loaded plugins: changelog, fs-snapshot, priorities, refresh-packagekit, rhnplugin, rpm-warm-cache, verify
Config error: missing protocol in uri


Additional info:
The following patch works for me:

--- /usr/share/yum-cli/cli.py	2018-08-15 12:10:25.000000000 -0400
+++ /usr/share/yum-cli/cli.py.new	2019-07-16 05:21:57.087669646 -0400
@@ -47,6 +47,7 @@
 import yumcommands
 
 from yum.i18n import to_unicode, to_utf8, exception2msg
+from rhn.rpclib import MalformedURIError
 
 #  This is for yum-utils/yumdownloader in RHEL-5, where it isn't importing this
 # directly but did do "from cli import *", and we did have this in 3.2.22. I
@@ -279,6 +280,9 @@
         except yum.Errors.ConfigError, e:
             self.logger.critical(_('Config error: %s'), e)
             sys.exit(1)
+        except MalformedURIError, e:
+            self.logger.critical(_('Config error: %s'), e)
+            sys.exit(1)
         except IOError, e:
             e = '%s: %s' % (to_unicode(e.args[1]), repr(e.filename))
             self.logger.critical(_('Config error: %s'), e)


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