Bug 1999634

Summary: [16.1] 'next' link in paginated GET backups/detail response missing 'detail' in the URL
Product: Red Hat OpenStack Reporter: Meiyan Zheng <mzheng>
Component: openstack-cinderAssignee: Brian Rosmaita <brian.rosmaita>
Status: CLOSED ERRATA QA Contact: Tzach Shefi <tshefi>
Severity: medium Docs Contact:
Priority: medium    
Version: 16.1 (Train)CC: apevec, brian.rosmaita, gcharot, hhuan, jpichon, jvisser, lhh, ltoscano, pgrist, rheslop
Target Milestone: z8Keywords: Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-cinder-15.4.0-1.20220111183513.58f0e73.el8ost Doc Type: Bug Fix
Doc Text:
This update fixes a bug that omitted details from the output of the `openstack volume backup list` command when the output exceeded 1000 lines.
Story Points: ---
Clone Of:
: 2006556 (view as bug list) Environment:
Last Closed: 2022-03-24 11:01:10 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: 2006556    
Bug Blocks:    

Comment 6 Brian Rosmaita 2021-09-08 13:21:09 UTC
@Meiyan: thank you for attaching the relevant OSC output.

Changing to a cinder bug.  The OSC creates the display by making a series of requests to cinder.  The debug output shows that the first request is this:

REQ: curl -g -i -X GET http://xxx/v3/90d0983418c3478e8b0c21e5dd34bda5/backups/detail

The next request is this:

REQ: curl -g -i -X GET http://xxx/v3/90d0983418c3478e8b0c21e5dd34bda5/backups?marker=cbf85889-925b-4071-bfc5-fcc2a6390ad7

(Note that it's *not* http://xxx/v3/90d0983418c3478e8b0c21e5dd34bda5/backups/detail?marker=cbf85889-925b-4071-bfc5-fcc2a6390ad7, which it should be.)

So why is OSC not making the correct request?  It's following the 'next' link in the first response, which is this:

"backups_links": [{"rel": "next", "href": "http://xxx/v3/90d0983418c3478e8b0c21e5dd34bda5/backups?marker=cbf85889-925b-4071-bfc5-GET"}]}

Hence, cinder is not giving OSC a correct link to follow.

This has already been reported upstream as https://bugs.launchpad.net/cinder/+bug/1299247

It appears to have been fixed in 2014 by https://review.opendev.org/c/openstack/cinder/+/84237.

Can you please confirm that this is happening in OSP 16 (that is, the target cloud is OSP 16, not that the version of the openstackclient is the Train release)?

Comment 12 Brian Rosmaita 2021-09-21 20:09:27 UTC
This issue was reported for backups upstream as bug https://launchpad.net/bugs/1837967

This issue was fixed in the upstream ussuri release by https://review.opendev.org/c/openstack/cinder/+/672887

Comment 18 Tzach Shefi 2022-02-04 04:27:43 UTC
Verified on:
openstack-cinder-15.4.0-1.20220114193342.58f0e73.el8ost.noarch

First I bumped up the default backup quota:
openstack quota set --backups 1010 admin

Then I created an empty volume, using a simple bash for loop to created 1005 backups

#!/usr/bin/env bash
. overcloudrc

for i in {1..1005} 
 do
   cinder backup-create 771d52fa-830f-41a8-8286-f748e7958cad  --name backup$i
   sleep 40 
 done

Took a while but as can be seen below missing data from backup 1001.. shows up as expected. 

(overcloud) [stack@undercloud-0 ~]$  openstack volume backup list | more
+--------------------------------------+------------+-------------+-----------+------+
| ID                                   | Name       | Description | Status    | Size |
+--------------------------------------+------------+-------------+-----------+------+
| 43d6b945-194f-437e-90a2-e7b47c670a2c | backup1005 | None        | available |    1 |
| b6694de7-39cc-4114-9b17-341d4d929eef | backup1004 | None        | available |    1 |
| 10b6cbb4-7241-4eab-9648-7db59789435d | backup1003 | None        | available |    1 |
| f5e611bd-64ce-4697-89b0-f18dc3bf2bf4 | backup1002 | None        | available |    1 |
| af3c8bf2-c3a3-488a-bcd4-d459874e5de9 | backup1001 | None        | available |    1 |
| ed5e3a5e-b7bc-4395-8bbb-f2dda478f880 | backup1000 | None        | available |    1 |
| 1519ea85-d3cf-45b0-87e9-7c191f83edc8 | backup999  | None        | available |    1 |
| 1946abde-5e54-4d64-b456-bce8c7922907 | backup998  | None        | available |    1 |
| 7c157b49-aaf1-4dbb-a336-fcda2c660a03 | backup996  | None        | available |    1 |
...
| 961469b0-6e34-48fb-b75b-08e491504486 | backup3      | None        | available |    1 |
| f87bcc72-cf30-4080-9983-db0e2bcdf025 | backup2      | None        | available |    1 |
| 2ecfcc73-940e-464c-a3b2-f0e0996e14a9 | backup1      | None        | available |    1 |
+--------------------------------------+--------------+-------------+-----------+------+

Bugger I forgot to populate backup description field while running the loop. 
Lets create more backups of another volume, this time a volume from an image also adding backup description:

And we're still looking good

(overcloud) [stack@undercloud-0 ~]$  openstack volume backup list | more
+--------------------------------------+--------------+--------------------------+-----------+------+
| ID                                   | Name         | Description              | Status    | Size |
+--------------------------------------+--------------+--------------------------+-----------+------+
| 0835dc07-4ff5-4a94-a41e-19d25d8153a7 | MoreBackups4 | Yay we got a description | creating  |    3 |
| b0357fd6-938e-42e0-ac17-814e11220631 | MoreBackups3 | Data3456                 | available |    3 |
| 6a4cd01a-ed12-49ad-8373-158ee0afe1be | MoreBackups2 | Data2547                 | available |    3 |
| 523de75b-8b51-47d8-bcc3-0a3b0cd469a5 | MoreBackups1 | Testing123               | available |    3 |
| 43d6b945-194f-437e-90a2-e7b47c670a2c | backup1005   | None                     | available |    1 |
| b6694de7-39cc-4114-9b17-341d4d929eef | backup1004   | None                     | available |    1 |
| 10b6cbb4-7241-4eab-9648-7db59789435d | backup1003   | None                     | available |    1 |
| f5e611bd-64ce-4697-89b0-f18dc3bf2bf4 | backup1002   | None                     | available |    1 |
| af3c8bf2-c3a3-488a-bcd4-d459874e5de9 | backup1001   | None                     | available |    1 |
| ed5e3a5e-b7bc-4395-8bbb-f2dda478f880 | backup1000   | None                     | available |    1 |
| 1519ea85-d3cf-45b0-87e9-7c191f83edc8 | backup999    | None                     | available |    1 |
| 1946abde-5e54-4d64-b456-bce8c7922907 | backup998    | None                     | available |    1 |
...
| 961469b0-6e34-48fb-b75b-08e491504486 | backup3      | None                     | available |    1 |
| f87bcc72-cf30-4080-9983-db0e2bcdf025 | backup2      | None                     | available |    1 |
| 2ecfcc73-940e-464c-a3b2-f0e0996e14a9 | backup1      | None                     | available |    1 |
+--------------------------------------+--------------+--------------------------+-----------+------+

I call that good to verify, all fields are populated even after the 1000th line.

Comment 24 errata-xmlrpc 2022-03-24 11:01:10 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 (Red Hat OpenStack Platform 16.1.8 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-2022:0986