Bug 1391013

Summary: UX: exception when trying to sort by size (images listed from a Glance image repository)
Product: [oVirt] ovirt-engine Reporter: Yaniv Kaul <ykaul>
Component: Frontend.WebAdminAssignee: Vojtech Szocs <vszocs>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Novotny <pnovotny>
Severity: high Docs Contact:
Priority: high    
Version: 4.1.0CC: bugs, mgoldboi, oourfali, vszocs, ykaul
Target Milestone: ovirt-4.1.0-betaKeywords: Regression
Target Release: 4.1.0.2Flags: rule-engine: ovirt-4.1+
rule-engine: blocker+
mgoldboi: planning_ack+
oourfali: devel_ack+
pstehlik: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-15 15:08:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: UX RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Yaniv Kaul 2016-11-02 11:51:40 UTC
Description of problem:
When I'm trying to list the images I got from a Glance image repository by size, clicking on the 'Size' header, I get a UX exception:
2016-11-02 07:42:16,571 ERROR [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default task-3) [] Uncaught exception: com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) 
 __gwt$exception: <skipped>: b is null
	at java.lang.Throwable.fillInStackTrace(Throwable.java:114) [rt.jar:1.8.0_111]
	at java.lang.RuntimeException.RuntimeException(RuntimeException.java:32) [rt.jar:1.8.0_111]
	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.user.cellview.client.ColumnSortEvent.fire(ColumnSortEvent.java:157) [gwt-servlet.jar:]
	at com.google.gwt.user.cellview.client.AbstractCellTable.$onBrowserEvent2(AbstractCellTable.java:1773) [gwt-servlet.jar:]
	at com.google.gwt.user.cellview.client.AbstractCellTable.onBrowserEvent2(AbstractCellTable.java:1773) [gwt-servlet.jar:]
	at com.google.gwt.user.cellview.client.AbstractHasData.onBrowserEvent(AbstractHasData.java:698) [gwt-servlet.jar:]
	at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1648) [gwt-servlet.jar:]
	at com.google.gwt.user.client.impl.DOMImplStandard.dispatchEvent(DOMImplStandard.java:320) [gwt-servlet.jar:]
	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.Ux/<(Unknown Source)
	at Unknown.anonymous(Unknown Source)
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) 
 __gwt$exception: <skipped>: b is null
	at java.lang.Long.$compareTo(Long.java:291) [rt.jar:1.8.0_111]
	at org.ovirt.engine.ui.common.widget.table.column.AbstractSizeColumn$1.compare(AbstractSizeColumn.java:17)
	at org.ovirt.engine.ui.uicommonweb.models.SortedListModel$SortSensitiveComparator.compare(SortedListModel.java:24)
	at java.util.Arrays.insertionSort(Arrays.java:1190) [rt.jar:1.8.0_111]
	at java.util.Arrays.mergeSort(Arrays.java:1255) [rt.jar:1.8.0_111]
	at java.util.Arrays.mergeSort(Arrays.java:1255) [rt.jar:1.8.0_111]
	at java.util.Arrays.mergeSort(Arrays.java:1255) [rt.jar:1.8.0_111]
	at java.util.Arrays.mergeSort(Arrays.java:1255) [rt.jar:1.8.0_111]
	at java.util.Arrays.mergeSort(Arrays.java:1235) [rt.jar:1.8.0_111]
	at java.util.Collections.sort(Collections.java:954) [rt.jar:1.8.0_111]
	at org.ovirt.engine.ui.uicommonweb.models.SortedListModel.$sortItems(SortedListModel.java:76)
	at org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.$setComparator(SearchableListModel.java:666)
	at org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.setComparator(SearchableListModel.java:666)
	at org.ovirt.engine.ui.common.widget.table.ColumnResizeCellTable$2.$onColumnSort(ColumnResizeCellTable.java:632)
	at com.google.gwt.user.cellview.client.ColumnSortEvent.$dispatch(ColumnSortEvent.java:224) [gwt-servlet.jar:]
	at com.google.gwt.user.cellview.client.ColumnSortEvent.dispatch(ColumnSortEvent.java:224) [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:]


Version-Release number of selected component (if applicable):
ovirt-engine-webadmin-portal-4.1.0-0.0.master.20161101211323.git410903b.el7.centos.noarch

How reproducible:
100%

Steps to Reproduce:
1. Go to Glance image repository (under storage, the specific domain, then Images sub-tab) and list the available images (I've done it via ovirt-system-tests)
2. click on 'Actual Size' column header.

Comment 1 Red Hat Bugzilla Rules Engine 2016-11-02 11:52:40 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 2 Red Hat Bugzilla Rules Engine 2016-11-03 13:18:00 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 3 Vojtech Szocs 2016-12-15 20:59:58 UTC
Yaniv, does the table in Storage/Images sub tab contain a row with "Actual Size" == "[N/A]" ?

Comment 4 Yaniv Kaul 2016-12-20 13:21:04 UTC
(In reply to vszocs from comment #3)
> Yaniv, does the table in Storage/Images sub tab contain a row with "Actual
> Size" == "[N/A]" ?

Now it all works.

Comment 5 Yaniv Kaul 2017-01-09 07:45:38 UTC
Any news here? Shall I close this one? I see the patch is not in yet?

Comment 6 Vojtech Szocs 2017-01-10 18:18:14 UTC
(In reply to Yaniv Kaul from comment #5)
> Any news here? Shall I close this one? I see the patch is not in yet?

I wrote the patch after analyzing the reported JS stack trace.

I'm going to reproduce locally (by modifying data during GWT debug session to simulate the problematic cause) and verify. Please don't close this.

Comment 7 Vojtech Szocs 2017-01-10 18:20:14 UTC
(In reply to Yaniv Kaul from comment #4)
> Now it all works.

The actual cause is business entity (not) containing some data, and UI crashing on handling that. The fact it works now might be due to backend changes, but UI should still be fixed to handle the problematic case (not throw error).

Comment 8 Pavel Novotny 2017-02-01 16:59:25 UTC
Verified in 
ovirt-engine-webadmin-portal-4.1.0.3-0.1.el7.noarch
rhevm-4.1.0.3-0.1.el7.noarch

Sorting Glance images by size now works and does not throw any UI exception.

Verification steps:
(by following reproducer from comment 0)
1. Go to Glance image repository (under storage, the specific domain, then Images sub-tab) and list the available images (I've done it via ovirt-system-tests)
2. click on 'Actual Size' column header.

Result: Images are properly sorted by size, no UI exception is thrown.