Bug 698474

Summary: Apache 2.2 as Windows service: Discovery unable to locate correct httpd.conf
Product: [Other] RHQ Project Reporter: Marc Shirley <mshirley>
Component: PluginsAssignee: Lukas Krejci <lkrejci>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: high    
Version: 3.0.0CC: hrupp, mazz, skondkar
Target Milestone: ---   
Target Release: JON 3.0.0, RHQ 4.3.0   
Hardware: Unspecified   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-07 19:17:20 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: 625146, 745494    
Attachments:
Description Flags
Screenshot none

Description Marc Shirley 2011-04-20 23:36:22 UTC
Description of problem:
During discovery of httpd.exe, discovery appears to append the HTTPD_ROOT value to the apache installation directory.  For instance, if installing Apache to C:\Apache2.2, discovery will append the default value of HTTPD_ROOT, /apache, and look for the httpd.conf file at C:\Apache2.2\apache\conf\httpd.conf .

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

How reproducible:
Very

Steps to Reproduce:
1. Install Apache 2.2 in non-default directory such as C:\Apache2.2
2. Start Apache 2.2 as Windows service
3. Run discovery on agent
4. Check log for error.
  
Actual results:
Error "Apache configuration file C:\Apache2.2\apache\conf\httpd.conf was not found."

Expected results:
Agent should correctly discover httpd.conf and not write error to logs.

Additional info:
ERROR [ResourceDiscoveryComponent.invoker.daemon-1] (org.rhq.plugins.apache.ApacheServerDiscoveryComponent)- Discovery of Apache process [process: pid=[7788], name=[C:\Apache2.2\bin\httpd.exe], ppid=[696]] failed with an exception.

org.rhq.plugins.apache.parser.ApacheParserException: Apache configuration file C:\Apache2.2\apache\conf\httpd.conf was not found.

	at org.rhq.plugins.apache.parser.ApacheConfigReader.searchFile(ApacheConfigReader.java:26)

	at org.rhq.plugins.apache.parser.ApacheConfigReader.buildTree(ApacheConfigReader.java:19)

	at org.rhq.plugins.apache.ApacheServerDiscoveryComponent.loadParser(ApacheServerDiscoveryComponent.java:423)

	at org.rhq.plugins.apache.ApacheServerDiscoveryComponent.discoverSingleProcess(ApacheServerDiscoveryComponent.java:164)

	at org.rhq.plugins.apache.ApacheServerDiscoveryComponent.discoverResources(ApacheServerDiscoveryComponent.java:89)

	at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

	at java.lang.reflect.Method.invoke(Method.java:597)

	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:279)

	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

	at java.util.concurrent.FutureTask.run(FutureTask.java:138)

	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

	at java.lang.Thread.run(Thread.java:662)

Comment 1 Charles Crouch 2011-04-26 15:18:11 UTC
We should see if this is fixable in the next JON release

Comment 2 Lukas Krejci 2011-11-01 16:14:02 UTC
master: 00872f6afdfcb1347da10559bcd22cb017b68a18
release_jon3.x: 9e46e174f9c47c49cdfdbbcedc0aafbcfe1c56fa

    BZ 698474 - Work around the limitations in PIQL so that we don't try to
    discover the parent NT service httpd process.

Comment 3 Mike Foley 2011-11-16 18:32:14 UTC
*** Bug 534866 has been marked as a duplicate of this bug. ***

Comment 4 Sunil Kondkar 2011-11-18 14:14:24 UTC
Verified on build#93 (Version: 4.2.0.JON300-SNAPSHOT Build Number: 2619688)

Installed Apache 2.2 in non-default directory (C:\Apache2.2). Started Apache 2.2 as Windows service.

Agent correctly discovered the httpd.conf at "C:\Apache2.2\bin\httpd.exe". Please refer the attached screenshot. There is no apache discovery error in the logs.

Marking as verified.

Comment 5 Sunil Kondkar 2011-11-18 14:22:46 UTC
Created attachment 534398 [details]
Screenshot

Comment 6 Mike Foley 2012-02-07 19:17:20 UTC
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE