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 1337407

Summary: "Invalid xml file" show in log when failed to connect rhevm as "Authentication failed"
Product: Red Hat Enterprise Linux 7 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED ERRATA QA Contact: Eko <hsun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: hsun, ovasik, sgao, shihliu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.17-2.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 05:09:00 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 Liushihui 2016-05-19 07:03:42 UTC
Description of problem:
When connect rhevm with invalid username/password, it will show "Invalid xml file" in rhsm log and it also show error info as the following:
2016-05-19 02:45:06,568 [virtwho.test-rhevm1 ERROR] RhevM-1(31012):MainThread @virt.py:run:374 - Virt backend 'test-rhevm1' fails with error: Invalid XML file returned from RHEV-M: mismatched tag: line 1, column 984

Version-Release number of selected component (if applicable):
Satellite-6.2.0-RHEL-7-20160518
virt-who-0.17-1.el7.noarch
subscription-manager-1.17.6-1.el7.x86_64
python-rhsm-1.17.2-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Register system to satellite6.2
2.Make virt-who run at rhevm mode with wrong password:
[root@hp-dl2x170g6-01 virt-who.d]# cat virt 
[test-rhevm1]
type=rhevm
server=https://10.73.3.203:443
username=admin@internal
#encrypted_password=43f282d679adb816f2bb1cf9c18949ec
password=redhat *******************************Wrong password
owner=ACME_Corporation
env=Library
3.Restart virt-who service and check virt-who's log.
[root@hp-dl2x170g6-01 ~]# service virt-who restart && tail -f /var/log/rhsm/rhsm.log 
RestlibException: undefined method `[]=' for nil:NilClass
2016-05-19 02:44:59,967 [virtwho.main DEBUG] MainProcess(30922):MainThread @executor.py:send_report:108 - Report from "env/cmdline" failed to sent
2016-05-19 02:44:59,967 [virtwho.main DEBUG] MainProcess(30922):MainThread @__main__.py:main:19 - virt-who terminated
2016-05-19 02:45:00,192 [virtwho.init DEBUG] MainProcess(31004):MainThread @executor.py:__init__:65 - Using config named 'test-rhevm1'
2016-05-19 02:45:00,193 [virtwho.init INFO] MainProcess(31004):MainThread @main.py:main:157 - Using configuration "test-rhevm1" ("rhevm" mode)
2016-05-19 02:45:00,193 [virtwho.init INFO] MainProcess(31004):MainThread @main.py:main:159 - Using reporter_id='hp-dl2x170g6-01.rhts.eng.bos.redhat.com-eac63fadeb474a6a8111240f12cc08e5'
2016-05-19 02:45:00,195 [virtwho.main DEBUG] MainProcess(31004):MainThread @executor.py:run:171 - Starting infinite loop with 60 seconds interval
2016-05-19 02:45:00,252 [virtwho.test-rhevm1 DEBUG] RhevM-1(31012):MainThread @virt.py:run:364 - Virt backend 'test-rhevm1' started

*****************************Invalid xml info**************************
2016-05-19 02:45:06,568 [virtwho.test-rhevm1 DEBUG] RhevM-1(31012):MainThread @rhevm.py:get_xml:96 - Invalid xml file: <html><head><title>JBWEB000065: HTTP Status 401 - </title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>JBWEB000065: HTTP Status 401 - </h1><HR size="1" noshade="noshade"><p><b>JBWEB000309: type</b> JBWEB000067: Status report</p><p><b>JBWEB000068: message</b> <u></u></p><p><b>JBWEB000069: description</b> <u>JBWEB000121: This request requires HTTP authentication.</u></p><HR size="1" noshade="noshade"></body></html>

*****************************error info**************************
2016-05-19 02:45:06,568 [virtwho.test-rhevm1 ERROR] RhevM-1(31012):MainThread @virt.py:run:374 - Virt backend 'test-rhevm1' fails with error: Invalid XML file returned from RHEV-M: mismatched tag: line 1, column 984
2016-05-19 02:45:06,568 [virtwho.test-rhevm1 INFO] RhevM-1(31012):MainThread @virt.py:run:390 - Waiting 60 seconds before retrying backend 'test-rhevm1'


Actual results:
It will show redundant invalid xml info in the log, the error info is also not clear for customer.

Expected results:
It shouldn't show these redundant invalid xml info in the log, it also should show "Authentication failed as invalid username/password" 

Additional info:

Comment 2 Radek Novacek 2016-05-31 08:53:37 UTC
Fixed in virt-who-0.17-2.el7.

Comment 4 Liushihui 2016-06-03 05:29:50 UTC
Verified it on virt-who-0.17-2.el7.noarch since virt-who will show some error info when failed to connect rhevm, it won't generate redundant invalid xml info in the log . Therefore, verify it.

Verified version:
subscription-manager-1.17.6-1.el7.x86_64
python-rhsm-1.17.2-1.el7.x86_64
python-rhsm-1.17.2-1.el7.x86_64

Verified process:
1.Register system to satellite6.2
2.Make virt-who monitor rhevm4.0, configure error password:
[root@hp-dl2x170g6-01 virt-who.d]# cat /etc/virt-who.d/virt 
[test-rhevm1]
type=rhevm
server=https://hp-z220-13.qe.lab.eng.nay.redhat.com:443/ovirt-engine/
username=admin@internal
password=redhat1 =================>It's wrong
owner=ACME_Corporation
env=Library
3.Restart virt-who service and check virt-who's log.
[root@ ~]# service virt-who restart && tail -f /var/log/rhsm/rhsm.log 
2016-06-02 23:18:48,953 [virtwho.test-rhevm1 ERROR] RhevM-1(22476):MainThread @virt.py:run:374 - Virt backend 'test-rhevm1' fails with error: Unable to connect to RHEV-M server: 401 Client Error: Unauthorized

Result:
Virt-who show error info to remind "Unauthorized".

Comment 6 errata-xmlrpc 2016-11-04 05:09:00 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-2016-2387.html