Bug 2294369

Summary: 'openstack loadbalancer healthmonitor set' requires '--delay <value>' in addition to the desired field.
Product: Red Hat OpenStack Reporter: Keigo Noha <knoha>
Component: openstack-octaviaAssignee: Gregory Thiemonge <gthiemon>
Status: CLOSED ERRATA QA Contact: Arkady Shtempler <ashtempl>
Severity: medium Docs Contact: Greg Rakauskas <gregraka>
Priority: medium    
Version: 17.1 (Wallaby)CC: beagles, gthiemon, mariel, tweining
Target Milestone: z4Keywords: Triaged
Target Release: 17.1   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-octavia-8.0.2-17.1.20240702130757.8cbe692.el9ost Doc Type: Bug Fix
Doc Text:
In previous RHOSP releases, users were unable to update the delay of a Load-balancing service (octavia) UDP health monitor. This problem was caused by a bug in the validation of parameters used to configure UDP health monitors. In RHOSP 17.1.4, this bug has been fixed, and users can now modify the delay for UDP health monitors.
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-11-21 09:41:34 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:

Description Keigo Noha 2024-06-26 06:15:56 UTC
Description of problem:
'openstack loadbalancer healthmonitor set' requires '--delay <value>' in addition to the desired field. 

For example, a user tries to update the name of the healthmonitor for UDP connect.
~~~
$ openstack loadbalancer healthmonitor set --name test f6cfe1e4-f66d-47cd-a1a5-2c410e9f93ca
'<' not supported between instances of 'UnsetType' and 'int' (HTTP 500) (Request-ID: req-56355543-14ff-41ec-b99c-4a7cc1a04b94)
~~~

~~~
2024-06-26 05:41:18.046 17 ERROR wsme.api [req-56355543-14ff-41ec-b99c-4a7cc1a04b94 - 4b6e4255d565414a9e1868e5957b30a1 - default default] Server-side error: "'<' not supported between instances of 'UnsetType' and 'int'". Detail: 
Traceback (most recent call last):

  File "/usr/lib/python3.9/site-packages/wsmeext/pecan.py", line 85, in callfunction
    result = f(self, *args, **kwargs)

  File "/usr/lib/python3.9/site-packages/octavia/api/v2/controllers/health_monitor.py", line 358, in put
    self._validate_healthmonitor_request_for_udp_sctp(health_monitor,

  File "/usr/lib/python3.9/site-packages/octavia/api/v2/controllers/health_monitor.py", line 188, in _validate_healthmonitor_request_for_udp_sctp
    if hm_is_type_udp and request.delay < conf_min_delay:

TypeError: '<' not supported between instances of 'UnsetType' and 'int'

2024-06-26 05:41:18.697 18 DEBUG octavia.common.keystone [req-8d738b65-c0ef-4f71-abb4-a76ad81e9063 - - - - -] Request path is /healthcheck and it does not require keystone authentication process_request /usr/lib/python3.9/site-packages/octavia/common/keystone.py:76
2024-06-26 05:41:18.703 19 DEBUG octavia.common.keystone [req-61bba16e-e26e-43c6-8c5f-79836d005c6b - - - - -] Request path is /healthcheck and it does not require keystone authentication process_request /usr/lib/python3.9/site-packages/octavia/common/keystone.py:76
2024-06-26 05:41:18.703 16 DEBUG octavia.common.keystone [req-6792d900-7d9e-4322-8853-2e55ffc5c537 - 4b6e4255d565414a9e1868e5957b30a1 - default default] Request path is /healthcheck and it does not require keystone authentication process_request /usr/lib/python3.9/site-packages/octavia/common/keystone.py:76
2024-06-26 05:41:20.704 17 DEBUG octavia.common.keystone [req-56355543-14ff-41ec-b99c-4a7cc1a04b94 - 4b6e4255d565414a9e1868e5957b30a1 - default default] Request path is /healthcheck and it does not require keystone authentication process_request /usr/lib/python3.9/site-packages/octavia/common/keystone.py:76
~~~

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

How reproducible:
Everytime when a user runs 'openstack loadbalancer healthmonitor set' command without '--delay <value>' option.

Steps to Reproduce:
1. Deploy overcloud
2. Create loadbalancer for UDP according to https://docs.openstack.org/octavia/latest/user/guides/basic-cookbook.html#deploy-a-udp-load-balancer-with-a-health-monitor
3. Run 'openstack loadbalancer healthmonitor set' command without '--delay <value>' option.

Actual results:
The command gets error and the request is not completed.

~~~
$ openstack loadbalancer healthmonitor set --name test f6cfe1e4-f66d-47cd-a1a5-2c410e9f93ca
'<' not supported between instances of 'UnsetType' and 'int' (HTTP 500) (Request-ID: req-56355543-14ff-41ec-b99c-4a7cc1a04b94)
~~~

Expected results:
The openstack loadbalancer healthmonitor set command succeeds.

Additional info:
This issue is reported at upstream, https://bugs.launchpad.net/octavia/+bug/2059894
Upstream fix is https://review.opendev.org/c/openstack/octavia/+/914811

Comment 14 Gregory Thiemonge 2024-11-21 08:00:21 UTC
Verification
------------

openstack loadbalancer create --vip-subnet external_subnet --name lb1 --wait
openstack loadbalancer listener create --protocol UDP --protocol-port 1234 --name listener1 lb1 --wait
openstack loadbalancer pool create --protocol UDP --lb-algorithm ROUND_ROBIN --name pool1 --listener listener1 --wait
openstack loadbalancer healthmonitor create --delay 5 --timeout 3 --max-retries 3 --type UDP-CONNECT --name hm1 pool1 --wait

(overcloud) [stack@undercloud-0 ~]$ openstack loadbalancer healthmonitor set --name hm2 hm1
(overcloud) [stack@undercloud-0 ~]$ openstack loadbalancer healthmonitor show hm2
/usr/lib/python3.9/site-packages/osc_lib/utils/__init__.py:448: DeprecationWarning: The usage of formatter functions is now discouraged. Consider using cliff.columns.FormattableColumn instead. See reviews linked with bug 1687955 for more detail.
  warnings.warn(
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| project_id          | 5163d63c37114ffabee0a62764de9d98     |
| name                | hm2                                  |
| admin_state_up      | True                                 |
| pools               | 7fee3e6f-00f5-48e1-9ca7-63338e961f54 |
| created_at          | 2024-11-21T07:58:15                  |
| provisioning_status | ACTIVE                               |
| updated_at          | 2024-11-21T07:58:48                  |
| delay               | 5                                    |
| expected_codes      | None                                 |
| max_retries         | 3                                    |
| http_method         | None                                 |
| timeout             | 3                                    |
| max_retries_down    | 3                                    |
| url_path            | None                                 |
| type                | UDP-CONNECT                          |
| id                  | 1efaca60-2871-4f39-b63f-42451c69ae06 |
| operating_status    | ONLINE                               |
| http_version        | None                                 |
| domain_name         | None                                 |
| tags                |                                      |
+---------------------+--------------------------------------+

LGTM

Comment 16 errata-xmlrpc 2024-11-21 09:41:34 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 (RHOSP 17.1.4 bug fix and enhancement 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://access.redhat.com/errata/RHBA-2024:9974