Bug 769963

Summary: [apache] getAvailability() method of ApacheServerComponent lacks logging
Product: [Other] RHQ Project Reporter: Charles Crouch <ccrouch>
Component: PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0.0CC: hbrock, hrupp, jsanda, lkrejci, loleary, mazz, skondkar
Target Milestone: ---   
Target Release: JON 2.4.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 690412 Environment:
Last Closed: 2012-02-07 19:25:08 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:

Description Charles Crouch 2011-12-22 20:36:06 UTC
+++ This bug was initially created as a clone of Bug #690412 +++

Description of problem:

It is impossible to find out the failures during getAvailability() of the apache server from the log files.

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


How reproducible:
always

Steps to Reproduce:
1. do not configure SNMP in the apache server
2. enter an invalid URL to the connection properties of the apache server resource
  
Actual results:
The availability goes down but there is no mention about the cause of that fact even on the debug level.

Expected results:
the availability goes down and the logs reveal the cause for that fact at least on the debug level.

Additional info:

--- Additional comment from loleary on 2011-03-31 16:30:08 EDT ---

Created attachment 489220 [details]
Patch diff to add debug and warning logging for IOException and SSLException

Proposed patch which adds missing logging to availability check for ApacheServerComponent and ApacheVirtualHostServiceComponent.

Any connection time IOException gets logged at debug level.
Any connection time SSLException gets logged at warn level. This way, any certificate errors or invalid SSL communications (non SSL end-point, expired certificate, invalid certificate host, non trusted certificate, etc) can be seen as warnings instead of requiring debug level logging to see these types of configuration issues.

--- Additional comment from mazz on 2011-04-01 11:36:58 EDT ---

see if we can fix or at minimum document the workarounds somewhere

--- Additional comment from loleary on 2011-04-01 12:57:34 EDT ---

(In reply to comment #2)
> see if we can fix or at minimum document the workarounds somewhere

Now sure what this refers to. The fix is attached. There are no workarounds. If the connection to the HTTP URL provided by the Apache plug-in configuration fail, it happens completely silently. The only way to workaround the issue would be to install a network packet sniffer between the agent and the Apache instance and even then, that may not help if SSL is in use.

--- Additional comment from mazz on 2011-04-01 13:19:20 EDT ---

> Now sure what this refers to. 
(sorry, this was a quick bulk change while doing triage.)

dev should look at the attached patch and incorporate as necessary

--- Additional comment from jsanda on 2011-04-07 16:29:38 EDT ---

Incorporated patch along changes for bug 690430.

--- Additional comment from jsanda on 2011-04-07 16:29:57 EDT ---

Incorporated patch along with changes for bug 690430.

--- Additional comment from jsanda on 2011-04-07 16:32:56 EDT ---

Forgot to mention commit hash in previous comment.

commit: 4dce488060dcf08592daad2571560b16ba20241c

--- Additional comment from skondkar on 2011-06-15 08:53:11 EDT ---

Verified on build#137 (Version: 4.1.0-SNAPSHOT Build Number: 7377e26)

Followed the steps and verified that the the availability of Apache resource goes down and the server log displays below at the debug level.


2011-06-15 18:15:14,681 DEBUG [org.rhq.enterprise.communications.command.client.ClientRemotePojoFactory] {ClientRemotePojoFactory.execution-failure}Failed to execute remote POJO method [updatePluginConfiguration]. Cause: org.rhq.core.clientapi.agent.discovery.InvalidPluginConfigurationClientException:Unable to connect to managed resource of type [Apache HTTP Server] using the specified connection properties. Failed to start component for resource Resource[id=10012, type=Apache HTTP Server, key=/etc/httpd||/etc/httpd/conf/httpd.conf, name=suniltest.usersys.redhat.com:80, parent=suniltest, version=2.2.3]. -> org.rhq.core.util.exception.WrappedRemotingException:Value of 'url' connection property ('testtest') is not a valid URL.

Marking as verified.

Comment 1 Sunil Kondkar 2011-12-29 10:23:34 UTC
Verified on version: 2.4.2.GA build number: 3fd0075:1afdc60

Followed the steps and verified that the the availability of Apache resource
goes down and the server log displays below at the debug level.

2011-12-29 15:49:41,791 DEBUG [org.rhq.enterprise.communications.command.client.ClientRemotePojoFactory] {ClientRemotePojoFactory.execution-failure}Failed to execute remote POJO method [updatePluginConfiguration]. Cause: org.rhq.core.clientapi.agent.discovery.InvalidPluginConfigurationClientException:Unable to connect to managed resource of type [Apache HTTP Server] using the specified connection properties. Failed to start component for resource Resource[id=10621, type=Apache HTTP Server, key=/etc/httpd, name=suniltest.usersys.redhat.com:80, parent=suniltest, version=2.2.3]. -> org.rhq.core.util.exception.WrappedRemotingException:Value of 'url' connection property ('testurl') is not a valid URL.

Comment 2 Mike Foley 2012-02-07 19:25:08 UTC
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE