Bug 736792
| Summary: | CLI retrieveBackingContent gives a file not found exception on the agent | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Other] RHQ Project | Reporter: | dsteigne | ||||||
| Component: | CLI | Assignee: | RHQ Project Maintainer <rhq-maint> | ||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> | ||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | high | ||||||||
| Version: | 4.2 | CC: | hrupp, jsanda, loleary | ||||||
| Target Milestone: | --- | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | 4.2 | Doc Type: | Bug Fix | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | |||||||||
| : | 769939 (view as bug list) | Environment: | |||||||
| Last Closed: | 2012-02-07 19:19:01 UTC | Type: | --- | ||||||
| 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: | 625146, 743764 | ||||||||
| Attachments: |
|
||||||||
|
Description
dsteigne
2011-09-08 17:39:34 UTC
Steps to reproduce:
# Install JBoss EAP 5.1.0 server
# Start JBoss EAP 5.1.0 server using production configuration
# Import JBoss EAP 5.1.0 server into inventory
# Execute CLI
pushd "${workDir}"/rhq-remoting-cli-*/bin && ./rhq-cli.sh && popd
# Execute CLI commands
login rhqadmin rhqadmin localhost 7080
var rc = new ResourceCriteria();
rc.addFilterResourceTypeName('Web Application (WAR)');
rc.addFilterName('admin-console.war');
var adminConsole = ResourceManager.findResourcesByCriteria(rc);
var war = ProxyFactory.getResource(adminConsole.get(0).id);
war.retrieveBackingContent("/tmp/admin-console.war.bak");
Actual Results:
Execution of war.retrieveBackingContent fails with a timeout message:
Wrapped javax.ejb.EJBException: [Warning] java.lang.RuntimeException: Unable to retrieve package bits for resource: 10017 and package: 10092 before timeout. (<Unknown source>#1)
war.retrieveBackingContent("/tmp/admin-console.war.bak");
^
If debug logging is enabled on the agent, a root cause exception and stack is sent back to the CLI:
java.lang.RuntimeException: Failed to retrieve package bits for PackageDetails[Key=PackageDetailsKey[Name=admin-console.war, Version=1.3.4.SP1 (1.3.4.SP1) Arch=noarch Type=file]]
at org.rhq.plugins.jbossas5.StandaloneManagedDeploymentComponent.retrievePackageBits(StandaloneManagedDeploymentComponent.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.io.FileNotFoundException: admin-console.war (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:137)
at org.rhq.plugins.jbossas5.StandaloneManagedDeploymentComponent.retrievePackageBits(StandaloneManagedDeploymentComponent.java:125)
... 10 more
Expected Result:
The method should succeed and a file should be written to /tmp named admin-console.war.bak that contains the contents of <JBOSS_SERVER_HOME>/deploy/admin-console.war/
Additional Notes:
The issue is due to ResourcePackageDetails not containing a complete path to the resource but instead just a file name. Additionally, StandaloneManagedDeploymentComponent is using the key name for file name instead of file name.
Created attachment 525625 [details]
Proposed patch against b1771757b971949dfe69cccfaa062c957bfc03ff
I haven't tested this, but I did review the code and see the problem. The patch looks good to me. Committed to master as d20a12576a1cc01320c2ce77a665511d20bebc4d logged new BZ https://bugzilla.redhat.com/show_bug.cgi?id=744004 while verifying this. attaching the CLI script i used to verify. Created attachment 526765 [details]
example script
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE |