Bug 1123364

Summary: Plug-in updates do not get applied due to plug-in files using same version number but having older timestamp then already installed plug-in
Product: [JBoss] JBoss Operations Network Reporter: Filip Brychta <fbrychta>
Component: Core ServerAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED EOL QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: unspecified    
Version: JON 3.2.2CC: fbrychta, loleary, mfoley, myarboro
Target Milestone: ---Keywords: Reopened
Target Release: JON 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-10 14:59:41 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:

Description Filip Brychta 2014-07-25 12:38:32 UTC
Description of problem:
According to doc text in bz 1088652:
    1.  Either extract the plug-in pack archive file to the JBoss ON server's root directory or manually upload each plug-in JAR from the archive using the JBoss ON agent plug-ins administration page.
    2.  From the JBoss ON agent plug-ins administration page, click the 'Scan For Updates' button

it shoudl be possible to extract plug-in pack archive file to the JBoss ON server's root directory. But this option doesn't update the jboss-as-7 plugin.

Version-Release number of selected component (if applicable):
Version :	
3.2.0.GA Update 02
Build Number :	
dfe3e4b:cf4474c

How reproducible:
4/4

Steps to Reproduce:
1. have jon3.2.2 running
2. unzip jon-plugin-pack-eap-3.2.0.GA-update-01.zip -d jon-server-3.2.0.GA
3. From the JBoss ON agent plug-ins administration page, click the 'Scan For Updates' button

Actual results:
Plugins are not updated.
Original md5 of jboss-as-7 plugin was a93d3a7dc6ac332f92528e3cb0d91665 and it remains the same after the update.

Expected results:
Plugins are updated

Additional info:
From server.log:
08:03:09,488 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-2) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/jopr-jboss-cache-v3-plugin-4.9.0.JON320GA.jar], which is the same as the existing one. It will be ignored
08:03:09,621 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-2) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/rhq-rhqserver-plugin-4.9.0.JON320GA.jar], which is the same as the existing one. It will be ignored
08:03:09,805 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-2) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/jopr-jboss-as-plugin-4.9.0.JON320GA.jar], which is the same as the existing one. It will be ignored
08:03:09,913 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-2) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/jopr-hibernate-plugin-4.9.0.JON320GA.jar], which is the same as the existing one. It will be ignored
08:03:10,269 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-2) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/hornetq-jopr-plugin-2.0.0.Final.jar], which is the same as the existing one. It will be ignored
08:03:10,360 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-2) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/jopr-jboss-cache-plugin-4.9.0.JON320GA.jar], which is the same as the existing one. It will be ignored

Note that rhq-jboss-as-7-plugin is not marked as ignored.

When you copy the jar files from Plugin Pack Update-01 to jon_server_home/plugins manualy, plugins are updated correctly (after clicking on the 'Scan For Updates' button). It is visible in server.log that the plugin is being updated:
08:09:13,275 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-5) Found plugin jar at [/home/hudson/jon-server-3.2.0.GA/plugins/rhq-jboss-as-7-plugin-4.9.0.JON320GA.jar] and placed it at [/home/hudson/jon-server-3.2.0.GA/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-plugins/rhq-jboss-as-7-plugin-4.9.0.JON320GA.jar]
08:09:13,376 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-5) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/jopr-jboss-cache-v3-plugin-4.9.0.JON320GA.jar], which is the same as the existing one. It will be ignored
08:09:13,507 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-5) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/rhq-rhqserver-plugin-4.9.0.JON320GA.jar], which is the same as the existing one. It will be ignored
08:09:13,686 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-5) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/jopr-jboss-as-plugin-4.9.0.JON320GA.jar], which is the same as the existing one. It will be ignored
08:09:13,792 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-5) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/jopr-hibernate-plugin-4.9.0.JON320GA.jar], which is the same as the existing one. It will be ignored
08:09:13,971 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-5) Found plugin jar at [/home/hudson/jon-server-3.2.0.GA/plugins/rhq-augeas-plugin-4.9.0.JON320GA.jar] and placed it at [/home/hudson/jon-server-3.2.0.GA/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-plugins/rhq-augeas-plugin-4.9.0.JON320GA.jar]
08:09:14,108 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-5) Found plugin jar at [/home/hudson/jon-server-3.2.0.GA/plugins/rhq-apache-plugin-4.9.0.JON320GA.jar] and placed it at [/home/hudson/jon-server-3.2.0.GA/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-plugins/rhq-apache-plugin-4.9.0.JON320GA.jar]
08:09:14,207 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-5) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/hornetq-jopr-plugin-2.0.0.Final.jar], which is the same as the existing one. It will be ignored
08:09:14,298 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-5) Found a plugin at [/home/hudson/jon-server-3.2.0.GA/plugins/jopr-jboss-cache-plugin-4.9.0.JON320GA.jar], which is the same as the existing one. It will be ignored
08:09:14,504 INFO  [org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner] (http-/0.0.0.0:7080-5) Found plugin jar at [/home/hudson/jon-server-3.2.0.GA/plugins/jopr-jboss-as-5-plugin-4.9.0.JON320GA.jar] and placed it at [/home/hudson/jon-server-3.2.0.GA/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-plugins/jopr-jboss-as-5-plugin-4.9.0.JON320GA.jar]
08:09:15,496 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] (http-/0.0.0.0:7080-5) Rediscovered agent plugin [JBossAS7]
08:09:15,497 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] (http-/0.0.0.0:7080-5) Newer version of [JBossAS7] plugin found (version 4.9.0.JON320GA) - older version (4.9.0.JON320GA) will be ignored.
08:09:15,599 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] (http-/0.0.0.0:7080-5) Rediscovered agent plugin [Augeas]
08:09:15,600 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] (http-/0.0.0.0:7080-5) Newer version of [Augeas] plugin found (version 4.9.0.JON320GA) - older version (4.9.0.JON320GA) will be ignored.
08:09:15,707 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] (http-/0.0.0.0:7080-5) Rediscovered agent plugin [Apache]
08:09:15,707 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] (http-/0.0.0.0:7080-5) Newer version of [Apache] plugin found (version 4.9.0.JON320GA) - older version (4.9.0.JON320GA) will be ignored.
08:09:15,868 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] (http-/0.0.0.0:7080-5) Rediscovered agent plugin [JBossAS5]
08:09:15,869 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] (http-/0.0.0.0:7080-5) Newer version of [JBossAS5] plugin found (version 4.9.0.JON320GA) - older version (4.9.0.JON320GA) will be ignored.
08:09:15,914 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] (http-/0.0.0.0:7080-5) Deploying [4] new or updated agent plugins: [Apache, JBossAS7, JBossAS5, Augeas]
08:09:16,763 INFO  [org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean] (http-/0.0.0.0:7080-5) Updating resource type [JBossAS7:JBossAS7 Host Controller(id=0)]...
08:09:18,086 INFO  [org.rhq.enterprise.server.resource.metadata.MeasurementMetadataManagerBean] (http-/0.0.0.0:7080-5) Metadata update: Adding new trait definition [Domain Host Name] to type ResourceType[id=10289, name=JBossAS7 Host Controller, plugin=JBossAS7, category=Server]...
08:09:18,458 INFO  [org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean] (http-/0.0.0.0:7080-5) Updating resource type [JBossAS7:JBossAS7 Standalone Server(id=0)]...
08:09:20,100 INFO  [org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean] (http-/0.0.0.0:7080-5) Updating resource type [JBossAS7:Osgi(id=0)]...
08:09:20,368 INFO  [org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean] (http-/0.0.0.0:7080-5) Updating resource type [JBossAS7:ServerGroup(id=0)]...
08:09:20,867 INFO  [org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean] (http-/0.0.0.0:7080-5) Updating resource type [JBossAS7:Resource Adapters(id=0)]...
.
.
.

