Hi,

Thanks Anael, Xue for checking on that issue.


Br,


Adam Krysiak
Software Engineer
MN MANO RD&Pz ONAP-UI-ML DEVOPS WRO 2 SG
Nokia
Contact number: +48691441316
________________________________
From: Closson, Anael <[email protected]>
Sent: Thursday, July 19, 2018 11:56:41 AM
To: [email protected]; Krysiak, Adam (Nokia - PL/Wroclaw)
Subject: RE: [onap-discuss][clamp][policy] Error during closed loop resubmit


Hello Adan,



Xue did some tests on SB07 to verify the expected behavior. According to her, 
there’s a gap between the expected Policy reply and the actual one (see below).

There might be either an issue with Policy, either a configuration one or a 
bug. We think the latter, but the Policy team is better suited to answer that 
question.



FYI :



Expected one :

============



root@mywebserver:/home/xg353y/git/clamp-lf# curl -i -v -H 'Content-Type: 
application/json' -H 'Accept: application/json' --header 'ClientAuth: 
cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' -H 
'Environment: TEST' -X POST -d '{ "policyName": 
"ClampTest_v1_0.Config_MS_ClosedLoop_test6.1.xml" }' 
http://policy.api.simpledemo.onap.org:8081/pdp/api/getConfig
Hostname was NOT found in DNS cache
Trying 10.12.5.157...
Connected to 
policy.api.simpledemo.onap.org<http://policy.api.simpledemo.onap.org> 
(10.12.5.157) port 8081 (#0)
> POST /pdp/api/getConfig HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 
> policy.api.simpledemo.onap.org:8081<http://policy.api.simpledemo.onap.org:8081>
> Content-Type: application/json
> Accept: application/json
> ClientAuth: cHl0aG9uOnRlc3Q=
> Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==
> Environment: TEST
> Content-Length: 67
>
upload completely sent off: 67 out of 67 bytes
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
Server: Apache-Coyote/1.1
< Content-Type: application/json;charset=UTF-8
Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
< Date: Tue, 17 Apr 2018 15:31:25 GMT
Date: Tue, 17 Apr 2018 15:31:25 GMT

<
[{"policyConfigMessage":"Config Retrieved! 
","policyConfigStatus":"CONFIG_RETRIEVED","type":"JSON","config":"{\"service\":\"tca_policy\",\"version\":\"1.1.0\",\"location\":\"SampleServiceLocation\",\"configName\":\"SampleConfigName\",\"uuid\":\"test\",\"policyScope\":\"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=com.v1.0.ClosedLoop_test6\",\"templateVersion\":\"OpenSource.version.1\",\"policyName\":\"ClampTest_v1_0.ClosedLoop_test6\",\"description\":\"MicroService
 vCPE 
Policy\",\"priority\":\"1\",\"riskType\":\"SampleRiskType\",\"riskLevel\":\"1\",\"guard\":\"False\",\"content\":{\"tca_policy\":{\"domain\":\"measurementsForVfScaling\",\"metricsPerEventName\":[{\"eventName\":\"vCPEvGMUXPacketLoss\",\"controlLoopSchemaType\":\"VM\",\"policyScope\":\"DCAE\",\"policyName\":\"ClampTest_v1_0.ClosedLoop_test6\",\"policyVersion\":\"1\",\"thresholds\":[{\"closedLoopControlName\":\"ClosedLoop-test5_null\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingField
 Connection #0 to host 
policy.api.simpledemo.onap.org<http://policy.api.simpledemo.onap.org> left 
intact
s.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated\",\"thresholdValue\":200,\"direction\":\"GREATER\",\"severity\":\"MAJOR\",\"closedLoopEventStatus\":\"ONSET\"}]}]}}}","policyName":"ClampTest_v1_0.Config_MS_ClosedLoop_test6.1.xml","policyType":"MicroService","policyVersion":"1","matchingConditions":{"ONAPName":"DCAE","ConfigName":"SampleConfigName","service":"tca_policy","uuid":"test","Location":"SampleServiceLocation"},"responseAttributes":{},"property":null}]





Actual one (SB07):

===============

root@clamp:/home/xg353y/git/clamp-codecloud# curl -i -v -H 'Content-Type: 
application/json' -H 'Accept: application/json' --header 'ClientAuth: 
cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' -H 
'Environment: TEST' -X POST -d '{ "policyName": " 
HPATest.Config_OOF_PolicyHPA3.xml" }' 
http://policy.api.simpledemo.onap.org:8081/pdp/api/getConfig
Hostname was NOT found in DNS cache
Trying 10.12.5.157...
Connected to 
policy.api.simpledemo.onap.org<http://policy.api.simpledemo.onap.org> 
(10.12.5.157) port 8081 (#0)
> POST /pdp/api/getConfig HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 
> policy.api.simpledemo.onap.org:8081<http://policy.api.simpledemo.onap.org:8081>
> Content-Type: application/json
> Accept: application/json
> ClientAuth: cHl0aG9uOnRlc3Q=
> Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==
> Environment: TEST
> Content-Length: 54
>
upload completely sent off: 54 out of 54 bytes
< HTTP/1.1 400 Bad Request
HTTP/1.1 400 Bad Request
Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
Server: Apache-Coyote/1.1
< Content-Type: application/json;charset=UTF-8
Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
Transfer-Encoding: chunked
< Date: Thu, 19 Jul 2018 09:43:04 GMT
Date: Thu, 19 Jul 2018 09:43:04 GMT
< Connection: close
Connection: close
<
Closing connection 0
[{"policyConfigMessage":"PE300 - Data Issue: Incorrect Params passed: Decision 
not a 
Permit.","policyConfigStatus":"CONFIG_NOT_FOUND","type":null,"config":null,"policyName":null,"policyType":null,"policyVersion":null,"matchingConditions":null,"responseAttributes":null,"property":null}]









From: [email protected] <[email protected]> On Behalf Of 
Krysiak, Adam (Nokia - PL/Wroclaw)
Sent: jeudi 19 juillet 2018 10:41
To: [email protected]
Subject: [onap-discuss][clamp][policy] Error during closed loop resubmit



Hi,



I've found weird behavior during resubmitting Policy from CLAMP.

During 'resubmit' CLAMP first checks if policy exists to know if it should be 
created or updated.

>From logs I see that during check response is that it's new policy.

But when clamp tries to create it the response is that policy already exists.

Also in logs there is an info about bad request when checking policy.



Data Issue: :400:[{"policyConfigMessage":"PE300 - Data Issue: Incorrect Params 
passed: Decision not a 
Permit.","policyConfigStatus":"CONFIG_NOT_FOUND","type":null,"config":null,"policyName":null,"policyType":null,"policyVersion":null,"matchingConditions":null,"responseAttributes":null,"property":null}]
At least that's what logs are saying.



I've quickly debugged it and it looks like CLAMP sends request with body:

{"policyName":"test_policy_error.Config_MS_ClosedLoop_3cb6b3ad_8b2a_11e8_b055_0242ac120003_TCA_0owl1kv","onapName":null,"configName":null,"configAttributes":null,"requestID":null,"unique":false,"ecompName":null}



In exception from Policy policyName param is null but clamp is sending it.

It looks like some simple serialization issue on Policy side.

I've attached logs to this email.

Can anyone take a look and tell if it happens only on my environment because of 
some misconfiguration or is it a bug and jira needs to be created?





Adam Krysiak
Software Engineer
MN MANO RD&Pz ONAP-UI-ML DEVOPS WRO 2 SG
Nokia
Contact number: +48691441316



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11306): https://lists.onap.org/g/onap-discuss/message/11306
Mute This Topic: https://lists.onap.org/mt/23742883/21656
Group Owner: [email protected]
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to