Designate DNS - “BadRequest” is not raised for set quota, If some quota value is invalid.

Bug #1934596 reported by Arkady Shtempler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
Fix Released
Medium
Michael Johnson

Bug Description

Scenario:
Try to set quota for a project using invalid quotas, for example:

2021-07-04 16:42:13.331 1169274 INFO tempest.lib.common.rest_client [req-036ef900-3e94-4821-9633-be79f88ceddc ] Request (QuotasV2Test:test_admin_sets_invalid_quota_values): 500 PATCH http://10.35.64.8/dns/v2/quotas/81f5b609f64e40799aad57228c6bec6c 0.321s
2021-07-04 16:42:13.332 1169274 DEBUG tempest.lib.common.rest_client [req-036ef900-3e94-4821-9633-be79f88ceddc ] Request - Headers: {'X-Auth-All-Projects': True, 'content-type': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"zones": "tempest-1326507445", "zone_records": 468095, "zone_recordsets": 307092, "recordset_records": 498799, "api_export_size": 968527}

Actual result:
500 Unknown is raised:
    Response - Headers: {'date': 'Sun, 04 Jul 2021 13:42:13 GMT', 'server': 'Apache/2.4.41 (Ubuntu)', 'content-length': '90', 'x-openstack-request-id': 'req-036ef900-3e94-4821-9633-be79f88ceddc', 'connection': 'close', 'content-type': 'application/json', 'status': '500', 'content-location': 'http://10.35.64.8/dns/v2/quotas/81f5b609f64e40799aad57228c6bec6c'}
        Body: b'{"code": 500, "type": "unknown", "request_id": "req-036ef900-3e94-4821-9633-be79f88ceddc"}' _log_request_full /opt/stack/tempest/tempest/lib/common/rest_client.py:450

Expected result:
400 Bad Request with proper Error message.

Changed in designate:
status: New → Confirmed
importance: Undecided → Medium
Changed in designate:
assignee: nobody → Michael Johnson (johnsom)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/designate/+/842219

Changed in designate:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (master)

Reviewed: https://review.opendev.org/c/openstack/designate/+/842219
Committed: https://opendev.org/openstack/designate/commit/38178c079a1a66229f06becbd7b60a749879c4a6
Submitter: "Zuul (22348)"
Branch: master

commit 38178c079a1a66229f06becbd7b60a749879c4a6
Author: Michael Johnson <email address hidden>
Date: Tue May 17 19:37:55 2022 +0000

    Improve quota API validations

    This patch improves the quotas API validations and test coverage. Invalid quota settings will now be caught at the API/Central layer and not down in the storage layer(DB).

    Depends-On: https://review.opendev.org/c/openstack/designate-tempest-plugin/+/842238
    Closes-Bug: #1934596
    Change-Id: I474bdd988a6cc3a9bcce1b65c2f49216dd85addf

Changed in designate:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (stable/yoga)

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/designate/+/843177

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (stable/xena)

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/designate/+/843178

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/designate/+/843179

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/designate/+/843177
Committed: https://opendev.org/openstack/designate/commit/8f5e8db10082b83e1667e4e06f4c1f2a4a80d142
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 8f5e8db10082b83e1667e4e06f4c1f2a4a80d142
Author: Michael Johnson <email address hidden>
Date: Tue May 17 19:37:55 2022 +0000

    Improve quota API validations

    This patch improves the quotas API validations and test coverage. Invalid quota settings will now be caught at the API/Central layer and not down in the storage layer(DB).

    Closes-Bug: #1934596
    Change-Id: I474bdd988a6cc3a9bcce1b65c2f49216dd85addf
    (cherry picked from commit 38178c079a1a66229f06becbd7b60a749879c4a6)

tags: added: in-stable-yoga
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/designate/+/843179
Committed: https://opendev.org/openstack/designate/commit/2e55c3e24bfaf1b03241aa1a4a538d03c29d69ad
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 2e55c3e24bfaf1b03241aa1a4a538d03c29d69ad
Author: Michael Johnson <email address hidden>
Date: Tue May 17 19:37:55 2022 +0000

    Improve quota API validations

    This patch improves the quotas API validations and test coverage. Invalid quota settings will now be caught at the API/Central layer and not down in the storage layer(DB).

    Closes-Bug: #1934596
    Change-Id: I474bdd988a6cc3a9bcce1b65c2f49216dd85addf
    (cherry picked from commit 38178c079a1a66229f06becbd7b60a749879c4a6)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/designate/+/843178
Committed: https://opendev.org/openstack/designate/commit/28e969e7f1cfacb4932d9e36896207bf7a88bda0
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 28e969e7f1cfacb4932d9e36896207bf7a88bda0
Author: Michael Johnson <email address hidden>
Date: Tue May 17 19:37:55 2022 +0000

    Improve quota API validations

    This patch improves the quotas API validations and test coverage. Invalid quota settings will now be caught at the API/Central layer and not down in the storage layer(DB).

    Closes-Bug: #1934596
    Change-Id: I474bdd988a6cc3a9bcce1b65c2f49216dd85addf
    (cherry picked from commit 38178c079a1a66229f06becbd7b60a749879c4a6)

tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/designate 14.0.1

This issue was fixed in the openstack/designate 14.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/designate 13.0.1

This issue was fixed in the openstack/designate 13.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/designate 12.1.0

This issue was fixed in the openstack/designate 12.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/designate 15.0.0.0rc1

This issue was fixed in the openstack/designate 15.0.0.0rc1 release candidate.

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.