Bug 576154

Summary: [apache] IndexOutOfBoundsException while checking for config updates of ApacheIfModuleComponent
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
Component: PluginsAssignee: Filip Drabek <fdrabek>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: medium Docs Contact:
Priority: low    
Version: 3.0.0CC: fdrabek
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-12 16:57:56 UTC Type: ---
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:    
Bug Blocks: 577313    

Description Lukas Krejci 2010-03-23 12:29:34 UTC
Seen in the agent log:

2010-03-23 13:21:55,082 WARN  [ConfigurationManager.threadpool-1] (rhq.core.pc.configuration.ConfigurationCheckExecutor)- Unable to check for updated configuration
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:571)
        at java.util.ArrayList.get(ArrayList.java:349)
        at org.rhq.plugins.apache.ApacheIfModuleComponent.getNode(ApacheIfModuleComponent.java:119)
        at org.rhq.plugins.apache.ApacheIfModuleComponent.loadResourceConfiguration(ApacheIfModuleComponent.java:86)
        at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
        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:525)
        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)

Comment 1 Filip Drabek 2010-04-16 10:22:25 UTC
This can probably happen when the parent directive of IfModule was deleted in configuration file. I will add error handeling.

Comment 2 Filip Drabek 2010-04-22 11:03:34 UTC
commit f3aca43b79d01ee27555d9426ec31f7a1631f8db

Comment 3 Corey Welton 2010-04-22 18:38:19 UTC
Repro steps?

Comment 4 Filip Drabek 2010-04-25 11:57:48 UTC
Steps to Reproduce:

1. Login to RHQ.
2. Navigate to an any apache httpd IfModule resource
3. Navigate to the 'Configuration' tab of main server.
4. Click on 'Change Properties' button
5. Change any property of the configuration.
6. Click on 'Save' button.
7. Check if the value is saved or not.

Comment 5 Corey Welton 2010-05-11 18:51:36 UTC
These steps seem confusing to me.

2. Navigate to an any apache httpd IfModule resource
3. Navigate to the 'Configuration' tab of main server.

* Are we saying we navigate to an IfModule first and then the configuration tab of the main server?  What does this do if we're not doing anything to the IfModule itself
* What is the main server  Is it the inventory item named "Main", or the <server>:80?
* I don't see a 'Change Properties' button in either Main or <server>:80.  There is an edit button however.

Comment 6 Filip Drabek 2010-05-11 19:50:31 UTC
Sorry there had to be - configuration of the IfModule resource.

Please test also the nested IfModules. Repro steps:
1) In httpd configuration file(/etc/httpd/conf/httpd.conf) create nested IfModule. For example :
<IfModule prefork.c>
MaxRequestsPerChild  10000
<IfModule test.c>
   StartServers       64
   MinSpareServers    48
</IfModule>
</IfModule>

2) Run command discovery -f on the agent
3) Login to server 
4) find the IfModule resource with name test.c /this is the name from example/
5) Navigate to the 'Configuration' tab of resource
6) Click on 'Change Properties' button
7) Change any property of the configuration
8) Click on 'Save' button.
9) Check if the value is saved or not.

Comment 7 Corey Welton 2010-05-17 13:22:18 UTC
QE Verified.

Comment 8 Corey Welton 2010-08-12 16:57:56 UTC
Mass-closure of verified bugs against JON.