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 994344 - Display appropriate message when used unsupported files in rct cat-manifest/dump-manifest command
Summary: Display appropriate message when used unsupported files in rct cat-manifest/d...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Carter Kozak
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel65
TreeView+ depends on / blocked
 
Reported: 2013-08-07 05:42 UTC by Rehana
Modified: 2014-09-15 00:09 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No description necessary.
Clone Of:
Environment:
Last Closed: 2013-11-21 21:27:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1659 0 normal SHIPPED_LIVE subscription-manager and python-rhsm bug fix and enhancement update 2013-11-20 21:53:10 UTC

Description Rehana 2013-08-07 05:42:16 UTC
Description of problem:
Observed that cat-manifest works with .zip files (which is correct as desgied), when given other files like .pem in rct cat-manifest command , its throwing Traceback.Logging a bug to catch the Traceback and display a good error message.


Version-Release number of selected component (if applicable):
rpm -qa | grep subs
subscription-manager-gui-1.9.0-1.git.67.5fdacc1.el6.x86_64
subscription-manager-debuginfo-1.8.14-1.el6_4.x86_64
subscription-manager-migration-data-1.12.2.6-1.git.0.171d4c3.el6.noarch
subscription-manager-firstboot-1.9.0-1.git.67.5fdacc1.el6.x86_64
subscription-manager-migration-1.9.0-1.git.67.5fdacc1.el6.x86_64
subscription-manager-1.9.0-1.git.67.5fdacc1.el6.x86_64

How reproducible:
3/3

Steps to Reproduce:
1.Execute rct cat-manifest with any file(ex:rct cm 2514643273829928242.pem)
2.Execute rct dump-manifest with any file(ex:rct dm 5467644249924152940.pem)
3.

Actual results:
observed the below traceback error
 
root@rehanatestmachine entitlement]# rct dm 5467644249924152940.pem 
Traceback (most recent call last):
  File "/usr/bin/rct", line 44, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/bin/rct", line 39, in main
    return RctCLI().main()
  File "/usr/share/rhsm/subscription_manager/cli.py", line 166, in main
    return cmd.main()
  File "/usr/share/rhsm/rct/commands.py", line 39, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/rct/manifest_commands.py", line 312, in _do_command
    if self._extract(os.getcwd(), self.options.overwrite_files):
  File "/usr/share/rhsm/rct/manifest_commands.py", line 289, in _extract
    self._extract_manifest(destination, overwrite)
  File "/usr/share/rhsm/rct/manifest_commands.py", line 141, in _extract_manifest
    archive = ZipExtractAll(self._get_file_from_args(), 'r')
  File "/usr/lib64/python2.6/zipfile.py", line 696, in __init__
    self._GetContents()
  File "/usr/lib64/python2.6/zipfile.py", line 716, in _GetContents
    self._RealGetContents()
  File "/usr/lib64/python2.6/zipfile.py", line 728, in _RealGetContents
    raise BadZipfile, "File is not a zip file"
zipfile.BadZipfile: File is not a zip file


Expected results:
Though the traceback is saying what the problem is, we suggest that it will be good to catch this traceback and display a user friendly message in the console

Additional info:

Comment 2 Carter Kozak 2013-08-28 16:49:40 UTC
commit dad138479c1e34151f29a04d8c1e202c5d0d67ba
Author: ckozak <ckozak>
Date:   Mon Aug 26 13:18:43 2013 -0400

    994344: messaging for bad filetypes

Comment 4 John Sefler 2013-09-15 18:37:35 UTC
Verifying Version...
[root@jsefler-6 ~]# rpm -q subscription-manager
subscription-manager-1.9.6-1.el6.x86_64

[root@jsefler-6 ~]# rct cat-manifest /etc/pki/product/69.pem 
Manifest zip is invalid.
[root@jsefler-6 ~]# rct dump-manifest /etc/pki/product/69.pem 
Manifest zip is invalid.

VERIFIED: The former Traceback is now caught and "Manifest zip is invalid." is now printed to stdout.

Comment 5 errata-xmlrpc 2013-11-21 21:27:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1659.html


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