Bug 1324066

Summary: WebAdmin Portal Uncaught exception occurred when selecting another host
Product: [oVirt] ovirt-engine Reporter: Jurriën Bloemen <jbloemen>
Component: Frontend.WebAdminAssignee: Tomas Jelinek <tjelinek>
Status: CLOSED CURRENTRELEASE QA Contact: Lucie Leistnerova <lleistne>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.4.1CC: bugs, jbloemen, lsvaty, mgoldboi, oourfali, pstehlik, tjelinek
Target Milestone: ovirt-4.0.0-rcFlags: rule-engine: ovirt-4.0.0+
mgoldboi: planning_ack+
oourfali: devel_ack+
pstehlik: testing_ack+
Target Release: 4.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-12 14:05:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jurriën Bloemen 2016-04-05 12:53:08 UTC
Description of problem:
Webadmin portal show an error when putting systems into maintenance and making them active again.

Version-Release number of selected component (if applicable):
ovirt-engine-3.6.4.1-1.el7.centos.noarch
ovirt-engine-webadmin-portal-3.6.4.1-1.el7.centos.noarch
CentOS 7.
Browser is Chrome Version 48.0.2564.82 (64-bit) Running on Fedora 22

Steps to Reproduce:
- Click on hosts.
- Select a host
- Put it in to maintenance
- VMs get migrated from the host
- Select an other host and go back to the first host
- I get the following messages in the webbrowser screen:

Uncaught exception occurred. Please try reloading the page. Details:
Exception caught: (TypeError) __gwt$exception: <skipped>: Cannot read
property 'cZ' of null
Please have your administrator check the UI logs

Uncaught exception occurred. Please try reloading the page. Details:
(TypeError) __gwt$exception: <skipped>: Cannot read property 'cZ' of null
Please have your administrator check the UI logs

Actual results:
This is what the browser shows:

Uncaught exception occurred. Please try reloading the page. Details:
Exception caught: (TypeError) __gwt$exception: <skipped>: Cannot read
property 'cZ' of null
Please have your administrator check the UI logs

Uncaught exception occurred. Please try reloading the page. Details:
(TypeError) __gwt$exception: <skipped>: Cannot read property 'cZ' of null
Please have your administrator check the UI logs

Expected results:
No error messages in browser

Additional info:

UI.LOG:

