500 server error occurred when entered a VNFID which does not exist (not UUID) in the filter condition, Since it is a value input error, it should give error 400.

Bug #1926632 reported by Navum Gupta
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
Medium
Navum Gupta

Bug Description

When executing GET /vnfpkgm/v1/vnf_packages?filter=(eq,id,abc) HTTP/1.1, 500 error code comes in output response since it is value input error it should give 400 error code.

<operation log>

User-Agent: curl/7.68.0
Accept: */*
Proxy-Connection: Keep-Alive
X-Auth-Token:
gAAAAABfvf7REg1vC06Ig4sD0IILTmEGaM7vfvgE_1bqcmpHhF4OgH-Dpuob7mrsHFs6zEE6sq2amE_B-VRHZoer2f1aGUS-9VS
ANiGm5-rt7mQg7FV-V_3ZwOiU2_vaRBw7y2DAACz3CDaO-DnK_jEcdR_vn8fZnqjRIATlbDpVi56CfvsZTdc
Mark bundle as not supporting multiuse

< HTTP/1.1 500 Internal Server Error
< Content-Type: application/json; charset=UTF-8
< Content-Length: 141
< X-Openstack-Request-Id: req-5862b26d-7a86-4eb5-81c7-09c4835627f7
< Date: Thu, 29 Apr 2021 15:32:26 GMT
<

```json {
"title": "Internal Server Error",
"detail": "(builtins.ValueError) Invalid format. It should be in UUID v4 format\n[SQL: SELECT vnf_packages.created_at AS
vnf_packages_created_at, vnf_packages.updated_at AS vnf_packages_updated_at, vnf_packages.deleted_at AS
vnf_packages_deleted_at, vnf_packages.deleted AS vnf_packages_deleted, vnf_packages.tenant_id AS vnf_packages_tenant_id,
vnf_packages.id AS vnf_packages_id, vnf_packages.onboarding_state AS vnf_packages_onboarding_state,
vnf_packages.operational_state AS vnf_packages_operational_state, vnf_packages.usage_state AS vnf_packages_usage_state,
vnf_packages.algorithm AS vnf_packages_algorithm, vnf_packages.hash AS vnf_packages_hash,
vnf_packages.location_glance_store AS vnf_packages_location_glance_store, vnf_packages.size AS vnf_packages_size,
vnf_packages_user_data_1.created_at AS vnf_packages_user_data_1_created_at, vnf_packages_user_data_1.updated_at AS
vnf_packages_user_data_1_updated_at, vnf_packages_user_data_1.deleted_at AS vnf_packages_user_data_1_deleted_at,
vnf_packages_user_data_1.deleted AS vnf_packages_user_data_1_deleted, vnf_packages_user_data_1.id AS
vnf_packages_user_data_1_id, vnf_packages_user_data_1.package_uuid AS vnf_packages_user_data_1_package_uuid,
vnf_packages_user_data_1.`key` AS vnf_packages_user_data_1_key, vnf_packages_user_data_1.value AS
vnf_packages_user_data_1_value \nFROM vnf_packages LEFT OUTER JOIN vnf_packages_user_data AS vnf_packages_user_data_1
ON vnf_packages.id = vnf_packages_user_data_1.package_uuid \nWHERE vnf_packages.deleted = %(deleted_1)s AND
vnf_packages.tenant_id = %(tenant_id_1)s AND vnf_packages.id = %(id_1)s]\n[parameters: [immutabledict({})]]",
"status": 500
}
```

Revision history for this message
Itsuro Oda (oda-g) wrote :

Please shorten the summary more. I seems the summary you wrote should be written in the text.

Navum Gupta (navum)
Changed in tacker:
assignee: nobody → Navum Gupta (navum)
Navum Gupta (navum)
summary: - In the current Tacker implementation, when entered a VNFID which does
- not exist (not UUID) in the filter condition, it gives error 500. 500
- error is a server error, and I think it should not appear very much.
- Since it is a value input error, it should give error 400.
+ 500 server error occurred when entered a VNFID which does not exist (not
+ UUID) in the filter condition, Since it is a value input error, it
+ should give error 400.
Navum Gupta (navum)
description: updated
Changed in tacker:
status: New → In Progress
Yasufumi Ogawa (yasufum)
Changed in tacker:
importance: Undecided → Medium
Revision history for this message
Yasufumi Ogawa (yasufum) wrote :

Hi navum, could I confirm about the status of your update because no changes on this page? Have you already posted a patch, or nothing done?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.opendev.org/c/openstack/tacker/+/807106
Committed: https://opendev.org/openstack/tacker/commit/7add03725937d6bc8ea7a975f868ea877fe7b5e2
Submitter: "Zuul (22348)"
Branch: master

commit 7add03725937d6bc8ea7a975f868ea877fe7b5e2
Author: Tsukasa Inoue <email address hidden>
Date: Tue Jun 8 12:12:21 2021 +0900

    Fix status code for invalid filter conditions

    The current tacker returns 500 Internal Server Error to requests with
    invalid filter conditions where a VNFID is not UUID. However, as the
    error is caused by a bad request, the status code should be 400.

    This bug occurs because data types of 'id' and 'vnfd_Id' in TackerObject
    are 'string' which don't match the data types in DB, i.e., UUID. In
    order to fix this bug, those data types in TackerObject are changed to
    'uuid'.

    Closes-Bug: 1924666
    Closes-Bug: 1926632
    Change-Id: I8decbb42d661a44c6c382cb1abbfc37d95084ffb

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tacker (master)

Change abandoned by "Yasufumi Ogawa <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/tacker/+/809953

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tacker (master)

Change abandoned by "Yasufumi Ogawa <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/tacker/+/809954

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tacker (stable/xena)

Change abandoned by "Yasufumi Ogawa <email address hidden>" on branch: stable/xena
Review: https://review.opendev.org/c/openstack/tacker/+/810075

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

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

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

Reviewed: https://review.opendev.org/c/openstack/tacker/+/810091
Committed: https://opendev.org/openstack/tacker/commit/993169b2326b9509d8908e87f5fd825790741fd3
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 993169b2326b9509d8908e87f5fd825790741fd3
Author: Tsukasa Inoue <email address hidden>
Date: Tue Jun 8 12:12:21 2021 +0900

    Fix status code for invalid filter conditions

    The current tacker returns 500 Internal Server Error to requests with
    invalid filter conditions where a VNFID is not UUID. However, as the
    error is caused by a bad request, the status code should be 400.

    This bug occurs because data types of 'id' and 'vnfd_Id' in TackerObject
    are 'string' which don't match the data types in DB, i.e., UUID. In
    order to fix this bug, those data types in TackerObject are changed to
    'uuid'.

    Closes-Bug: 1924666
    Closes-Bug: 1926632
    Change-Id: I8decbb42d661a44c6c382cb1abbfc37d95084ffb

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

This issue was fixed in the openstack/tacker 6.0.0.0rc2 release candidate.

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

This issue was fixed in the openstack/tacker 7.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.