Bug 1218371

Summary: [scale] JavaScriptException "elem is null" in Firefox 37
Product: Red Hat Enterprise Virtualization Manager Reporter: Vojtech Szocs <vszocs>
Component: ovirt-engine-webadmin-portalAssignee: Greg Sheremeta <gshereme>
Status: CLOSED WONTFIX QA Contact: Eldad Marciano <emarcian>
Severity: high Docs Contact:
Priority: medium    
Version: 3.5.1CC: ecohen, emarcian, gklein, lsurette, mgoldboi, rbalakri, Rhev-m-bugs, yeylon, ylavi
Target Milestone: ---   
Target Release: 3.5.5   
Hardware: x86_64   
OS: Linux   
Whiteboard: ux
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-04 15:46:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1223194    

Description Vojtech Szocs 2015-05-04 18:05:35 UTC
Description of problem:

Runtime JavaScript error that occurs in Eldad's large scale env. when using Firefox 37. Doesn't occur in Chrome.

Seems like an application-level null pointer exception triggered from our GWT data table widget in response to some DOM event.


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

3.5.1 VT14.1


Steps to Reproduce:

"login to rhevm webadmin > after a while the error appears
(if not, click on hosts tab and wait for a while).
bear in mind it was reproduced over WAN."


Actual results:

Unresponsive script dialog appears:

"A script on this page may be busy, or it may have stopped
responding. You can stop the script now, open the script in the
debugger, or let the script continue."


Expected results:

Unresponsive script dialog does not appear.


Additional info - JS stack trace:

"Sun Apr 26 17:58:06 GMT+300 2015 com.google.gwt.logging.client.LogConfiguration
SEVERE: (TypeError) : elem is null
com.google.gwt.core.client.JavaScriptException: (TypeError) : elem is null
        at Unknown.com_google_gwt_dom_client_DOMImpl_$getNextSiblingElement__Lcom_google_gwt_dom_client_DOMImpl_2Lcom_google_gwt_dom_client_Element_2Lcom_google_gwt_dom_client_Element_2(Unknown Source)
        at Unknown.com_google_gwt_dom_client_Element_$getNextSiblingElement__Lcom_google_gwt_dom_client_Element_2Lcom_google_gwt_dom_client_Element_2(Unknown Source)
        at Unknown.com_google_gwt_cell_client_CompositeCell_isEditing__Lcom_google_gwt_cell_client_Cell$Context_2Lcom_google_gwt_dom_client_Element_2Ljava_lang_Object_2Z(Unknown Source)
        at Unknown.com_google_gwt_user_cellview_client_AbstractCellTable_$fireEventToCell__Lcom_google_gwt_user_cellview_client_AbstractCellTable_2Lcom_google_gwt_user_client_Event_2Ljava_lang_String_2Lcom_google_gwt_dom_client_Element_2Ljava_lang_Object_2Lcom_google_gwt_cell_client_Cell$Context_2Lcom_google_gwt_cell_client_HasCell_2V(Unknown Source)
        at Unknown.com_google_gwt_user_cellview_client_AbstractCellTable_$onBrowserEvent2__Lcom_google_gwt_user_cellview_client_AbstractCellTable_2Lcom_google_gwt_user_client_Event_2V(Unknown Source)
        at Unknown.org_ovirt_engine_ui_common_widget_table_AbstractActionTable$1_onBrowserEvent2__Lcom_google_gwt_user_client_Event_2V(Unknown Source)
        at Unknown.com_google_gwt_user_cellview_client_AbstractHasData_onBrowserEvent__Lcom_google_gwt_user_client_Event_2V(Unknown Source)
        at Unknown.com_google_gwt_user_client_DOM_dispatchEventImpl__Lcom_google_gwt_user_client_Event_2Lcom_google_gwt_user_client_Element_2Lcom_google_gwt_user_client_EventListener_2V(Unknown Source)
        at Unknown.com_google_gwt_user_client_DOM_dispatchEvent__Lcom_google_gwt_user_client_Event_2Lcom_google_gwt_user_client_Element_2Lcom_google_gwt_user_client_EventListener_2V(Unknown Source)
        at Unknown.com_google_gwt_user_client_impl_DOMImplStandard_$initEventSystem__Lcom_google_gwt_user_client_impl_DOMImplStandard_2V/com_google_gwt_user_client_impl_DOMImplStandard_dispatchEvent<(Unknown Source)
        at Unknown.com_google_gwt_core_client_impl_Impl_apply__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown Source)
        at Unknown.com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(Unknown Source)
        at Unknown.com_google_gwt_core_client_impl_Impl_entry__Lcom_google_gwt_core_client_JavaScriptObject_2Lcom_google_gwt_core_client_JavaScriptObject_2/<(Unknown Source)

Comment 1 Vojtech Szocs 2015-05-04 18:10:17 UTC
See bug 1207299 for reference and description of the original issue.

Comment 2 Einav Cohen 2015-05-04 18:39:10 UTC
Greg, please be in touch with Eldad [emarcian] for reproducing, assistance in testing, etc. 
Note that this seems to happen only in FF (not in Chrome), and maybe only in WAN, rather than on LAN (strange...).

Comment 3 Einav Cohen 2015-05-04 20:24:01 UTC
we may want to backport that into 3.5.z.

Comment 4 Einav Cohen 2015-05-04 20:38:37 UTC
note: this reproduces only for FF versions > 36. I strongly recommend trying to test on FF38, which is about to become the standard FF version provided within RHEL.

Comment 5 Greg Sheremeta 2015-05-06 19:19:00 UTC
I'm unable to reproduce on my own, but I don't think I need to since we have the stack trace.

I suspect the issue is this line of code in GWT's CompositeCell:

public boolean isEditing(Context context, Element parent, C value) {
**  Element curChild = getContainerElement(parent).getFirstChildElement(); **
    for (HasCell<C, ?> hasCell : hasCells) {
...

curChild is never checked for being null later in the method, but we're seeing it be null. (It's probably null in the rare circumstance of two concurrent grid refreshes -- certainly possible over a latent network.)

So I'd classify this as a GWT bug.

We can easily work around by overriding "isEditing" and safely handling nulls in there.

Comment 6 Einav Cohen 2015-05-06 19:42:51 UTC
after discussing with Greg: 

we need to fix this issue for 3.6 first. 

however, in 3.6 we have made significant changes: 

(a) upgraded GWT and GWT-related dependencies. 
(b) refactored a lot of code around table-cells for the PatternFly-tooltips changes. 

we don't even know whether this issue reproduces in 3.6. 

@Eldad - do you have a 3.6 environment (similar to your 3.5 environment) on which you can attempt to reproduce the problem?

Comment 7 Eldad Marciano 2015-07-12 07:47:55 UTC
we need to invest some time and effort for this, in progress

Comment 8 Greg Sheremeta 2015-07-28 12:16:47 UTC
Met with Eldad today. He is going to try to reproduce on master. He'll follow up in a day or two.

Comment 9 Greg Sheremeta 2015-08-04 15:37:59 UTC
Eldad reports the issue cannot be reproduced on master. This is good -- I think that means it was a bug in version of GWT in oVirt 3.5.x, and has since been fixed in the newer version of GWT we're using in oVirt 3.6.

Einav / PM can advise on pursuing a workaround for z-stream. (Such a small issue ... doesn't seem like z-stream material to me.)