Bug 618230 - Apache discovery failure
Summary: Apache discovery failure
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 3.0.0
Hardware: All
OS: Linux
urgent
high
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: jon24-apache jon-sprint12-bugs
TreeView+ depends on / blocked
 
Reported: 2010-07-26 13:29 UTC by Lukas Krejci
Modified: 2010-08-12 16:54 UTC (History)
2 users (show)

Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-12 16:54:45 UTC
Embargoed:


Attachments (Terms of Use)
Attachment contains conf files (8.31 KB, application/octet-stream)
2010-07-26 14:01 UTC, Siddhartha Roy
no flags Details
proposed patch (1.79 KB, patch)
2010-07-26 14:37 UTC, Lukas Krejci
no flags Details | Diff
second iteration of the patch (2.58 KB, patch)
2010-07-27 19:19 UTC, Lukas Krejci
no flags Details | Diff

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.


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