Bug 858813

Summary: [apache] Agent logs warning "Unable to check for updated configuration" when configuration management is disabled
Product: [JBoss] JBoss Operations Network Reporter: Larry O'Leary <loleary>
Component: Plugin -- ApacheAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: medium    
Version: JON 3.0.1CC: jshaughn, myarboro, skondkar
Target Milestone: DR02   
Target Release: JON 3.2.1   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 858815 (view as bug list) Environment:
Last Closed: 2014-05-08 17:44:24 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: 858815    
Bug Blocks:    

Description Larry O'Leary 2012-09-19 17:47:27 UTC
Description of problem:
Even when Augeas support is disabled, the agent reports the following warning for each Apache server and virtual host service in agent inventory:

WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Unable to check for updated configuration


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

How reproducible:
Always

Steps to Reproduce:
1.  Install JON system
    *   Change agent configuration property rhq.agent.plugins.configuration-discovery.period-secs to 120 seconds.
2.  Install and start Apache Web Server (httpd)
3.  Start JON system
4.  Add Apache Web Server to inventory
  
Actual results:
The following warnings appear every at two minute intervals:

2012-09-19 10:40:17,613 INFO  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Starting configuration update check
2012-09-19 10:40:17,618 WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Unable to check for updated configuration
java.lang.IllegalStateException: Configuration and child resource creation/deletion support for Apache is optional. If you switched it on by enabling Augeas support in the connection settings of the Apache server resource and still get this message, it means that either your Apache version is not supported (only Apache 2.x is supported) or Augeas is not available on your platform.
	at org.rhq.plugins.apache.ApacheServerComponent.loadResourceConfiguration(ApacheServerComponent.java:344)
	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:616)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:552)
	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:636)
2012-09-19 10:40:17,619 WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Unable to check for updated configuration
java.lang.IllegalStateException: Configuration and child resource creation/deletion support for Apache is optional. If you switched it on by enabling Augeas support in the connection settings of the Apache server resource and still get this message, it means that either your Apache version is not supported (only Apache 2.x is supported) or Augeas is not available on your platform.
	at org.rhq.plugins.apache.ApacheVirtualHostServiceComponent.loadResourceConfiguration(ApacheVirtualHostServiceComponent.java:158)
	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:616)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:552)
	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:636)
2012-09-19 10:40:17,620 INFO  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Configuration update check completed in 7ms
2012-09-19 10:42:17,613 INFO  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Starting configuration update check
2012-09-19 10:42:17,614 WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Unable to check for updated configuration
java.lang.IllegalStateException: Configuration and child resource creation/deletion support for Apache is optional. If you switched it on by enabling Augeas support in the connection settings of the Apache server resource and still get this message, it means that either your Apache version is not supported (only Apache 2.x is supported) or Augeas is not available on your platform.
	at org.rhq.plugins.apache.ApacheServerComponent.loadResourceConfiguration(ApacheServerComponent.java:344)
	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:616)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:552)
	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:636)
2012-09-19 10:42:17,615 WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Unable to check for updated configuration
java.lang.IllegalStateException: Configuration and child resource creation/deletion support for Apache is optional. If you switched it on by enabling Augeas support in the connection settings of the Apache server resource and still get this message, it means that either your Apache version is not supported (only Apache 2.x is supported) or Augeas is not available on your platform.
	at org.rhq.plugins.apache.ApacheVirtualHostServiceComponent.loadResourceConfiguration(ApacheVirtualHostServiceComponent.java:158)
	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:616)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:552)
	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:636)
2012-09-19 10:42:17,616 INFO  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Configuration update check completed in 3ms


Expected results:
No warning or failure of any kind.

Additional info:
This is happening because the loadResourceConfiguration methods in ApacheServerComponent and ApacheVirtualHostServiceComponent are not implemented to handle a situation when configuration is disabled. Instead, the methods treat isAugeasEnabled = false as an error condition and throw and exception. This should not happen if the user has explicitly disabled Augeas and therefore configuration management for the Apache resource. According to the API doc for ConfigurationFacet.loadResourceConfiguration(), the methods should return null when configuration management is disabled by the plug-in. However, in this case, we are throwing an exception when configuration is disabled.

I think the expected behavior here is to perhaps log a debug message when loadResourceConfiguration is returning null due to isAugeasEnabled returning false without an exception being raised and in cases where isAugeasEnabled throws an exception, we log this as a warning and still return null.

Comment 2 Jay Shaughnessy 2014-02-10 22:50:34 UTC
release/jon3.2.x commit 0c814d757a0b299d8100c9097a23d886a48fd893

Cherry-Pick of master 63e28a6b791514eaba639856c79ff4d81aaf01ac
Reviewed by mazz
Signed-off-by: Jay Shaughnessy <jshaughn>

Comment 3 Simeon Pinder 2014-02-18 15:08:44 UTC
Moving to ON_QA as available for testing in the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=336752

Note: the installed version is still JON 3.2.0.GA by design and this represents part of the payload for JON 3.2.1 also known as cumulative patch 1 for 3.2.0.GA.  How this will be delivered to customers is still being discussed.

Comment 4 Jan Bednarik 2014-02-27 10:33:35 UTC
Moving to ASSIGNED as the WARN message and the exception is still being logged in agent running Apache server.

I followed the steps and discovered that if the Augeas support is disabled, there is this WARN message and the exception repeatedly (after those 120 seconds set) being looged in the agent:

2014-02-27 05:25:01,053 WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- An error occurred while checking for an updated Resource configuration for Resource[id=13582, uuid=9a4d72b0-99d2-40a6-96d9-e161e001f0a6, type={Apache}Apache Virtual Host, key=MainServer, name=Main, parent=10.16.23.199:80].
java.lang.IllegalStateException: Configuration and child resource creation/deletion support for Apache is optional. If you switched it on by enabling Augeas support in the connection settings of the Apache server resource and still get this message, it means that either your Apache version is not supported (only Apache 2.x is supported) or Augeas is not available on your platform. Please refer to your agent's log for the precise exception that is causing this behavior. It will logged at error level only once per plugin container lifetime
	at org.rhq.plugins.apache.ApacheVirtualHostServiceComponent.loadResourceConfiguration(ApacheVirtualHostServiceComponent.java:196)
	at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
	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:654)
	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)

This is in the contradiction with the expected result (no warnings or failures beeing logged)

Comment 5 Jay Shaughnessy 2014-03-03 20:32:36 UTC
Sorry, the first try missed some code paths...

release/jon3.2.x commit ffab827ee42607137650966eb09fe92e7499c200
Author: Jay Shaughnessy <jshaughn>
Date:   Mon Mar 3 15:29:22 2014 -0500

    Cherry-Pick master d36271e39a3003d22325e226f03dda0952408918
    Signed-off-by: Jay Shaughnessy <jshaughn>

Comment 6 Simeon Pinder 2014-03-05 22:21:45 UTC
Moving to ON_QA as available for testing in the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=340294

Note: the installed version is still JON 3.2.0.GA by design and this represents part of the payload for JON 3.2.1 also known as cumulative patch 1 for 3.2.0.GA.  How this will be delivered to customers is still being discussed.

Comment 7 Sunil Kondkar 2014-03-07 12:00:10 UTC
Verified on JON 3.2.1 Dr2 build.
Followed steps and verified that there are no warnings or exceptions.

Comment 8 Mike Foley 2014-05-08 17:44:24 UTC
JON 3.2.1 released week of 5/5/2014