Bug 816598 - "Failed to load resource composite data" message is incorrectly logged when already logged out user tries to browse resources
"Failed to load resource composite data" message is incorrectly logged when a...
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: UI (Show other bugs)
JON 3.0.1
Unspecified Unspecified
low Severity low
: DR03
: JON 3.2.1
Assigned To: Jirka Kremser
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-26 09:27 EDT by bkramer
Modified: 2014-05-08 13:43 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-05-08 13:43:25 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
resource_navigation_loggedout (107.88 KB, image/png)
2013-11-15 10:53 EST, Armine Hovsepyan
no flags Details
image shows same behavior as the original issue. (54.52 KB, image/png)
2014-02-18 13:31 EST, Mike Foley
no flags Details

  None (edit)
Description bkramer 2012-04-26 09:27:21 EDT
Description of problem:

1. The user login to the JON UI and start to browse;
2. Right click on "Inventory" link at the top of the UI and open a new tab;
3. Logout from the new tab;
4. Go back to the first tab and attempt to select any child resource. The following message will be displayed near the top of the screen:

"Resource with id [xyz] does not exist or is not accessible".

5. Click on "Platforms" and you the following message will be logged:

"Failed to load resource composite data"


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

How reproducible:
Always

Steps to Reproduce:
1. 
2.
3.
  
Actual results:

The messages that are logged do not reflect the true state that the user has been logged out. 


Expected results:
We should log correct message so that user knows that he needs to login again.

Additional info:
Comment 1 bkramer 2012-04-26 09:38:33 EDT
These are logged in the Message Center:

Message :	
Failed to load data for this node
Severity :	
Error
	
Time :	
Thursday, April 26, 2012 1:45:57 PM Etc/GMT-1
Detail :	

com.google.gwt.user.client.rpc.InvocationException:
--- STACK TRACE FOLLOWS ---

   at Unknown.java_lang_Throwable_fillInStackTrace__Ljava_lang_Throwable_2(Unknown source:0)
   at Unknown.com_google_gwt_user_client_rpc_InvocationException_$InvocationException__Lcom_google_gwt_user_client_rpc_InvocationException_2Ljava_lang_String_2Lcom_google_gwt_user_client_rpc_InvocationException_2(Unknown source:0)
   at Unknown.com_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_$onResponseReceived__Lcom_google_gwt_user_client_rpc_impl_RequestCallbackAdapter_2Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown source:0)
   at Unknown.org_rhq_enterprise_gui_coregui_client_util_rpc_TrackingRequestCallback_onResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_Response_2V(Unknown source:0)
   at Unknown.com_google_gwt_http_client_Request_$fireOnResponseReceived__Lcom_google_gwt_http_client_Request_2Lcom_google_gwt_http_client_RequestCallback_2V(Unknown source:0)
   at Unknown.com_google_gwt_http_client_RequestBuilder$1_onReadyStateChange__Lcom_google_gwt_xhr_client_XMLHttpRequest_2V(Unknown source:0)
   at Unknown.anonymous(Unknown source:0)
   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:0)
   at Unknown.anonymous(Unknown source:0)
   at Unknown.anonymous(Unknown source:0)


****************************************************************************

Message :	
Resource with id [10181] does not exist or is not accessible
Severity :	
Warning
	
Time :	
Thursday, April 26, 2012 1:47:21 PM Etc/GMT-1
Detail :
Comment 2 Mike Foley 2012-04-30 11:45:22 EDT
setting priority based on bz triage ccrouch, loleary, mfoley
Comment 3 Charles Crouch 2012-08-02 22:20:49 EDT
Mike, is there anything we can do here that could fit into jon311?
Comment 4 Mike Thompson 2012-08-06 18:38:26 EDT
Ideally we would use client side interceptor capability like what Errai has. This would be the least coupled solution. But that is a long term solution. 


A Servlet filter could serve as an interceptor but it is more at the http request/response level and doesn't have access to all the RHQ application goodies. For things that are not dependent on the application code this is a good choice. It could do a lightweight ping of the servlet session as a heartbeat check, before returning the response to GWT.

A wrapper around the AsynchCallback interface would also work. Having this AbstractAsyncCallack we could wrap (or 'intercept') the callback onFailure, onSuccess methods for an invocationException or ping the servlet session for a heartbeat response. If the heartbeat is bad then a nice dialog message could be displayed or auto redirect to the login page. The only problem with this method is many global search and replaces, but it would be a one-to-one replacement.

Either solution is probably 1-2 day task.
Comment 5 Mike Thompson 2012-08-10 11:40:59 EDT
The other solution is that doesn't change as many files is the TrackingRequestCallback/TrackingRemoteSeviceProxy solution. This solution has less impact but is riskier as it requires some changes in LoginView as well. This solution impacts login state from what is essentially, an interceptor solution which has a smell to it.
Comment 6 Mike Thompson 2012-08-10 11:42:50 EDT
After further discussion we think this should NOT be part of jon311 as there exists risk to login which are not appropriate for inclusion of jon311.
Comment 7 Charles Crouch 2012-08-29 12:15:16 EDT
As per 8/20 triage pushing to JON312
Comment 8 mark yarborough 2012-11-06 15:05:03 EST
Per 3.1.2 triage with loleary, mfoley, ccrouch, asantos: Okay to move to JON 3.2.
Comment 10 Armine Hovsepyan 2013-11-15 10:53:54 EST
Created attachment 824579 [details]
resource_navigation_loggedout
Comment 11 Armine Hovsepyan 2013-11-15 10:54:35 EST
re-assigning 
issue still visible in jon3.2 er5
Comment 13 Jirka Kremser 2014-01-31 06:32:26 EST
I've already fixed this issue when working on bug 970181 (it is not a duplicate, but it is closely related). As for auto-refreshable  views like ResourceTitleBar, it has been fixed by commit 25706c31e6.

