Found "filter,vnfInstanceSubscriptionFilter" parameter mandatory whern creating subscription

Bug #1947303 reported by YaoYudie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
Medium
Hiromu Asahina

Bug Description

When tacker server will return 500 error if reuqest body payload has no filter and vfnInstanceSubscriptionFilter parameter. However, according to the API reference, only callbackuri is required.

curl -v -i -X POST http://172.22.39.3:9890/vnflcm/v1/subscriptions -H "Accept: application/json" -H "Content-type: application/json" -H "X-Auth-Token:$OS_AUTH_TOKEN" --data '{ "filter":{ "notificationTypes" : ["VnfIdentifierCreationNotification"]},"callbackUri":"https://172.22.39.3/vnf/v1/vnf_instances/creation" }'
5:30
what I received is: {"title": "Internal Server Error", "status": 500, "detail": "The server has either erred or is incapable of performing the requested operation."}

error log:
2021-10-14 01:34:20.451 DEBUG tacker.wsgi [-] (23952) accepted ('172.22.39.3', 52788) from (pid=23952) server /usr/local/lib/python3.6/dist-packages/eventlet/wsgi.py:992
2021-10-14 01:34:20.704 INFO tacker.wsgi [req-518d4f17-1f1e-42cb-9223-56a0304997ea nfv nfv_user] POST http://172.22.39.3:9890/vnflcm/v1/subscriptions
2021-10-14 01:34:20.708 DEBUG tacker.api.vnflcm.v1.controller [req-518d4f17-1f1e-42cb-9223-56a0304997ea nfv nfv_user] filter {'notificationTypes': ['VnfIdentifierCreationNotification']} from (pid=23952) register_subscription /opt/stack/tacker/tacker/api/vnflcm/v1/controller.py:919
2021-10-14 01:34:20.709 DEBUG tacker.api.vnflcm.v1.controller [req-518d4f17-1f1e-42cb-9223-56a0304997ea nfv nfv_user] filter type <class 'dict'> from (pid=23952) register_subscription /opt/stack/tacker/tacker/api/vnflcm/v1/controller.py:923
2021-10-14 01:34:20.718 DEBUG tacker.objects.vnf_lcm_subscriptions [req-518d4f17-1f1e-42cb-9223-56a0304997ea nfv nfv_user] sql[select t1.id from vnf_lcm_subscriptions t1, (select subscription_uuid from vnf_lcm_filters where JSON_CONTAINS(notification_types, '["VnfIdentifierCreationNotification"]') and operation_states_len=0 and operation_types_len=0 ) t2 where t1.id=t2.subscription_uuid and t1.callback_uri= 'https://172.22.18.21/ecm_service/vnf/v1/vnf_instances/creation' and t1.deleted=0 ] from (pid=23952) _vnf_lcm_subscriptions_id_get /opt/stack/tacker/tacker/objects/vnf_lcm_subscriptions.py:284
2021-10-14 01:34:20.764 DEBUG tacker.wsgi [req-518d4f17-1f1e-42cb-9223-56a0304997ea nfv nfv_user] Returning 500 to user: The server has either erred or is incapable of performing the requested operation. from (pid=23952) __call__ /opt/stack/tacker/tacker/wsgi.py:1117
2021-10-14 01:34:20.766 INFO tacker.wsgi [req-518d4f17-1f1e-42cb-9223-56a0304997ea nfv nfv_user] 172.22.39.3 - - [14/Oct/2021 01:34:20] "POST /vnflcm/v1/subscriptions HTTP/1.1" 500 336 0.309061

Yasufumi Ogawa (yasufum)
Changed in tacker:
importance: Undecided → Medium
Changed in tacker:
assignee: nobody → Hiromu Asahina (h-asahina)
Changed in tacker:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

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

commit ccb0dd3d383a314a8bda62e2353aea6bdd805f80
Author: Hiromu Asahina <email address hidden>
Date: Fri Dec 10 11:06:02 2021 +0900

    Fix filter data creation

    The tacker-server returns 500 error if a request body of the
    subscription creation [1] that doesn't have
    `vnfInstanceSubscriptionFilter` parameter, although it's an optional
    parameter.

    The happens simply because the `vnfInstanceSubscriptionFilter` is not
    handled as an optional parameter in the current codes.

    This patch fixes such codes to correctly handle the request without a
    `vnfInstanceSubscriptionFilter` parameter.

    [1]:
    https://docs.openstack.org/api-ref/nfv-orchestration/v1/vnflcm.html?expanded=create-a-new-subscription-detail

    Change-Id: Ibf9310c4ddffcc41e23eea8c5dfd212fd3a9a145
    Closes-bug: #1947303

Changed in tacker:
status: In Progress → Fix Released
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.