Bug 1378331 - Exception thrown immediately after logging in to user portal
Summary: Exception thrown immediately after logging in to user portal
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backend.Core
Version: 4.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.2.0
: 4.2.0
Assignee: bugs@ovirt.org
QA Contact: Lucie Leistnerova
URL:
Whiteboard:
Depends On: 1419520
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-22 07:22 UTC by nicolas
Modified: 2019-04-28 13:10 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-07-18 08:52:56 UTC
oVirt Team: Virt
Embargoed:
jniederm: needinfo-
rule-engine: ovirt-4.2+
rule-engine: planning_ack+
tjelinek: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)
Api request with filter=true (1.62 KB, application/x-gzip)
2016-09-22 15:06 UTC, nicolas
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 71735 0 master MERGED userportal: IconUtils.extractIconIds null resistant 2017-02-07 10:16:45 UTC
oVirt gerrit 71736 0 master MERGED userportal: Pools without VMs are hidden 2017-02-07 10:16:38 UTC
oVirt gerrit 71924 0 ovirt-engine-4.1 MERGED userportal: IconUtils.extractIconIds null resistant 2017-02-09 09:21:36 UTC
oVirt gerrit 71925 0 ovirt-engine-4.1 MERGED userportal: Pools without VMs are hidden 2017-02-09 09:21:32 UTC

Description nicolas 2016-09-22 07:22:10 UTC
Description of problem:

Immediately after a user log-in to the user portal, an exception is thrown:

SEVERE: Uncaught exceptioncom.google.gwt.core.client.JavaScriptException: (TypeError) 
 __gwt$exception: <skipped>: Cannot read property 'R' of undefined
	at Unknown.OUk(userportal-28.js@94)
	at Unknown.RUk(userportal-28.js@29)
	at Unknown.Hvm(userportal-28.js@514401)
	at Unknown.NPk(userportal-0.js@116)
	at Unknown.QPk(userportal-0.js@490)
	at Unknown.JSk(userportal-0.js@73)
	at Unknown.MSk(userportal-0.js@23898)
	at Unknown.dSk(userportal-0.js@146)
	at Unknown.gSk(userportal-0.js@23318)
	at Unknown.aYc(userportal-0.js@10707)
	at Unknown.HX(userportal-0.js@137)
	at Unknown.YX(userportal-0.js@29602)
	at Unknown.eval(userportal-0.js@65)
	at Unknown.Zt(userportal-0.js@29)
	at Unknown.bu(userportal-0.js@57)
	at Unknown.eval(userportal-0.js@54)
CSc @ userportal-0.js:5792WTc @ userportal-0.js:5492VTc @ userportal-0.js:4952kUc @ userportal-0.js:2666Sdi @ userportal-0.js:5209yli @ userportal-0.js:5803hu @ userportal-0.js:4628bu @ userportal-0.js:5297(anonymous function) @ userportal-0.js:5164
userportal-0.js:5792 Thu Sep 22 08:12:52 GMT+100 2016 remote
SEVERE: Uncaught exceptioncom.google.gwt.core.client.JavaScriptException: (TypeError) 
 __gwt$exception: <skipped>: Cannot read property 'R' of undefined
	at Unknown.OUk(userportal-28.js@94)
	at Unknown.RUk(userportal-28.js@29)
	at Unknown.Hvm(userportal-28.js@514401)
	at Unknown.NPk(userportal-0.js@116)
	at Unknown.QPk(userportal-0.js@490)
	at Unknown.JSk(userportal-0.js@73)
	at Unknown.MSk(userportal-0.js@23898)
	at Unknown.dSk(userportal-0.js@146)
	at Unknown.gSk(userportal-0.js@23318)
	at Unknown.aYc(userportal-0.js@10707)
	at Unknown.HX(userportal-0.js@137)
	at Unknown.YX(userportal-0.js@29602)
	at Unknown.eval(userportal-0.js@65)
	at Unknown.Zt(userportal-0.js@29)
	at Unknown.bu(userportal-0.js@57)
	at Unknown.eval(userportal-0.js@54)
CSc @ userportal-0.js:5792WTc @ userportal-0.js:5492VTc @ userportal-0.js:4952kUc @ userportal-0.js:2666Sdi @ userportal-0.js:5209yli @ userportal-0.js:5803hu @ userportal-0.js:4628bu @ userportal-0.js:5297(anonymous function) @ userportal-0.js:5164

Following the debug protocol, the culprit is inside the AD1ECDCCB07BD788E8B0C32BBE150B16 permutation. Checking the OUk entry:

OUk,org.ovirt.engine.ui.uicommonweb.IconUtils::extractIconIds(Ljava/util/Collection;ZZ)Ljava/util/List;,org.ovirt.engine.ui.uicommonweb.IconUtils,extractIconIds,org/ovirt/engine/ui/uicommonweb/IconUtils.java,43,28

Version-Release number of selected component (if applicable):

4.0.3

How reproducible:

Always. It doesn't happen to all users, though, just to a few, so it seems not to be a general issue.

Steps to Reproduce:
1. Log in to the user portal

Actual results:

Immediately an exception is thrown

Additional info:

No other errors thrown than the one provided in ui.log.

Comment 1 Martin Perina 2016-09-22 12:05:25 UTC
Could you please install ovirt-engine-webadmin-portal-debuginfo ovirt-engine-userportal-debuginfo and share de-obfuscated exception as described in:

http://www.ovirt.org/develop/developer-guide/engine/engine-debug-obfuscated-ui/

Comment 2 nicolas 2016-09-22 12:42:12 UTC
I'm not sure if I missed something, but the deobfuscated info should already be included in the original request. I'll quote it to make it more legible:

---

Following the debug protocol, the culprit is inside the AD1ECDCCB07BD788E8B0C32BBE150B16 permutation. Checking the OUk entry:

