Bug 690412

Summary: [apache] getAvailability() method of ApacheServerComponent lacks logging
Product: [Other] RHQ Project Reporter: Lukas Krejci <lkrejci>
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: hrupp, jsanda, loleary, mazz, skondkar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 769963 (view as bug list) Environment:
Last Closed: 2013-09-02 07:19:40 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: 678340    
Attachments:
Description Flags
Patch diff to add debug and warning logging for IOException and SSLException none

Description Lukas Krejci 2011-03-24 09:51:35 UTC
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:

Comment 1 Larry O'Leary 2011-03-31 20:30:08 UTC
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.

Comment 2 John Mazzitelli 2011-04-01 15:36:58 UTC
see if we can fix or at minimum document the workarounds somewhere

Comment 3 Larry O'Leary 2011-04-01 16:57:34 UTC
(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.

Comment 4 John Mazzitelli 2011-04-01 17:19:20 UTC
> 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

Comment 5 John Sanda 2011-04-07 20:29:38 UTC
Incorporated patch along changes for bug 690430.

Comment 6 John Sanda 2011-04-07 20:29:57 UTC
Incorporated patch along with changes for bug 690430.

Comment 7 John Sanda 2011-04-07 20:32:56 UTC
Forgot to mention commit hash in previous comment.

commit: 4dce488060dcf08592daad2571560b16ba20241c

Comment 8 Sunil Kondkar 2011-06-15 12:53:11 UTC
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 9 Heiko W. Rupp 2013-09-02 07:19:40 UTC
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.