Bug 618230 - Apache discovery failure
Apache discovery failure
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
3.0.0
All Linux
urgent Severity high (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Corey Welton
:
Depends On:
Blocks: jon24-apache jon-sprint12-bugs
  Show dependency treegraph
 
Reported: 2010-07-26 09:29 EDT by Lukas Krejci
Modified: 2010-08-12 12:54 EDT (History)
2 users (show)

See Also:
Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-12 12:54:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Lukas Krejci 2010-07-26 09:29:26 EDT
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 10:01:45 EDT
Created attachment 434424 [details]
Attachment contains conf files
Comment 2 Lukas Krejci 2010-07-26 10:15:39 EDT
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 10:37:52 EDT
Created attachment 434433 [details]
proposed patch
Comment 4 Lukas Krejci 2010-07-26 10:39:36 EDT
the above comment should have read "proposed patch" :)
Comment 5 Charles Crouch 2010-07-26 22:29:25 EDT
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 15:19:49 EDT
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 18:23:10 EDT
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 19:06:58 EDT
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 12:12:29 EDT
QA Verified.
Comment 10 Corey Welton 2010-08-12 12:54:45 EDT
Mass-closure of verified bugs against JON.

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