2016-04-05 14:45:47,886 ERROR [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default task-73) [] Permutation name: 66E351AA64642526AAD6BC90105ABC9B
2016-04-05 14:45:47,886 ERROR [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default task-73) [] Uncaught exception: : com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) 
 __gwt$exception: <skipped>: Cannot read property 'cZ' of null
	at java.lang.Throwable.fillInStackTrace(Throwable.java:114) [rt.jar:1.7.0_79]
	at java.lang.RuntimeException.RuntimeException(RuntimeException.java:32) [rt.jar:1.7.0_79]
	at com.google.web.bindery.event.shared.UmbrellaException.UmbrellaException(UmbrellaException.java:70) [gwt-servlet.jar:]
	at com.google.gwt.event.shared.UmbrellaException.UmbrellaException(UmbrellaException.java:25) [gwt-servlet.jar:]
	at com.google.gwt.event.shared.HandlerManager.$fireEvent(HandlerManager.java:117) [gwt-servlet.jar:]
	at com.google.gwt.view.client.SelectionChangeEvent.fire(SelectionChangeEvent.java:67) [gwt-servlet.jar:]
	at org.ovirt.engine.ui.common.widget.table.OrderedMultiSelectionModel.$resolveChanges(OrderedMultiSelectionModel.java:117)
	at org.ovirt.engine.ui.common.widget.table.OrderedMultiSelectionModel.fireSelectionChangeEvent(OrderedMultiSelectionModel.java:110)
	at com.google.gwt.view.client.SelectionModel$AbstractSelectionModel$1.execute(SelectionModel.java:128) [gwt-servlet.jar:]
	at com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.java:164) [gwt-servlet.jar:]
	at com.google.gwt.core.client.impl.SchedulerImpl.$flushFinallyCommands(SchedulerImpl.java:270) [gwt-servlet.jar:]
	at com.google.gwt.core.client.impl.Impl.exit(Impl.java:378) [gwt-servlet.jar:]
	at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:335) [gwt-servlet.jar:]
	at Unknown.<anonymous>(https://twinp101.mgt.example.net/ovirt-engine/webadmin/66E351AA64642526AAD6BC90105ABC9B.cache.html@54)Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) 
 __gwt$exception: <skipped>: Cannot read property 'cZ' of null
	at org.ovirt.engine.core.common.VdcActionUtils.canExecute(VdcActionUtils.java:340) [common.jar:]
	at org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostGeneralInfoPresenter.$updateAlerts(SubTabHostGeneralInfoPresenter.java:125)
	at org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostGeneralInfoPresenter$1.$eventRaised(SubTabHostGeneralInfoPresenter.java:109)
	at org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostGeneralInfoPresenter$1.eventRaised(SubTabHostGeneralInfoPresenter.java:109)
	at org.ovirt.engine.ui.uicompat.Event.$raise(Event.java:114)
	at org.ovirt.engine.ui.uicommonweb.models.Model.$onPropertyChanged(Model.java:467)
	at org.ovirt.engine.ui.uicommonweb.models.hosts.HostGeneralModel.$setHasUpgradeAlert(HostGeneralModel.java:567)
	at org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.$updateAlerts(HostListModel.java:1703)
	at org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.$onSelectedItemChanged(HostListModel.java:1697)
	at org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.onSelectedItemChanged(HostListModel.java:1697)
	at org.ovirt.engine.ui.uicommonweb.models.ListModel.$setSelectedItem(ListModel.java:80)
	at org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.$setSelectedItem(SearchableListModel.java:409)
	at org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.setSelectedItem(SearchableListModel.java:409)
	at org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.$setSelectedItems(DataBoundTabModelProvider.java:85)
	at org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter$1.onSelectionChange(AbstractMainTabWithDetailsPresenter.java:53)
	at com.google.gwt.view.client.SelectionChangeEvent.dispatch(SelectionChangeEvent.java:98) [gwt-servlet.jar:]
	at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:76) [gwt-servlet.jar:]
	at com.google.web.bindery.event.shared.SimpleEventBus.$doFire(SimpleEventBus.java:173) [gwt-servlet.jar:]
	... 10 more

