Bug 1526782

Summary: Querying for users throws Exception: java.lang.ClassCastException: java.util.Collections$EmptyMap cannot be cast to java.u til.HashMap
Product: [oVirt] ovirt-engine Reporter: Elad <ebenahar>
Component: BLL.InfraAssignee: Ondra Machacek <omachace>
Status: CLOSED CURRENTRELEASE QA Contact: Gonza <grafuls>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.2.0CC: bugs, lsvaty, mperina
Target Milestone: ovirt-4.2.1Flags: rule-engine: ovirt-4.2+
lsvaty: testing_ack+
Target Release: 4.2.1   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-12 11:48:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
logs none

Description Elad 2017-12-17 12:37:22 UTC
Created attachment 1369007 [details]
logs

Description of problem:
I tried to query for a user for a VM permissions, the operation failed with the following exception:

2017-12-17 14:15:36,179+02 ERROR [org.ovirt.engine.core.bll.SearchQuery] (default task-6) [] Exception: java.lang.ClassCastException: java.util.Collections$EmptyMap cannot be cast to java.u
til.HashMap
        at org.ovirt.engine.core.bll.SearchQuery.initQueryData(SearchQuery.java:506) [bll.jar:]
        at org.ovirt.engine.core.bll.SearchQuery.searchDirectoryUsers(SearchQuery.java:269) [bll.jar:]
        at org.ovirt.engine.core.bll.SearchQuery.executeQueryCommand(SearchQuery.java:177) [bll.jar:]
        at org.ovirt.engine.core.bll.QueriesCommandBase.executeCommand(QueriesCommandBase.java:106) [bll.jar:]
        at org.ovirt.engine.core.dal.VdcCommandBase.execute(VdcCommandBase.java:33) [dal.jar:]
        at org.ovirt.engine.core.bll.executor.DefaultBackendQueryExecutor.execute(DefaultBackendQueryExecutor.java:14) [bll.jar:]
        at org.ovirt.engine.core.bll.Backend.runQueryImpl(Backend.java:579) [bll.jar:]


Version-Release number of selected component (if applicable):
rhvm-4.2.0.2-0.1.el7.noarch

How reproducible:
Not always

Steps to Reproduce:
Have an additional user, creation:
# ovirt-aaa-jdbc-tool user add elad
# ovirt-aaa-jdbc-tool user password-reset elad interactive

1. Webadmin: Search for the new user under VM's permission -> add  

Actual results:
Query for the new user failed with the mentioned exception

Expected results:
Query for users should succeed.

Additional info:


engine=# select * from users;
               user_id                | name  | surname |     domain     | username | department | email | note | last_admin_check_status |             external_id              |         _c
reate_date          |         _update_date          | namespace 
--------------------------------------+-------+---------+----------------+----------+------------+-------+------+-------------------------+--------------------------------------+-----------
--------------------+-------------------------------+-----------
 5a1ac77e-0256-01ce-01ce-000000000310 | admin |         | internal-authz | admin    |            |       |      | t                       | 1f7b991d-7630-45d7-90fc-1b83eb8d8f2a | 2017-11-26
 15:53:41.669393+02 | 2017-11-27 11:49:00.372089+02 | *
 4581cabb-ac36-4fc7-bb56-ccd0235ac4e9 |       |         | internal-authz | elad     |            |       |      | f                       | 913e0cb4-05ca-4608-a01c-b653cd6721a6 | 2017-12-03
 17:22:31.459956+02 |                               | *
(2 rows)

Comment 1 Gonza 2018-01-29 15:31:50 UTC
Verified with:
ovirt-engine-4.2.0.2-0.1.el7.noarch
ovirt-engine-extension-aaa-jdbc-1.1.6-1.el7ev.noarch

Comment 2 Sandro Bonazzola 2018-02-12 11:48:05 UTC
This bugzilla is included in oVirt 4.2.1 release, published on Feb 12th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.1 release, it has been closed with a resolution of CURRENT RELEASE.

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