Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1099501

Summary: Content not rediscovered after package removal
Product: [JBoss] JBoss Operations Network Reporter: Lukas Krejci <lkrejci>
Component: Content, Plugin ContainerAssignee: Lukas Krejci <lkrejci>
Status: CLOSED CURRENTRELEASE QA Contact: Sunil Kondkar <skondkar>
Severity: high Docs Contact:
Priority: unspecified    
Version: JON 3.2CC: ahovsepy, hrupp, mfoley, skondkar, snegrea
Target Milestone: ER05   
Target Release: JON 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1099497 Environment:
Last Closed: 2014-12-11 14:00:49 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: 1099497    
Bug Blocks:    

Description Lukas Krejci 2014-05-20 13:20:30 UTC
+++ This bug was initially created as a clone of Bug #1099497 +++

Description of problem:
When a package is removed from a resource, there is an immediate attempt to rediscover the packages on the resource. This is to capture the change made by the package removal.

The code errorneously uses a wrong resource id when running the discovery.

Version-Release number of selected component (if applicable):
0.1 - this seems to have been in the codebase since the dawn of time

How reproducible:
always

Steps to Reproduce:
1. Deploy a jar library into AS5 server resource
2. On the content tab, select it and delete it

Actual results:
The jar remains in the list of deployed packages

Expected results:
The jar should not be there

Additional info:

--- Additional comment from Lukas Krejci on 2014-05-20 09:19:57 EDT ---

commit 8d27501568e19f159f35c83d8dcce544ad33c3d3
Author: Lukas Krejci <lkrejci>
Date:   Tue May 20 15:19:06 2014 +0200

    [BZ 1099497] Discover resource packages after package removal.

Comment 2 Stefan Negrea 2014-09-05 21:37:59 UTC
release/jon3.3.x branch commit: 
https://github.com/rhq-project/rhq/commit/8d27501568e19f159f35c83d8dcce544ad33c3d3


The commit that fixes this issue has been in the release branch for a while; just updating the bug to reflect that.

Comment 3 Sunil Kondkar 2014-09-12 11:33:01 UTC
Tested on 

Uploaded a jar file to EAP 5 resource through EAP5 resource->content->New->Upload new package, then deployed the jar file using 'Deploy Selected' button. 

Navigated to the Content->Deployed' tab, selected the jar and tried to delete. 

It shows failure status. Clicking the view link displays UnsupportedOperationException as below:
--------------

java.lang.UnsupportedOperationException
	at org.jboss.on.common.jbossas.AbstractJBossASContentFacetDelegate.removePackages(AbstractJBossASContentFacetDelegate.java:172)
	at org.rhq.plugins.jbossas5.ApplicationServerComponent.removePackages(ApplicationServerComponent.java:358)
	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:601)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocation.call(ResourceContainer.java:759)
	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:722)
---------------------------

The jar remains in the list of deployed packages.

Comment 4 Sunil Kondkar 2014-09-12 11:33:48 UTC
Tested on version :3.3.0.ER02 Build Number :4fbb183:7da54e2

Comment 5 Simeon Pinder 2014-09-29 08:12:39 UTC
Moving into ER05 as didn't make the ER04 cut.

Comment 6 Lukas Krejci 2014-10-09 17:21:11 UTC
Ok, so I discovered this by code inspection and the fix is only inside the plugin container.

The test steps were written from top of my head and the exception Sunil got actually proves the plugin container tries to delete the packages.

Turns out that the functionality for deleting packages is not implemented in ANY resource type implementing content facet (either due to it being really unsupported for given type of resource or merely because it was not implemented).

As such I think we can call this verified, because by getting that exception we proved that the system actually goes out to the correct agent plugin component which then fails because it doesn't implement the feature. But that is not a problem fixed in this BZ. The problem was that before, the compoments were never even called.

If we were to decide that we need this implemented we'd have to provide impls in:
AS4 and AS5 plugins for JAR files and maybe Linux platform for removing rpms.

What is your opinion, Heiko?

Comment 7 Heiko W. Rupp 2014-10-09 20:18:51 UTC
As this is no regression, I think we should call it a day.

Comment 8 Lukas Krejci 2014-10-09 20:38:39 UTC
Ok, VERIFIED then.