Bug 1526782 - Querying for users throws Exception: java.lang.ClassCastException: java.util.Collections$EmptyMap cannot be cast to java.u til.HashMap
Summary: Querying for users throws Exception: java.lang.ClassCastException: java.util....
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Infra
Version: 4.2.0
Hardware: x86_64
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.2.1
: 4.2.1
Assignee: Ondra Machacek
QA Contact: Gonza
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-17 12:37 UTC by Elad
Modified: 2018-02-12 11:48 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-12 11:48:05 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.2+
lsvaty: testing_ack+


Attachments (Terms of Use)
logs (826.79 KB, application/x-gzip)
2017-12-17 12:37 UTC, Elad
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 85545 0 master MERGED backend: Fix ClassCastExcetion in SearchQuery 2017-12-18 12:06:13 UTC

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.


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