Comment 2 Filip Brychta 2014-07-25 13:18:25 UTC
This is weird but it seems that this issue is caused by file timestamps. Unzip preserves timestamps and cp does not. When you use --preserve option for cp the issue is visible. Without this option it works.

Comment 5 John Mazzitelli 2014-09-08 14:40:11 UTC
(In reply to Filip Brychta from comment #2)
> This is weird but it seems that this issue is caused by file timestamps.
> Unzip preserves timestamps and cp does not. When you use --preserve option
> for cp the issue is visible. Without this option it works.

The server will definitely look at timestamps. If the plugin version string is the same as the plugin version deployed in the server, the fallback is timestamp. If the timestamp is older than the  plugins that are already installed, those plugins with the old timestamps are ignored.

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

Comment 8 John Mazzitelli 2014-09-29 18:17:02 UTC
I don't think this is a problem. If the versions are the same, the ones with the timestamps "win" - that's expected behavior.

Is there something else I am misunderstanding about this BZ?

Comment 9 Filip Brychta 2014-09-30 06:51:41 UTC
This problem will affect only installations which have newer timestamp than jon-plugin-pack-eap-3.2.0.GA-update-01. This will probably happen only in testing environment.

1. install fresh jon3.2.2
2. copy original plugins - now you have plugins with timestamp == now, because cp command doesn't preserve timestamps
3. unzip jon-plugin-pack-eap-3.2.0.GA-update-01.zip -d jon-server-3.2.0.GA

So plugins from step 3 have the same name but older timestamps because unzip preserves it.

Comment 10 Lukas Krejci 2014-10-15 13:19:19 UTC
Am I right in understanding this as basically a user error?

I will proactively close this as NOTABUG. If anyone disagrees with that, please move it back.

Comment 11 Filip Brychta 2014-10-16 11:37:20 UTC
Re-opening since there still seems to be a misunderstanding.

Problem is caused by different behaviour of cp command and unzip command regarding file timestamps. Installation manual [1] instructs users to use cp command to copy plugin jar files but doc text in bz 1088652 instruct users to use unzip command directly. Previous facts lead to this situation:

1. (for some reason e.g. testing) install fresh (now) jon3.2.2 with jon-plugin-pack-eap-3.2.0.GA - so following installation manual you should use cp command to copy plugin jars -> plugin jars have timestamp == now, because cp command doesn't preserve timestamps
2. following doc text in bz 1088652: 
unzip jon-plugin-pack-eap-3.2.0.GA-update-01.zip -d jon-server-3.2.0.GA 

So plugin jar files extracted in step 2 have older timestamps (date when update-01 was released) than already installed plugins -> plugins from update-01 will be ignored.

This is really a low priority edge case but it could be fixed easily just by updating doc text in bz 1088652 to follow the same logic as installation manual which is:
 - unzip jar files to /tmp
 - copy them to JON_SERVER_HOME/plugins directory



1 - https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Operations_Network/3.2/html/Installation_Guide/installing-plugins.html

Comment 12 John Mazzitelli 2014-10-16 12:28:25 UTC
making this a documentation issue. see comment #11 for what is recommended for the documentation.

Comment 13 Simeon Pinder 2014-10-20 17:26:38 UTC
Moving to CR01 as missed ER05 initial and extended cutoffs.

Comment 18 Filip Brychta 2019-06-10 14:59:41 UTC
JBoss ON is coming to the end of its product life cycle. For more information regarding this transition, see https://access.redhat.com/articles/3827121.
This bug report/request is being closed. If you feel this issue should not be closed or requires further review, please create a new bug report against the latest supported JBoss ON 3.3 version.