-
Bug
-
Resolution: Done
-
Medium
-
Frankfurt Release
-
None
-
None
Overview
Fix varchar size for DATA_SOURCE column for CONFIGFILES table in the sdnctl database.
Currently, this column has a size setup to 25. Sometimes this value is to low, because for example when APPC wants to write the UUID as a DATA_SOURCE, the database will raise the error.
Example
To reproduce this behavior we can send the APPC Configure command from POSTMAN collection:
curl --location --request POST 'https://106.120.119.161:30230/restconf/operations/appc-provider-lcm:configure' \ --header 'Content-Type: text/plain' \ --data-raw '{ "input": { "common-header": { "timestamp": "2020-05-29T13:14:07.395Z", "api-ver": "2.00", "originator-id": "f8195148-80da-49c4-b9cf-03d3df1291c0", "request-id": "Postman", "sub-request-id": "Postman", "flags": { "mode": "NORMAL", "force": "TRUE", "ttl": 36000 } }, "action": "Configure", "action-identifiers": { "vnf-id": "2b818f9c-ca08-4e2e-93a9-ca7360603bd7" }, "payload": "{\"request-parameters\":{\"vnf-name\":\"x\",\"host-ip-address\":\"x.x.x.x\"},\"configuration-parameters\":{\"ne-id\":\"x\"}}" } }'
The originator-id is setup by Postma in the pre-request script (found in the wiki https://wiki.onap.org/display/DW/Testing+with+Postman):
var orginatorId = uuid.v4(); pm.globals.set("orginatorId", orginatorId);
Logs from karaf:
13:12:47.023 ERROR [appc-dispatcher-3] <dbhost> Failed to execute: INSERT INTO CONFIGFILES SET data_source = ? , service_instance_id = ? , action = ? , vnf_type = ? , vnfc_type = ? , vnf_id = ? , vnf_name = ? , vm_name = ? , file_category = ? , file_content = ? ; with arguments: [c818b271-be56-4eee-a203-758db7269b1d, , Configure, vCUNetconfServiceV2/vCUNetconfV2 0, , 2b818f9c-ca08-4e2e-93a9-ca7360603bd7, vCU_VNF_INSTANCE_2, null, config_data, {"ne-id":"111"}] java.sql.SQLDataException: (conn=82) Data too long for column 'DATA_SOURCE' at row 1