Postgresql fails to apply default sort key when using "--with-count"

Bug #1921543 reported by Goutham Pacha Ravi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
High
Goutham Pacha Ravi

Bug Description

Description
===========
This issue was found on the CI tempest test job for the container driver. This test job runs manila tempest tests with postgresql database (as opposed to mysql as many of the other jobs do).

manila_tempest_tests.tests.api.test_shares_actions.SharesActionsTest.test_list_shares_with_detail_with_count fails:

      DEBUG [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'x-openstack-manila-api-version': '2.61', 'X-Auth-Token': '<omitted>'}
            Body: None
      Response - Headers: {'date': 'Fri, 26 Mar 2021 14:44:02 GMT', 'server': 'Apache/2.4.41 (Ubuntu)', 'x-openstack-manila-api-version': '2.61', 'vary': 'X-OpenStack-Manila-API-Version', 'content-length': '128', 'content-type': 'application/json', 'x-compute-request-id': 'req-7a62ef2f-1be2-4a09-93a7-8cd54a7a5431', 'connection': 'close', 'status': '500', 'content-location': 'https://10.176.194.253/share/v2/b733576f79664abe8f8b12aa246ddace/shares/detail?with_count=true'}
      Body: b'{"computeFault": {"code": 500, "message": "The server has either erred or is incapable of performing the requested operation."}}'
}}}

    Traceback (most recent call last):
      File "/opt/stack/tempest/.tox/tempest/lib/python3.8/site-packages/manila_tempest_tests/tests/api/test_shares_actions.py", line 435, in test_list_shares_with_detail_with_count
        shares = self.shares_v2_client.list_shares_with_detail(params)
      File "/opt/stack/tempest/.tox/tempest/lib/python3.8/site-packages/manila_tempest_tests/services/share/v2/json/shares_client.py", line 298, in list_shares_with_detail
        return self.list_shares(detailed=True, params=params,
      File "/opt/stack/tempest/.tox/tempest/lib/python3.8/site-packages/manila_tempest_tests/services/share/v2/json/shares_client.py", line 289, in list_shares
        resp, body = self.get(uri, headers=headers, extra_headers=experimental,
      File "/opt/stack/tempest/.tox/tempest/lib/python3.8/site-packages/manila_tempest_tests/services/share/v2/json/shares_client.py", line 76, in get
        resp, body = super(SharesV2Client, self).get(url, headers=headers)
      File "/opt/stack/tempest/tempest/lib/common/rest_client.py", line 315, in get
        return self.request('GET', url, extra_headers, headers)
      File "/opt/stack/tempest/tempest/lib/common/rest_client.py", line 704, in request
        self._error_checker(resp, resp_body)
      File "/opt/stack/tempest/tempest/lib/common/rest_client.py", line 880, in _error_checker
        raise exceptions.ServerFault(resp_body, resp=resp,
    tempest.lib.exceptions.ServerFault: Got server fault
    Details: The server has either erred or is incapable of performing the requested operation.

On the server, there's a db traceback: http://paste.openstack.org/show/803968/

Steps to reproduce
==================

1. Setup manila with postgresdb and any backend driver
2. manila list --with-count

Expected result
===============
HTTP 200, List of shares with count

Actual result
=============
HTTP 500 with error traceback in the API logs

Environment
===========
1. Wallaby RC1 of manila
2. Ubuntu 20.04 LTS with postgresql-client-12 postgresql-client-common postgresql-common postgresql-server-dev-12 postgresql-server-dev-all, psycopg2-binary===2.8.6

tags: added: wallaby-backport-potential
Revision history for this message
Vida Haririan (vhariria) wrote :
Changed in manila:
assignee: nobody → Carlos Eduardo (silvacarlose)
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :
Changed in manila:
importance: Undecided → High
milestone: none → xena-1
assignee: Carlos Eduardo (silvacarlose) → Goutham Pacha Ravi (gouthamr)
Changed in manila:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.