Tested in current master.. when performing the repro steps, the login dialog is correctly displayed.
Comment 14 Simeon Pinder 2014-02-18 10:08:03 EST
Moving to ON_QA as available for testing in the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=336752

Note: the installed version is still JON 3.2.0.GA by design and this represents part of the payload for JON 3.2.1 also known as cumulative patch 1 for 3.2.0.GA.  How this will be delivered to customers is still being discussed.
Comment 15 Mike Foley 2014-02-18 13:29:39 EST
I am documenting what I see in JON 3.2.1 DR1

1) in the "new" browser tab ... after logging out ... i see the login dialog displayed.  i this is confirming the fix documented in comment #13.

2) in the "original" browser tab ... i see an error message.  i am uploading an image of what i see.  this is exactly the same as the original error, step #5 in the original repro steps.  

because i see the same behavior in the orignal issue, i need to reject this issue. setting status to assigned.
Comment 16 Mike Foley 2014-02-18 13:31:46 EST
Created attachment 864674 [details]
image shows same behavior as the original issue.

image shows same behavior as the original issue. because of this, i am unable to mark this BZ verified.
Comment 17 Jirka Kremser 2014-02-21 09:05:21 EST
branch:  master
link:    http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?id=4ec41696e
time:    2014-02-21 15:02:59 +0100
commit:  4ec41696e0b3271bfd3d78fa1f5a57e08d4f88c2
author:  Jirka Kremser - jkremser@redhat.com
message: [BZ 816598] - "Failed to load resource composite data" message is
         incorrectly logged when already logged out user tries to browse
         resources - Enforcing the login dialog if the user is logged
         out (instead of throwing an exception). When logged out from a
         different browser tab, it takes about 3 seconds to propagate
         this information to the other tabs, however this is really an
         edge case. NOTE: If the login dialog is displayed on multiple
         browser tabs and user logs in to each of them separately, it
         will create multiple independent sessions that doesn't affect
         each other. Now if user logs out from a tab, it doesn't do
         anything to another tabs. This bug is about "forking" the user
         session by opening a new tab from the original web UI.
Comment 18 Libor Zoubek 2014-02-25 04:37:44 EST
commit 71eb57a360127f4ab89733017b11c74603adcf69
Author: Jirka Kremser <jkremser@redhat.com>
Date:   Fri Feb 21 15:02:59 2014 +0100

    [BZ 816598] - "Failed to load resource composite data" message is incorrectly logged when already logged out user t

    (cherry picked from commit 4ec41696e0b3271bfd3d78fa1f5a57e08d4f88c2)
    Signed-off-by: Libor Zoubek <lzoubek@redhat.com>

    Conflicts:
        modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/util/rpc/TrackingRequestCallback.java
Comment 19 Simeon Pinder 2014-03-05 17:21:17 EST
Moving to ON_QA as available for testing in the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=340294

Note: the installed version is still JON 3.2.0.GA by design and this represents part of the payload for JON 3.2.1 also known as cumulative patch 1 for 3.2.0.GA.  How this will be delivered to customers is still being discussed.
Comment 20 Mike Foley 2014-03-06 12:17:51 EST
failed in JON 3.2.1 DR2
Comment 21 Jirka Kremser 2014-03-10 09:35:28 EDT
well, this is strange. It works in the master branch, but not in the release one. There must be something that was not cherry-picked.. I'll investigate it
Comment 22 Jirka Kremser 2014-03-10 10:54:46 EDT
As said in comment #13, this issue was partly fixed in bug 970181 and partly by commit 25706c31e6. However, neither of the two was cherry-picked to the release branch. I guess, it is also the reason of the conflict mentioned in comment #18. Libor, could you please do the cherry-picking also the two commits? Mea culpa, I forgot to tell you about it.

I've tried it and it solves the issue.

commits:
50aed986a19b2e1cbd7d13e179c0342857d22854
25706c31e65c006eb0b2c08ef5686bb70566964a
Comment 23 Libor Zoubek 2014-03-10 18:01:16 EDT
commit 5996de964363d5357a13db14c1d747a0f027fac9
Author: Jirka Kremser <jkremser@redhat.com>
Date:   Thu Oct 17 19:00:26 2013 +0200

    UI: Improvement to auto refreshable views: the refresh() method is not performed if the session has expired. If the

    (cherry picked from commit 25706c31e65c006eb0b2c08ef5686bb70566964a)
    Signed-off-by: Libor Zoubek <lzoubek@redhat.com>

commit e85bd2dcc7c39df353bd6460aa365d7f982e5735
Author: Jirka Kremser <jkremser@redhat.com>
Date:   Mon Dec 16 19:23:37 2013 +0100

    [BZ 970181] - RHQ doesn't work after restart with open GUI in web browser. - if the server restarts at the backgrou

    (cherry picked from commit 50aed986a19b2e1cbd7d13e179c0342857d22854)
    Signed-off-by: Libor Zoubek <lzoubek@redhat.com>
Comment 24 Simeon Pinder 2014-04-01 16:43:49 EDT
Moving to ON_QA as available for test in newest cumulative patch build from here:
http://jon01.mw.lab.eng.bos.redhat.com:8042/dist/release/jon/3.2.1.GA/4-01-2014/
I moved the earlier build to 3-18-2014.
Comment 25 Mike Foley 2014-04-02 14:55:13 EDT
Verified JON 3.2.1 CP1 (iteration #2)
Comment 26 Mike Foley 2014-05-08 13:43:25 EDT
JON 3.2.1 released week of 5/5/2014

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