Bug 1212020

Summary: routing daemon can not delete monitor due to improper configuration usage.
Product: OpenShift Container Platform Reporter: Eric Rich <erich>
Component: NodeAssignee: Miciah Dashiel Butler Masters <mmasters>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 2.2.0CC: adellape, bleanhar, cryan, jialiu, jokerman, libra-onpremise-devel, mmasters, mmccomas, nicholas_schuetz, tiwillia
Target Milestone: ---Keywords: NeedsTestCase
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-openshift-origin-routing-daemon-0.24.1.1-1.el6op Doc Type: Bug Fix
Doc Text:
In the /etc/openshift/routing-daemon.conf file, if the MONITOR_TYPE parameter for the F5 routing daemon listener is set to 'https', an 'https-ecv' type monitor was created. When the monitor was to be deleted, a type of 'https' was expected when the type was actually 'https-ecv', returning a 400 error. This bug fix updates the routing daemon such that when 'https' is specified as the MONITOR_TYPE, it expects the monitor to be deleted to have a type of 'https-ecv'. As a result, monitors created with a configured MONITOR_TYPE of 'https' or any other type can be successfully deleted.
Story Points: ---
Clone Of:
: 1212040 (view as bug list) Environment:
Last Closed: 2015-07-21 19:12:14 UTC Type: Bug
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: 1212040    

Description Eric Rich 2015-04-15 12:21:40 UTC
Description of problem:

With the [creation of the monitor](https://github.com/openshift/origin-server/blob/master/routing-daemon/lib/openshift/routing/models/f5-icontrol-rest.rb#L114-L116), we select (https, or http) based on the value of MONITOR_TYPE, however upon the [deletion](https://github.com/openshift/origin-server/blob/master/routing-daemon/lib/openshift/routing/models/f5-icontrol-rest.rb#L127-L129), we use the MONITOR_TYPE value. 

If the value is, HTTP or https, an http monitor type is created, but this type can not be deleted because when we try and delete this TYPE (HTTP, https) the monitor does not exist on the F5, and results in a 400 message. 


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

How reproducible: 100%

Steps to Reproduce:
1. set 'HTTP,https,xyz,XYZ' for the MONITOR_TYPE in /etc/openshift/routing-daemon.conf

Actual results:

W, [2015-04-09T14:08:14.507206 #5768]  WARN -- : Got an exception: got RestClient::BadRequest exception: 400 Bad Request (Found unexpected json pair at module /ltm/monitor. The json pair is "HTTP":{"monitor_ose_APPNAME_NAMESPACE":null}.)
D, [2015-04-09T14:08:14.507297 #5768] DEBUG -- : Backtrace:
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-routing-daemon-0.23.2.0/lib/openshift/routing/models/f5-icontrol-rest.rb:54:in `rescue in rest_request'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-routing-daemon-0.23.2.0/lib/openshift/routing/models/f5-icontrol-rest.rb:40:in `rest_request'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-routing-daemon-0.23.2.0/lib/openshift/routing/models/f5-icontrol-rest.rb:88:in `delete'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-routing-daemon-0.23.2.0/lib/openshift/routing/models/f5-icontrol-rest.rb:128:in `delete_monitor'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-routing-daemon-0.23.2.0/lib/openshift/routing/controllers/simple.rb:130:in `delete_monitor'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-routing-daemon-0.23.2.0/lib/openshift/routing/daemon.rb:339:in `delete_application'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-routing-daemon-0.23.2.0/lib/openshift/routing/daemon.rb:252:in `handle'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-routing-daemon-0.23.2.0/lib/openshift/routing/daemon.rb:226:in `listen'

Expected results:

Should delete with out error. 

Additional info:

This situation can be avoided, or workaround by supplying only http to the configuration, all others cause a conflict, due to the way we create the monitor.

Comment 9 Johnny Liu 2015-05-07 10:39:44 UTC
Verified this bug with rubygem-openshift-origin-routing-daemon-0.24.1.1-1.el6op.noarch, and PASS.

Could reproduce this bug with rubygem-openshift-origin-routing-daemon-0.23.2.0-1.el6op.noarch, and set MONITOR_TYPE=HTTP in /etc/openshift/routing-daemon.conf.

After update package to rubygem-openshift-origin-routing-daemon-0.24.1.1-1.el6op.noarch, no error is seen.

Also verified when MONITOR_TYPE=[http|HTTP|https|HTTPS|https-ecv|http-ecv|xyz], all passed.

Comment 11 errata-xmlrpc 2015-07-21 19:12:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1463.html