Bug 618230

Summary: Apache discovery failure
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
Component: PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: high Docs Contact:
Priority: urgent    
Version: 3.0.0CC: fdrabek, s.roy2
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:54:45 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, 601949    
Attachments:
Description Flags
Attachment contains conf files
none
proposed patch
none
second iteration of the patch none

Description Lukas Krejci 2010-07-26 13:29:26 UTC
Description of problem:

A setup that used to work with Apache plugin in RHQ 1.3.1 fails to be discovered with an exception:

Caused by: org.rhq.plugins.apache.parser.ApacheParserException: Apache configuration file /usr/local/apache2/conf/vhosts.d/*.conf was not found.
        at org.rhq.plugins.apache.parser.ApacheConfigReader.searchFile(ApacheConfigReader.java:26)
        at org.rhq.plugins.apache.parser.ApacheParserImpl.addDirective(ApacheParserImpl.java:27)
        at org.rhq.plugins.apache.parser.ApacheConfigReader.searchFile(ApacheConfigReader.java:50)

 
Steps to Reproduce:
1.
2.
3.
  
Actual results:
Apache discovery fails

Expected results:
Apache gets discovered as it used in 1.3.1

Additional Info:

http://community.jboss.org/message/554361

Comment 1 Siddhartha Roy 2010-07-26 14:01:45 UTC
Created attachment 434424 [details]
Attachment contains conf files

Comment 2 Lukas Krejci 2010-07-26 14:15:39 UTC
Ok, I was able to reproduce this.

This bug is caused by incorrect handling of absolute paths with a glob pattern.
The workaround is to define all the Include directives with relative paths which are going to get resolved under the ServerRoot.

In case of the provided configuration files, it should be enough to change

Include /usr/local/apache2/conf/vhosts.d/*.conf

with

Include conf/vhosts.d/*.conf

Comment 3 Lukas Krejci 2010-07-26 14:37:52 UTC
Created attachment 434433 [details]
proposed patch

Comment 4 Lukas Krejci 2010-07-26 14:39:36 UTC
the above comment should have read "proposed patch" :)

Comment 5 Charles Crouch 2010-07-27 02:29:25 UTC
Since this has a workaround I don't think this is a blocker however its something we should get fixed in master asap.

Comment 6 Lukas Krejci 2010-07-27 19:19:49 UTC
Created attachment 434809 [details]
second iteration of the patch

Adding a null check for File.listRoots() so that we don't blow up in the presumably rare case when that method would return null.

Comment 7 Filip Drabek 2010-07-27 22:23:10 UTC
The patch solves the apache discovery problem. The problem can still occure during loading and updating of configuration. (Augeas functionality)

Patch was applied by commit 56081bbf57ddb82a7796ac33f5db80a4ed014d20.

Comment 8 Filip Drabek 2010-07-27 23:06:58 UTC
The problem with loading and updating of configuration is described in this issue: https://bugzilla.redhat.com/show_bug.cgi?id=618877 .

Comment 9 Corey Welton 2010-07-28 16:12:29 UTC
QA Verified.

Comment 10 Corey Welton 2010-08-12 16:54:45 UTC
Mass-closure of verified bugs against JON.