Bug 690412 - [apache] getAvailability() method of ApacheServerComponent lacks logging
[apache] getAvailability() method of ApacheServerComponent lacks logging
Product: RHQ Project
Classification: Other
Component: Plugins (Show other bugs)
Unspecified Unspecified
medium Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
Depends On:
Blocks: jon3
  Show dependency treegraph
Reported: 2011-03-24 05:51 EDT by Lukas Krejci
Modified: 2013-09-02 03:19 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 769963 (view as bug list)
Last Closed: 2013-09-02 03:19:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch diff to add debug and warning logging for IOException and SSLException (2.70 KB, patch)
2011-03-31 16:30 EDT, Larry O'Leary
no flags Details | Diff

  None (edit)
Description Lukas Krejci 2011-03-24 05:51:35 EDT
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:

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 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.
Comment 2 John Mazzitelli 2011-04-01 11:36:58 EDT
see if we can fix or at minimum document the workarounds somewhere
Comment 3 Larry O'Leary 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.
Comment 4 John Mazzitelli 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
Comment 5 John Sanda 2011-04-07 16:29:38 EDT
Incorporated patch along changes for bug 690430.
Comment 6 John Sanda 2011-04-07 16:29:57 EDT
Incorporated patch along with changes for bug 690430.
Comment 7 John Sanda 2011-04-07 16:32:56 EDT
Forgot to mention commit hash in previous comment.

commit: 4dce488060dcf08592daad2571560b16ba20241c
Comment 8 Sunil Kondkar 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 9 Heiko W. Rupp 2013-09-02 03:19:40 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.

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