2016-04-05 14:45:48,061 ERROR [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default task-77) [] Permutation name: 66E351AA64642526AAD6BC90105ABC9B
2016-04-05 14:45:48,062 ERROR [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default task-77) [] Uncaught exception: : com.google.gwt.core.client.JavaScriptException: (TypeError) 
 __gwt$exception: <skipped>: Cannot read property 'cZ' of null
	at org.ovirt.engine.core.common.VdcActionUtils.canExecute(VdcActionUtils.java:340) [common.jar:]
	at org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostGeneralInfoPresenter.$updateAlerts(SubTabHostGeneralInfoPresenter.java:125)
	at org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostGeneralInfoPresenter$1.$eventRaised(SubTabHostGeneralInfoPresenter.java:109)
	at org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostGeneralInfoPresenter$1.eventRaised(SubTabHostGeneralInfoPresenter.java:109)
	at org.ovirt.engine.ui.uicompat.Event.$raise(Event.java:114)
	at org.ovirt.engine.ui.uicommonweb.models.Model.$onPropertyChanged(Model.java:467)
	at org.ovirt.engine.ui.uicommonweb.models.hosts.HostGeneralModel.$setHasAnyAlert(HostGeneralModel.java:554)
	at org.ovirt.engine.ui.uicommonweb.models.hosts.HostGeneralModel.$setHasAnyAlert(HostGeneralModel.java:926)
	at org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.$updateAlerts(HostListModel.java:1703)
	at org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.$onSelectedItemChanged(HostListModel.java:1697)
	at org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.onSelectedItemChanged(HostListModel.java:1697)
	at org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.$setItems(SearchableListModel.java:802)
	at org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.setItems(SearchableListModel.java:802)
	at org.ovirt.engine.ui.uicommonweb.models.SearchableListModel$5.onSuccess(SearchableListModel.java:886)
	at org.ovirt.engine.ui.frontend.Frontend$2.$onSuccess(Frontend.java:244) [frontend.jar:]
	at org.ovirt.engine.ui.frontend.Frontend$2.onSuccess(Frontend.java:244) [frontend.jar:]
	at org.ovirt.engine.ui.frontend.communication.OperationProcessor$2.$onSuccess(OperationProcessor.java:141) [frontend.jar:]
	at org.ovirt.engine.ui.frontend.communication.OperationProcessor$2.onSuccess(OperationProcessor.java:141) [frontend.jar:]
	at org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider$5$1.$onSuccess(GWTRPCCommunicationProvider.java:271) [frontend.jar:]
	at org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider$5$1.onSuccess(GWTRPCCommunicationProvider.java:271) [frontend.jar:]
	at com.google.gwt.rpc.client.impl.RpcCallbackAdapter.onResponseReceived(RpcCallbackAdapter.java:72) [gwt-servlet.jar:]
	at org.ovirt.engine.ui.common.gin.BaseSystemModule$1$1.onResponseReceived(BaseSystemModule.java:140)
	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.<anonymous>(https://twinp101.mgt.example.net/ovirt-engine/webadmin/66E351AA64642526AAD6BC90105ABC9B.cache.html@65)	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.<anonymous>(https://twinp101.mgt.example.net/ovirt-engine/webadmin/66E351AA64642526AAD6BC90105ABC9B.cache.html@54)

Comment 1 Sandro Bonazzola 2016-05-02 10:03:29 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 2 Greg Sheremeta 2016-05-14 20:14:46 UTC
I cannot duplicate it on master.

Moving to virt team. According to the log, the problem is an NPE in this code in VdcActionUtils:

    public static boolean canExecute(List<? extends BusinessEntityWithStatus<?, ?>> entities,
            Class type,
            VdcActionType action) {
        if (_matrix.containsKey(type)) {
            for (BusinessEntityWithStatus<?, ?> a : entities) {
                if (a.getClass() == type && _matrix.get(type).containsKey(a.getStatus())
                        && _matrix.get(type).get(a.getStatus()).contains(action)) {
                    return false;
                }
            }
        }
        return true;
    }

But I'm stumped on what part it could be. (Those map get()s are pretty unsafe -- they should be null-checked.) 

SubTabHostGeneralInfoPresenter.java:125 calls it and passes "VDS" and "UpgradeHost", which should not be found in the _matrix, this returning false. But somehow there's an NPE instead.

Need someone more familiar with this code to look at it. Let me know if I can be of further help.

Comment 3 Pavel Stehlik 2016-06-27 11:00:08 UTC
 Hi Jurriën,
would you be able to test again with ovirt-4.0.0-beta (and newer)? If the issue is solved there - feel free to change status to VERIFIED, if not - you can switch it back to ASSIGNED. 
 In case you don't have a resources for checking - feel free to set NEEDINFO for me with comment. Thank you P.

Comment 4 Lucie Leistnerova 2016-08-11 11:40:00 UTC
can't reproduce

verified in ovirt-engine-4.0.2.6-0.1.el7ev.noarch

Comment 5 Jurriën Bloemen 2016-08-23 07:49:10 UTC
Hi Pavel,

Sorry for the delay. For some reason notification mail got marked as spam.

Unfortunately I am unable to test it. The platform can not be changed at this moment because we are moving to RHEV.

I can not promise that I have time for this in the future but I will try my best.

Comment 6 Pavel Stehlik 2016-08-23 08:18:51 UTC
Hi Jurriën, 
no problem, Lucie c#4 tried without succ, so we can assume it's already fixed. If someone will hit this issue - (s)he can reopen.