Bug 810911 - Operation run through "Execute Prompt Command" incorrectly reported as failure in server UI
Operation run through "Execute Prompt Command" incorrectly reported as failur...
Product: RHQ Project
Classification: Other
Component: Agent (Show other bugs)
Unspecified Unspecified
high Severity unspecified (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
Depends On: 809615
Blocks: jon310-sprint11/rhq44-sprint11
  Show dependency treegraph
Reported: 2012-04-09 11:48 EDT by Charles Crouch
Modified: 2015-02-01 18:27 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 809615
Last Closed: 2012-04-09 13:28:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Charles Crouch 2012-04-09 11:48:14 EDT
+++ This bug was initially created as a clone of Bug #809615 +++

Created attachment 574939 [details]
agent.log showing result of "plugins update" operations -- see 2012-04-03 11:14:23,535

Description of problem: Running certain agent prompt commands through the "Execute Prompt Command" option in the server UI (e.g. "plugins update") is reported as having failed with the stack-trace below, even though the command appears to have been executed successfully, based on the agent's log file.

java.lang.RuntimeException: Call to [org.rhq.plugins.agent.AgentServerComponent.invokeOperation()] with args [[executePromptCommand, Configuration[id=10241]]] was rudely interrupted.
	at org.rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler.invokeInNewThreadWithLock(ResourceContainer.java:479)
	at org.rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler.invoke(ResourceContainer.java:461)
	at $Proxy55.invokeOperation(Unknown Source)
	at org.rhq.core.pc.operation.OperationInvocation.run(OperationInvocation.java:217)
	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:679)
Caused by: java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1042)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1326)
	at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:257)
	at java.util.concurrent.FutureTask.get(FutureTask.java:119)
	at org.rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler.invokeInNewThreadWithLock(ResourceContainer.java:473)
	... 6 more

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

JON Server 3.0.0.GA and Agent  4.2.0.JON300.GA

How reproducible: Always

Steps to Reproduce:
1. Install server and agent.
2. Import agent into server inventory
3. Click on "Operations" tab for agent.
4. Schedule a new "Execute Prompt Command" operation and set the prompt command to be "plugins update"
5. Notice that the operation is listed as having failed under "History" in the server UI, but the agent's agent.log appears to show it as having succeeded.
Actual results: Successful operation reported as unsuccessful on server.

Expected results: If the operation was executed successfully, the status for the operation should reflect this.

Additional info: I tried setting the "Timeout" value to 30 seconds when scheduling the operation, but the status still shows up as "Failed" immediately after scheduling the operation (operation was scheduled as "Now").
Comment 1 Charles Crouch 2012-04-09 11:51:18 EDT
We should see if we can reproduce this
Comment 2 Jay Shaughnessy 2012-04-09 13:28:11 EDT
I did get a similar error doing this and the command did seem to succeed.
Although I didn't prove it, I think the reason for the error is that the
plugin update needs to shut down the plugin container.

Note that there is an actual 'update plugins' operation defined for this, 
and it seemed to work without issue. Also, I tried other prompt commands
which worked fine. I think it's just this one that is a problem.

So, as a workaround, just use the defined operation. Or, ignore the error.

QE: you could also test that the plugin update operation works as

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