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
Reviewed: https:/ /review. opendev. org/c/openstack /tacker/ +/821357 /opendev. org/openstack/ tacker/ commit/ ccb0dd3d383a314 a8bda62e2353aea 6bdd805f80
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit ccb0dd3d383a314 a8bda62e2353aea 6bdd805f80
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 eSubscriptionFi lter` parameter, although it's an optional
subscription creation [1] that doesn't have
`vnfInstanc
parameter.
The happens simply because the `vnfInstanceSub scriptionFilter ` is not
handled as an optional parameter in the current codes.
This patch fixes such codes to correctly handle the request without a eSubscriptionFi lter` parameter.
`vnfInstanc
[1]: /docs.openstack .org/api- ref/nfv- orchestration/ v1/vnflcm. html?expanded= create- a-new-subscript ion-detail
https:/
Change-Id: Ibf9310c4ddffcc 41e23eea8c5dfd2 12fd3a9a145
Closes-bug: #1947303