Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1596699

Summary: Traceback when you rhsm-debug system --destination=/home/tmp-dir --no-archive when the file doesnt exist
Product: Red Hat Enterprise Linux 7 Reporter: Shwetha Kallesh <skallesh>
Component: subscription-managerAssignee: Nikos Moumoulidis <nmoumoul>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: high    
Version: 7.6CC: csnyder, jsefler, khowell, nmoumoul, salmy
Target Milestone: rcKeywords: EasyFix, Regression, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 10:37:37 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:

Description Shwetha Kallesh 2018-06-29 13:28:26 UTC
Description of problem:
Traceback when you rhsm-debug system --destination=/home/tmp-dir --no-archive when the file doesnt exist

Version-Release number of selected component (if applicable):
[root@localhost ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.3.8-1
subscription management rules: 5.26
subscription-manager: 1.21.5-5.el7

How reproducible:


Steps to Reproduce:
[root@localhost ~]# rhsm-debug system --destination=/home/tmp-dir --no-archive
Traceback (most recent call last):
  File "/usr/bin/rhsm-debug", line 9, in <module>
    load_entry_point('subscription-manager==1.21.5', 'console_scripts', 'rhsm-debug')()
  File "/usr/lib64/python2.7/site-packages/subscription_manager/scripts/rhsm_debug.py", line 57, in main
    return RhsmDebugCLI().main()
  File "/usr/lib64/python2.7/site-packages/subscription_manager/cli.py", line 183, in main
    return cmd.main()
  File "/usr/lib64/python2.7/site-packages/subscription_manager/managercli.py", line 499, in main
    return_code = self._do_command()
  File "/usr/lib64/python2.7/site-packages/rhsm_debug/debug_commands.py", line 108, in _do_command
    self._validate_options()
  File "/usr/lib64/python2.7/site-packages/rhsm_debug/debug_commands.py", line 94, in _validate_options
    if not self._dirs_on_same_device(self.assemble_path, self.options.destination):
  File "/usr/lib64/python2.7/site-packages/rhsm_debug/debug_commands.py", line 104, in _dirs_on_same_device
    return os.stat(dir1).st_dev == os.stat(dir2).st_dev
OSError: [Errno 2] No such file or directory: '/home/tmp-dir'


Actual results:
traceback

Expected results:
no traceback , but display a message saying "File mentioned in --destination doesnot exist" or something similar

Additional info:

Comment 3 John Sefler 2018-08-21 17:29:37 UTC
For reference, here is the behavior of this test on a RHEL6 system...

[root@jsefler-rhel6 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.10 (Santiago)
[root@jsefler-rhel6 ~]# rpm -q subscription-manager
subscription-manager-1.20.10-7.el6.x86_64
[root@jsefler-rhel6 ~]# 
[root@jsefler-rhel6 ~]# rhsm-debug system --destination=/home/tmp-dir --no-archive
Error collecting rhsm-debug information: [Errno 2] No such file or directory: '/home/tmp-dir'
[root@jsefler-rhel6 ~]# 

Notice no Traceback.  Instead the file not found error is handled graciously.

Comment 5 Shwetha Kallesh 2018-09-05 08:54:26 UTC
[root@hp-dl380pgen8-02-vm-9 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 2.3.9-1
subscription management rules: 5.26
subscription-manager: 1.21.9-1.el7


[root@hp-dl380pgen8-02-vm-9 ~]# rhsm-debug system --destination=/home/tmp-dir --no-archive
The directory specified by '--destination' must already exist.

Comment 7 errata-xmlrpc 2018-10-30 10:37:37 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.

https://access.redhat.com/errata/RHBA-2018:3153