Bug 656491 - JON241: [apache] Unresolvable hostname in VirtualHost or ServerName directive fails vhost discovery
JON241: [apache] Unresolvable hostname in VirtualHost or ServerName directive...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
3.0.0
Unspecified Unspecified
high Severity medium (vote)
: ---
: ---
Assigned To: Lukas Krejci
Corey Welton
:
Depends On:
Blocks: jon241-bugs 656497
  Show dependency treegraph
 
Reported: 2010-11-23 15:59 EST by Lukas Krejci
Modified: 2011-05-23 21:16 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 656497 (view as bug list)
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lukas Krejci 2010-11-23 15:59:44 EST
Description of problem:

2010-11-23 21:27:26,654 WARN  [ResourceDiscoveryComponent.invoker.daemon-3] (rhq.plugins.apache.util.HttpdAddressUtility)- Failed to obtain virtual host address.
java.net.UnknownHostException: v-hovnech
        at java.net.InetAddress.getAllByName0(InetAddress.java:1158)
        at java.net.InetAddress.getAllByName(InetAddress.java:1084)
        at java.net.InetAddress.getAllByName(InetAddress.java:1020)
        at java.net.InetAddress.getByName(InetAddress.java:970)
        at org.rhq.plugins.apache.util.HttpdAddressUtility.updateWithServerName(HttpdAddressUtility.java:369)
        at org.rhq.plugins.apache.util.HttpdAddressUtility.getVirtualHostSampleAddress(HttpdAddressUtility.java:275)
        at org.rhq.plugins.apache.ApacheVirtualHostServiceDiscoveryComponent.discoverResources(ApacheVirtualHostServiceDiscoveryComponent.java:102)
        at sun.reflect.GeneratedMethodAccessor263.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:619)
2010-11-23 21:27:26,654 WARN  [InventoryManager.discovery-1] (rhq.core.pc.inventory.InventoryManager)- Failure during discovery for [Apache Virtual Host] Resources - failed after 383 ms.
java.lang.Exception: Discovery component invocation failed.
        at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:283)
        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:619)
Caused by: java.lang.NullPointerException
        at org.rhq.plugins.apache.ApacheVirtualHostServiceDiscoveryComponent.discoverResources(ApacheVirtualHostServiceDiscoveryComponent.java:147)
        at sun.reflect.GeneratedMethodAccessor263.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)
        ... 5 more


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

How reproducible:
always

Steps to Reproduce:
1. have httpd.conf with ServerName with invalid hostname in the main server configuration, or a VirtualHost directive with invalid hostname specified as its address, or a ServerName directive with invalid hostname inside VirtualHost definition.
2. discover and inventory the server
  
Actual results:
the entries with invalid hostnames are not discovered

Expected results:
All the vhosts and the Main server and discovered


Additional info:
Comment 1 Lukas Krejci 2010-11-23 16:16:53 EST
commit ae99b5bc0bf42909308a9d1efc09cee77d06ffc1
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Tue Nov 23 22:09:27 2010 +0100

    a couple of robustness enhancements to the apache plugin:
    BZ 656449 - use the matching algorithm between SNMP values and augeas nodes also
      when matching the vhost node by resource key, because resource key
      in RHQ 3 is based on the SNMP value.
    BZ 652247 - Log the SNMP errors only on DEBUG level during discovery because SNMP isn't
      required for it to work.
    BZ 656476 - Do not fail the discovery if a non-existent directory is used in an Include directive
    BZ 652247, BZ 656491 - Do not choke on invalid/unresolvable hostnames in VirtualHost or ServerName directives
Comment 2 Rajan Timaniya 2010-11-29 08:57:31 EST
Verified on JON 2.4.1 build #28 (Revision: 10957)

Configured httpd.conf with invalid hostname for ServerName in the main server
configuration.

Observation:
All the vhosts and the Main server and discovered
Comment 3 Corey Welton 2011-05-23 21:16:46 EDT
Bookkeeping - closing bug - fixed in recent release.
Comment 4 Corey Welton 2011-05-23 21:16:46 EDT
Bookkeeping - closing bug - fixed in recent release.
Comment 5 Corey Welton 2011-05-23 21:16:47 EDT
Bookkeeping - closing bug - fixed in recent release.
Comment 6 Corey Welton 2011-05-23 21:16:55 EDT
Bookkeeping - closing bug - fixed in recent release.

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