OUk,org.ovirt.engine.ui.uicommonweb.IconUtils::extractIconIds(Ljava/util/Collection;ZZ)Ljava/util/List;,org.ovirt.engine.ui.uicommonweb.IconUtils,extractIconIds,org/ovirt/engine/ui/uicommonweb/IconUtils.java,43,28

Comment 3 Martin Perina 2016-09-22 12:54:34 UTC
Sorry Nicolas, I missed that part and saw only obfuscated part :-(

Tomas, could you please take a look?

Comment 4 Tomas Jelinek 2016-09-22 14:35:53 UTC
Could you please check what does REST API returns for 
/ovirt-engine/api/vms
if you set Filter:true header and log in as the user for which it does not work?

Thank you!

Comment 5 nicolas 2016-09-22 15:06:30 UTC
Created attachment 1203793 [details]
Api request with filter=true

I'm providing the requested output as an attachment

Comment 6 Tomas Jelinek 2016-09-23 08:22:24 UTC
I have a suspicion that this can happen in case the user has access to a VM pool but he does not have access to any VMs in this pool (e.g. all the VMs from this pool are already taken).
@Nicolas, could you please verify this is the case?

@Jakub: Looking at the logs, the null was the VM itself. I think in AbstractUserPortalListModel the GetVmDataByPoolId can return null and than the IconUtils.prefetchIcons will receive a list containing nulls.

Comment 7 Tomas Jelinek 2016-09-23 08:34:06 UTC
@Nicolas: other question: what are all the roles the user has assigned? Especially in regards to the pools?

Comment 8 nicolas 2016-09-23 11:57:59 UTC
Indeed, the user has permissions over a pool that has no VMs (an empty pool). This is possibly because the machines in it had the "Delete protection" flag activated and after deleting the pool, the machines became stateless machines but the pool was not deleted.

Permissions for that user are:

VmCreator over the Data Center
DiskProfileUser over the Data Center
TemplateCreator over the Cluster
UserRole over the VM lubuntu-1404-desktop
UserRole over the DEMO VmPool (the empty one)

Comment 9 Tomas Jelinek 2016-09-26 07:50:29 UTC
@Nicolas: could you please confirm that once you remove the UserRole from the DEMO pool the user portal works as expected?

While trying to simulate this issue, it seems that the whole delete protected does not work as expected on the pools. The correct fix should be that we will make sure we will not run into this situation.

Comment 10 nicolas 2016-09-26 08:34:10 UTC
Confirmed the exception disappears after removing permission on that pool

Comment 11 Tomas Jelinek 2016-09-26 08:38:10 UTC
Great! Thank you for the fast responses!

Comment 12 Michal Skrivanek 2016-12-21 09:08:44 UTC
The bug was not addressed in time for 4.1. Postponing to 4.2

Comment 13 Tomas Jelinek 2017-02-06 13:22:32 UTC
Due to:
https://bugzilla.redhat.com/show_bug.cgi?id=1419520

one can hit this issue easily.

I think we need some simple null check to prevent this from happening.

Comment 14 Lucie Leistnerova 2017-02-15 09:01:44 UTC
When removing pool with Delete protecion the VMs stay and pool is removed.
But still userportal crashes when pool has no VMs.

tested in ovirt-engine-userportal-4.1.1-0.1.el7.noarch

2017-02-15 09:51:14,697+01 ERROR [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default task-9) [] Permutation name: 361B776686563AF8BBE59716B1B0655D
2017-02-15 09:51:14,697+01 ERROR [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default task-9) [] Uncaught exception: com.google.gwt.core.client.JavaScriptException: (TypeError)
 __gwt$exception: <skipped>: d is undefined
        at org.ovirt.engine.ui.uicommonweb.IconUtils.extractIconIds(IconUtils.java:43)
        at org.ovirt.engine.ui.uicommonweb.IconUtils.prefetchIcons(IconUtils.java:35)
        at org.ovirt.engine.ui.uicommonweb.models.userportal.AbstractUserPortalListModel$2.executed(AbstractUserPortalListModel.java:180)
        at org.ovirt.engine.ui.frontend.Frontend$3.$onSuccess(Frontend.java:328) [frontend.jar:]
        at org.ovirt.engine.ui.frontend.Frontend$3.onSuccess(Frontend.java:328) [frontend.jar:]
        at org.ovirt.engine.ui.frontend.communication.OperationProcessor$3.$onSuccess(OperationProcessor.java:176) [frontend.jar:]
        at org.ovirt.engine.ui.frontend.communication.OperationProcessor$3.onSuccess(OperationProcessor.java:176) [frontend.jar:]
        at org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider$5$1.$onSuccess(GWTRPCCommunicationProvider.java:269) [frontend.jar:]
        at org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider$5$1.onSuccess(GWTRPCCommunicationProvider.java:269) [frontend.jar:]
        at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:198) [gwt-servlet.jar:]
        at com.google.gwt.http.client.Request.$fireOnResponseReceived(Request.java:237) [gwt-servlet.jar:]
        at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:409) [gwt-servlet.jar:]
        at Unknown.SMd/c.onreadystatechange<(Unknown Source)
        at com.google.gwt.core.client.impl.Impl.apply(Impl.java:296) [gwt-servlet.jar:]
        at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:335) [gwt-servlet.jar:]
        at Unknown._t/<(Unknown Source)
        at Unknown.anonymous(Unknown Source)

Comment 15 Michal Skrivanek 2017-02-15 11:07:18 UTC
it's not going to be such interesting bug once the problem with empty pool is fixed, hence deferring

Comment 16 Tomas Jelinek 2017-07-18 08:52:56 UTC
This issue is fixed on the new ovirt-web-ui which is deprecating the old user portal.


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