Bug 830841

Summary: CLI retrieveBackingContent is failling for 10 minutes after resource was imported
Product: [Other] RHQ Project Reporter: Filip Brychta <fbrychta>
Component: CLIAssignee: Stefan Negrea <snegrea>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.4CC: hrupp, lzoubek, snegrea
Target Milestone: ---   
Target Release: RHQ 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 849779 (view as bug list) Environment:
Last Closed: 2013-08-31 10:14:26 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: 849779    

Description Filip Brychta 2012-06-11 13:55:14 UTC
Description of problem:
CLI retrieveBackingContent gives a nullPointerException for 10 minutes after resource was imported. Than it's working fine.

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

How reproducible:
Always

Steps to Reproduce:
1.have a clean JON installation with eap plugin, the eap5 is running in default profile
2.import eap5 to JON inventory
3.create a new child resource (web application) in eap5 (eap5 inventory>create child>web application)
4.find id of this web application
5.launch CLI client in interactive mode (/rhq-cli.sh -u rhqadmin -p rhqadmin)
6.execute following commands:
var webApp = ProxyFactory.getResource(10062);// put there correct resourceId
webApp.retrieveBackingContent("/tmp/webApp.war");

  
Actual results:
Wrapped java.lang.NullPointerException (<Unknown source>#1)
res.retrieveBackingContent("/tmp/neco.war") 
^

Found no errors in logs.

Expected results:
Content is saved to defined location.

Additional info:
NullPointerException is there approximately for next 10 minutes (probably until some periodical job is launched). 

Different approach to reproduce this error:
1- uninventory eap5
2- inventory eap5
3- follow previous scenario from step 4

Comment 1 Libor Zoubek 2012-07-18 09:20:34 UTC
I am having same issue with EAP6 and I am able to reproduce it either using UI:
1. import EAP6
2. create deployment child resource
3. wait till it gets discovered
4. check new resoruce's content tab

Both Deployed and History are empty. If I refresh after 2-3 minutes I get expected values. IMHO Once a new deployment resource is discovered and UP it's backing content should be available.

Comment 2 Charles Crouch 2012-08-02 23:05:40 UTC
We are unlikely to be able to speed the discovery process up as part of jon311 but we should hopefully be able to address the NPE

Comment 3 Stefan Negrea 2012-08-20 20:19:49 UTC
The error was due to the fact that content was not yet available in the content repository when #retrieveBackingContent() was called. Added a descriptive error message to inform the user about this. Also, the message asks the user to try again in a few minutes since the content for a resource is available only after the deployment and discovery process completes.

There is no way to speed the discovery or to make the content available for users before the deployment and discovery process completes.

Comment 5 Filip Brychta 2013-02-21 16:50:16 UTC
Verified on 
Version: 4.6.0-SNAPSHOT
Build Number: 2b908fa

Comment 6 Heiko W. Rupp 2013-08-31 10:14:26 UTC
Bulk close of old bugs in VERIFIED state.