Description of problem:
When agent- (probably server- too) plugin is marked as deleted on server, there is no way to undelete it. In case I try to deploy plugin again, it fails.
Version-Release number of selected component (if applicable):
How reproducible: always
Steps to Reproduce:
1. start your server, delete some plugin through UI -> Administration -> Agent plugins
2. copy same plugin (must be same file name/version as the one deleted) to $RHQ/plugins folder
3. check log
Actual results: It fails, server takes plugin, reads some parts of it, and then it deletes it, in the later stage it fails on this
ERROR [org.rhq.enterprise.server.core.StartupBean] (EJB default - 9) Plugin scan failed. Cause: java.lang.Exception:File [/data/rhq/master/dev-container/rhq-server/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-plugins/rhq-platform-plugin-4.10.0-SNAPSHOT.jar] is not a valid jarfile - it is either corrupted or file
has not been fully written yet.
User should be able to deploy previously deleted plugin
Plugin jar is deleted by AgentPluginScanner#removeDeletedPluginsFromFileSystem()
The reason why this workflow is here is due to HA environments. When you delete a plugin in an HA environment, we have to ensure all servers know about it. That's why the two step process of delete-purge.
This is documented in the wiki. Any solution for different workflows when deleting/purging plugins must work in an HA environment.
see https://docs.jboss.org/author/display/RHQ/Agent+Plugin+Administration#AgentPluginAdministration-PurgingPlugins and related docs.
While it is true that this needs to be a 2-step process, there's, imho, no reason why a user should be involved in it.
When they delete a plugin, the intention is most probably that they want it gone. Having to have to remember that once you click the delete button, you have to click "show deleted" and then select the deleted plugin and then hit "purge" (only after manually ensuring that there is no way other servers in HA can magically redeploy it) is I think on the border of a bug :)
I'm making this block BZ 1022943 because it makes working with plugins a part of our public API (both remote and rest). We need to streamline the workflows and make them easy and usable.
(In reply to John Mazzitelli from comment #1)
> The reason why this workflow is here is due to HA environments. When you
As Lukas says, the fact alone, that
a) deleted really means "mark for deletion"
b) you need to klick on "show deleted" (which makes no sense to me as non-native English speaker)
c) need to "really delete"
is confusing as hell to everyone.
If we can not change the workflow itself,
a) renaming to "mark for deletion" or "prepare for deletion"
b) no hiding it then, so no "unhide" button needed
c) finally delete it
And if there is time needed between a) and c) for some background magic, then just
1) keep that "really delete" button disabled until it can be used
2) add some "spinner" on the list of plugins that indicates that there is some backend processing happening.
pull request has been merged. I also did some trivial fixes after the merge, removed unused import, fixed indentation in db-upgrade.xml
git commit to master:
5283ef79ea58b21d47742863a975771ff8e8a434 (fix db-upgrade.xml)
6286a106ce898c32a3a5f60ac9d62f82f03b56d1 (remove bad import)
a637f1ee6a2d1cd424924d0b4350818ee6591ca8 (the main merge)
we'll need to update:
Bulk closing of RHQ 4.11 issues, now that RHQ 4.12 is out.
If you find an issue with those, please open a new BZ, linking to the old one.