Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1772209

Summary: Unable to filter load balancers by Tag attribute
Product: Red Hat OpenStack Reporter: Maysa Macedo <mdemaced>
Component: openstack-octaviaAssignee: Michael Johnson <michjohn>
Status: CLOSED ERRATA QA Contact: Bruna Bonguardo <bbonguar>
Severity: urgent Docs Contact:
Priority: high    
Version: 15.0 (Stein)CC: cgoncalves, gcheresh, igortiunov, ihrachys, lpeer, ltomasbo, majopela, michjohn, racedoro, scohen, slinaber
Target Milestone: z2Keywords: Triaged, ZStream
Target Release: 15.0 (Stein)Flags: gcheresh: needinfo+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-octavia-4.1.1-0.20191128103129.567a388.el8ost Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-05 11:58:53 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 Maysa Macedo 2019-11-13 22:06:09 UTC
Description of problem:

When installing OCP 4.2 on OSP 15 with Kuryr, an internal Server Error happens when the following call is triggered to the Octavia API:

http://10.0.0.112:9876/v2.0/lbaas/loadbalancers?name=ostest-4jb2v-kuryr-api-loadbalancer&tags=openshiftClusterID%3Dostest-4jb2v&vip_address=172.30.0.1&vip_subnet_id=08b45410-5dcb-425a-a740-30
8cefcc322f

As described in the Octavia logs this seems to be an error when parsing the tags attribute:

2019-11-13 17:02:16.796 21 ERROR wsme.api [req-e3a0c6dd-0160-4034-be3c-7a8b9a926d85 - f95ccdb809df4674952ae92cca57e33a - default default] Server-side error: "Entity '<class 'octavia.db.base_models.Tags'>' has no property 'name'". Detail:
Traceback (most recent call last):

  File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/base.py", line 399, in _entity_descriptor
    return getattr(entity, key)

AttributeError: type object 'Tags' has no attribute 'name'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

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

  File "/usr/lib/python3.6/site-packages/octavia/api/v2/controllers/load_balancer.py", line 90, in get_all
    **query_filter))

  File "/usr/lib/python3.6/site-packages/octavia/db/repositories.py", line 777, in get_all_API_list
    query_options=query_options, **filters)

  File "/usr/lib/python3.6/site-packages/octavia/db/repositories.py", line 165, in get_all
    query, self.model_class)

  File "/usr/lib/python3.6/site-packages/octavia/api/common/pagination.py", line 285, in apply
    query = model.apply_filter(query, model, self.filters)

  File "/usr/lib/python3.6/site-packages/octavia/db/base_models.py", line 126, in apply_filter
    query = query.filter_by(**translated_filters)

  File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 1792, in filter_by
    for key, value in kwargs.items()

  File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 1792, in <listcomp>
    for key, value in kwargs.items()

  File "/usr/lib64/python3.6/site-packages/sqlalchemy/orm/base.py", line 402, in _entity_descriptor
    "Entity '%s' has no property '%s'" % (description, key)

sqlalchemy.exc.InvalidRequestError: Entity '<class 'octavia.db.base_models.Tags'>' has no property 'name'
: sqlalchemy.exc.InvalidRequestError: Entity '<class 'octavia.db.base_models.Tags'>' has no property 'name'

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

$ cat /etc/yum.repos.d/latest-installed
15  -p RHOS_TRUNK-15.0-RHEL-8-20190926.n.0

How reproducible: Always


Steps to Reproduce:
1. enable Octavia on a OSP 15 cloud
2. Try to perform a curl with the query when no LB exists yet
3.

Actual results:


Expected results:


Additional info:

Comment 9 GenadiC 2020-01-05 07:35:59 UTC
Removing need info flag as Luis commented on this need info

Comment 11 Bruna Bonguardo 2020-02-05 10:19:08 UTC
Moving the bug to VERIFIED.

Comment 12 Alex McLeod 2020-02-19 12:44:16 UTC
If this bug requires doc text for errata release, please set the 'Doc Type' and provide draft text according to the template in the 'Doc Text' field. The documentation team will review, edit, and approve the text.

If this bug does not require doc text, please set the 'requires_doc_text' flag to '-'.

Comment 14 errata-xmlrpc 2020-03-05 11:58:53 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://access.redhat.com/errata/RHSA-2020:0721