Bug 683545 - Uploaded plugins can not be (re)deployed?
Uploaded plugins can not be (re)deployed?
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
4.0.0.B02
Unspecified Unspecified
high Severity high (vote)
: ---
: ---
Assigned To: John Sanda
Corey Welton
:
Depends On:
Blocks: gwt-plugins
  Show dependency treegraph
 
Reported: 2011-03-09 11:55 EST by Corey Welton
Modified: 2011-05-23 21:16 EDT (History)
2 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description Corey Welton 2011-03-09 11:55:19 EST
Description of problem:
If I try to upload a plugin, it seems to get uploaded, but not deployed.  Quite possibly there is no method in the UI to actually deploy something after it has been uploaded?

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


How reproducible:


Steps to Reproduce:
1.  Make a backup of your agent plugins
2.  Delete and purge one or more plugins (i.e., IIS, Hudson)
3.  Uupload your plugin(s) again via the upload widget.
4.  Try various things, including "Scan for Updates" to see if your plugins have been added
  
Actual results:
Nothing shows up

Expected results:
The plugins should show up...

Additional info:

...However, I am not sure all the steps for deployment are here in the UI.  I can upload any number of plugins.  Upon doing so, I see them in the upload UI -- and I can hit "Clear" to remove them from said UI. This looks like more of a "staging" area for uploading them to the server versus actual deployment.  But in this case I cannot find a method for actually getting the uploaded plugins deployed...
Comment 1 Corey Welton 2011-03-09 15:57:36 EST
This seems to be intermittent -- though it seems to happen more reliably with the Hudson plugin, for example.
Comment 2 John Sanda 2011-03-17 16:15:46 EDT
Turns out that the problem is not plugin specific. The plugin scanner maintains a cache of plugins on the file system. That cache is updated every time the scanner runs. If you delete/purge/re-add the plugin before the scanner has run, the scanner's cache in effect becomes invalid, and it fails to detect that the plugin on the file system is new.
Comment 3 John Sanda 2011-03-17 16:27:53 EDT
Committed changes to address a problem that occurs when deleting, purging, then
re-adding the plugin. The agent plugin scanner maintains a cache of plugins on the file system, and that cache was getting dirty. This results in the scanner failing to detect a plugin that has been re-added as a new plugin, and consequently, the plugin did not get re-installed. Now when deleting a plugin, a scan is immediately triggered.
    
Then if you went yo purge right away, you could wind up with a constraint violation in rhq_resource_type. Resource types are purged in a scheduled job, so it was possible to purge and re-add a plugin before its resource types have been purged. Now the plugin is marked to be purged. The purge is done in a scheduled job and is not done until all resource types from the plugin have been purged.

Once the user sees that the plugin has been purged, he knows it is safe to re-add it

commit hash: da19c1a6b8d117e0ca04702938e5c7abce6348b6
Comment 4 John Sanda 2011-03-17 16:28:41 EDT
With the da19c1a6 commit, the UI no longer allows you to purge a plugin that you have not already deleted.
Comment 5 Mike Foley 2011-05-03 11:52:00 EDT
Tested RHQ 4.0 community release, as follows:  uploaded a test plugin (Top Server, which was attached to another bz), did 'update plugins' on the agent, then 'discovery -f', imported the resource from the auto-discovery portlet, deleted and purged the plugin.  Then repeated this a 2nd time.  RHQ 4.0 is good with plugin upload/delete/purge  ... and re-upload/delete/purge...

additionally  verified the uploads, deletes in the oracle database with this SQL

select id, name from rhq_plugin where name = 'ResourceFactoryPlugin';
Comment 6 Corey Welton 2011-05-23 21:16:29 EDT
Bookkeeping - closing bug - fixed in recent release.
Comment 7 Corey Welton 2011-05-23 21:16:39 EDT
Bookkeeping - closing bug - fixed in recent release.
Comment 8 Corey Welton 2011-05-23 21:16:39 EDT
Bookkeeping - closing bug - fixed in recent release.
Comment 9 Corey Welton 2011-05-23 21:16:44 EDT
Bookkeeping - closing bug - fixed in recent release.

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