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 1221027 - virt-who crashes when ecryption key doesn't exist
Summary: virt-who crashes when ecryption key doesn't exist
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-who
Version: 6.7
Hardware: x86_64
OS: All
high
medium
Target Milestone: rc
: ---
Assignee: Radek Novacek
QA Contact: gaoshang
URL:
Whiteboard:
Depends On: 1175076
Blocks: 1208029
TreeView+ depends on / blocked
 
Reported: 2015-05-13 07:30 UTC by Liushihui
Modified: 2016-12-01 00:34 UTC (History)
6 users (show)

Fixed In Version: virt-who-0.12-8.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 1175076
Environment:
Last Closed: 2015-07-22 07:17:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1377 0 normal SHIPPED_LIVE virt-who bug fix and enhancement update 2015-07-20 17:58:35 UTC

Comment 2 Radek Novacek 2015-05-14 12:35:04 UTC
Fixed in virt-who-0.12-8.el6.

Comment 4 Liushihui 2015-05-20 06:26:51 UTC
It still exist on virt-who-0.12-8.el6. When encrypted and decrypted password doesn't exist or len(encrypted_password) is not equal to 32bit(eg: encrypted_password=111111), virt-who still can't start although the configure in /etc/sysconfig/virt-who is accessible. Therefore,reopen it.


Tracked version:
virt-who-0.12-8.el6.noarch
subscription-manager-1.14.6-1.el6.x86_64
python-rhsm-1.14.2-1.el6.x86_64

Retraced process:
Precondition:
The encrypted password doesn't exist.
1. Register rhel to Satellite server, then configure virt-who monitor two vcenters as the following:
[root@rhel67latest ~]# cat /etc/sysconfig/virt-who
VIRTWHO_BACKGROUND=1
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=2
VIRTWHO_ESX=1
VIRTWHO_ESX_OWNER=ACME_Corporation
VIRTWHO_ESX_ENV=Library
VIRTWHO_ESX_SERVER=10.66.79.68
VIRTWHO_ESX_USERNAME=Administrator
VIRTWHO_ESX_PASSWORD=qwer1234P!

[root@rhel67latest ~]]# cat /etc/virt-who.d/virt-who
[test-esx1]
type=esx
server=10.66.78.27
username=Administrator
encrypted_password=43f282d679adb816f2bb1cf9c18949ec
owner=ACME_Corporation
env=Library

2. Restart virt-who service
[root@rhel67latest ~]# service virt-who restart
Stopping virt-who:                                         [  OK  ]
Starting virt-who:                                         [FAILED]

3. Check the log, it will not generate error log as bug's description now,  there is an enhancement on this version, it will show a remind info "[Errno 2] No such file or directory: '/var/lib/virt-who/key'".

4. Check the virt-who service
[root@rhel67latest ~]# service virt-who status
virt-who is stopped
[root@rhel67latest ~]# ps -ef|grep virt-who
root      3326     1  0 00:41 ?        00:00:00 /usr/bin/python /usr/share/virt-who/virtwho.py
root      3491  2797  0 01:08 pts/1    00:00:00 grep virt-who

Result: Although virt-who has print an error, It still failed to start virt-who serice

Expected result: virt-who should only print an error but shouldn't crash

Comment 5 Radek Novacek 2015-05-26 08:42:44 UTC
I think that failing to start is proper behaviour in this case. Incorrect format of an encrypted password (or the key) should be a red flag for future virt-who operations. It might mean that the config file could be for example truncated or the key file might be corrupted.

It's true that there might be some backends that would work even with this kind of error, but I consider failing as proper result.

Comment 6 Radek Novacek 2015-06-04 13:57:32 UTC
Moving back to ON_QA, exiting virt-who when password or key is broken (wrong length) is correct behaviour.

Comment 7 Liushihui 2015-06-12 01:52:25 UTC
According to Comment 5, I agree with this solution. Therefore, verified it on virt-who-0.12-10.el6.noarch. 

Verified version:
virt-who-0.12-10.el6.noarch
subscription-manager-1.14.10-1.el6.x86_64
python-rhsm-1.14.3-1.el6.x86_64

Verified process:
1.When encrypted and decrypted password doesn't exist, failed to start virt-who service and it will show error log as the following:
[root@hp-z220-05 ~]# service virt-who restart
Stopping virt-who:                                         [FAILED]
Starting virt-who:                                         [FAILED]
2015-06-12 09:42:33,766 [DEBUG] subscription-manager:23092 @connection.py:521 - Response: status=200
2015-06-12 09:43:44,461 [ERROR]  @virtwho.py:541 - [Errno 2] No such file or directory: '/var/lib/virt-who/key'
2. When password or key is broken (wrong length), still failed to start virt-who service and it will show error log as the folllowing:
2015-06-12 09:44:36,194 [ERROR]  @virtwho.py:541 - Password can't be decrypted, possibly corrupted

Comment 8 errata-xmlrpc 2015-07-22 07:17:01 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://rhn.redhat.com/errata/RHBA-2015-1377.html


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