Bug 653695 - If Apache plug-in fails to parse/load a discovered Apache configuration file, discovery of remaining Apache processes is halted
Summary: If Apache plug-in fails to parse/load a discovered Apache configuration file,...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Lukas Krejci
QA Contact: Sunil Kondkar
URL:
Whiteboard:
Depends On:
Blocks: jon30-bugs
TreeView+ depends on / blocked
 
Reported: 2010-11-15 23:09 UTC by Larry O'Leary
Modified: 2018-11-14 16:38 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
: 663745 (view as bug list)
Environment:
JON 2.4 Windows 2003 Apache HTTPD 2.2 Apache Plug-in
Last Closed: 2013-09-02 07:17:27 UTC
Embargoed:


Attachments (Terms of Use)
Proposed patch based off rhq master (1.79 KB, patch)
2010-11-15 23:21 UTC, Larry O'Leary
no flags Details | Diff

Description Larry O'Leary 2010-11-15 23:09:07 UTC
If more than one Apache process is running on a platform and discovery fails to load or parse the configuration file of one of the Apache instances, the entire discovery process is terminated leaving all Apache instances un-discovered.

This is due to an exception that can bubble up and break the loop which iterates through each Apache instance in org.rhq.plugins.apache.ApacheServerDiscoveryComponent.discoverResources(ResourceDiscoveryContext<PlatformComponent> discoveryContext) when loadParser(serverConfigFile.getAbsolutePath(), serverRoot) is invoked.

To reproduce (in JON 2.4):
  1) Install Apache on a Windows platform at its default location (for example: C:\Program Files\Apache Software Foundation\Apache2.2)

  2) Do not register Apache to start as a service, if it is, un-register it or set the service from Auto start to Manual start

  3) Move the httpd.conf file from the Apache conf directory to an alternate location (For example: from C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf to C:\Program Files\Apache Software Foundation\00368619\Apache2.2\conf\httpd.conf)

  4) Register an instance of Apache as a Windows Service and point it to the alternate configuration file (For example: "C:\Program Files\Apache Software Foundation\Apache2.2\bin\httpd.exe" -k install -n "Apache_00368619" -f "C:\Program Files\Apache Software Foundation\00368619\Apache2.2\conf\httpd.conf")

  5) Have the Agent perform discovery

The result should be that the configuration file could not be found for the first process discovered and the real process (with alternate configuration) will not be discovered due to the first process failing to be discovered.

Comment 1 Larry O'Leary 2010-11-15 23:21:18 UTC
Created attachment 460693 [details]
Proposed patch based off rhq master

Here is the proposed patch that will address this bug. It is confined to the specific test case described in the bug's original description.

Comment 3 Lukas Krejci 2010-12-16 18:30:00 UTC
commit bfa4afdfdf10b80f08113fcb31b301d5e2e958e1
Author: Lukas Krejci <lkrejci>
Date:   Thu Dec 16 19:25:54 2010 +0100

    BZ 653695 - refactor the apache discovery to continue processing the rest of process scan results after an error during processing one of them.

Comment 4 Corey Welton 2011-01-04 04:23:51 UTC
Sunil, please look at this one while you all have the JON/Windows/Apache instance up.

Comment 5 Corey Welton 2011-01-06 15:06:08 UTC
Removing blocker against jon241 version of this bug

Comment 6 Sunil Kondkar 2011-01-07 12:20:57 UTC
Verified on rhq 4.0.0-Snapshot build number:779b977 and also on jon241 build#62 (build number: 10993:e37f225)

1) Installed Apache 2.2.17 on a Windows platform at its default location
(C:\Program Files\Apache Software Foundation\Apache2.2)

2) Set the Apache service from Auto start to Manual start.

3) Moved the httpd.conf file from the Apache conf directory to an alternate
location (For example: from C:\Program Files\Apache Software
Foundation\Apache2.2\conf\httpd.conf to C:\Program Files\Apache Software
Foundation\00368619\Apache2.2\conf\httpd.conf)

4) Registered an instance of Apache as a Windows Service and pointed it to the
alternate configuration file (For example: "C:\Program Files\Apache Software
Foundation\Apache2.2\bin\httpd.exe" -k install -n "Apache_00368619" -f
"C:\Program Files\Apache Software
Foundation\00368619\Apache2.2\conf\httpd.conf")

Observed that the Apache server with alternate configuration (C:\Program
Files\Apache Software Foundation\00368619\Apache2.2\conf\httpd.conf) is
discovered.

Comment 7 Heiko W. Rupp 2013-09-02 07:17:27 UTC
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.


Note You need to log in before you can comment on or make changes to this bug.