When creating a pool with an associated listener_id, sometimes this information is set, and sometimes it is not. Problem comes from https://github.com/openstack/octavia/blob/master/octavia/api/v2/controllers/pool.py#L244-L245 not setting the listeners property on db_pool pool object even if it is passed.
Pool model (https://github.com/openstack/octavia/blob/master/octavia/db/models.py#L257) is getting the listener information through a property that relies on the information existing on the listener (https://github.com/openstack/octavia/blob/master/octavia/db/models.py#L448).
I checked that even though listener.update gets executed here: https://github.com/openstack/octavia/blob/master/octavia/db/repositories.py#L226-L228
The subsequent pool.get call https://github.com/openstack/octavia/blob/master/octavia/db/repositories.py#L229 is not (always) getting the listeners information.
I tried making it part of the same transaction but it is not always helping: https://review.openstack.org/#/c/604152/
The next workaround solves the issue, though it is not fixing the initial problem of not accessing the latest information on the DB:
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.