[Controlloop][CLAMP][Policy] - Policy Deployment status is 400 Bad request

Vidyashree Rama
 

Hi All,

Kindly help to resolve this issue

Issue: Policy deployment status is 400 Bad request
image.png
Analysis: When I deploy from CLAMP, the api to get the status of policy created seems to be incorrect. There is exception in policy API pod

CLAMP log: Please find the attachment for clamp logs
13:14:38.788 [https-jsse-nio-8443-exec-22] INFO  org.onap.clamp.flow.log.FlowLogOperation - INVOKE-SYNCHRONOUS{981f55f2-b4cc-4a3e-8d96-2a7b1b6383dd}
13:14:38.789 [https-jsse-nio-8443-exec-22] INFO  get-status-from-policy - Endpoint to query from Policy PDP: https4://policy-api.onap:6969/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/OPERATIONAL_ClampTest_v1_0_vFW_PG0_k8s-tca-clamp-policy-05162019/versions/deployed
13:14:38.789 [https-jsse-nio-8443-exec-22] DEBUG org.apache.camel.spring.SpringCamelContext - Loading component JSON Schema for: https4 using class resolver: org.apache.camel.impl.DefaultClassResolver@1b1f5012 -> org.springframework.boot.loader.jar.ZipInflaterInputStream@17cbcebd


Policy API log: 
[2019-07-25T13:14:38.843+00:00|ERROR|LegacyApiRestController|qtp872306601-23] GET /policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/OPERATIONAL_ClampTest_v1_0_vFW_PG0_k8s-tca-clamp-policy-05162019/versions/deployed
org.onap.policy.models.base.PfModelException: legacy policy version is not an integer
at org.onap.policy.api.main.rest.provider.LegacyOperationalPolicyProvider.validateLegacyOperationalPolicyVersion(LegacyOperationalPolicyProvider.java:138)
at org.onap.policy.api.main.rest.provider.LegacyOperationalPolicyProvider.fetchOperationalPolicy(LegacyOperationalPolicyProvider.java:70)
at org.onap.policy.api.main.rest.LegacyApiRestController.getSpecificVersionOfOperationalPolicy(LegacyApiRestController.java:439)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:867)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:513)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1588)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1557)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:502)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:411)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:305)
at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:159)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NumberFormatException: For input string: "deployed"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.valueOf(Integer.java:766)
at org.onap.policy.api.main.rest.provider.LegacyOperationalPolicyProvider.validateLegacyOperationalPolicyVersion(LegacyOperationalPolicyProvider.java:136)
... 61 common frames omitted

Drools Telemetry: Policy created successfully
https://localhost:9696/policy/pdp/engine/controllers/usecases/drools/facts/usecases> get
HTTP/1.1 200 OK
Content-Length: 124
Content-Type: application/json
Date: Thu, 25 Jul 2019 13:13:40 GMT
Server: Jetty(9.4.14.v20181114)

{
    "org.onap.policy.controlloop.params.ControlLoopParams": 1,
    "org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy": 1
}

https://localhost:9696/policy/pdp/engine/controllers/usecases/drools/facts/usecases> cd org.onap.policy.controlloop.params.ControlLoopParams
https://localhost:9696/policy/pdp/engine/controllers/usecases/drools/facts/usecases/org.onap.policy.controlloop.params.ControlLoopParams> get
HTTP/1.1 200 OK
Content-Length: 1087
Content-Type: application/json
Date: Thu, 25 Jul 2019 13:13:49 GMT
Server: Jetty(9.4.14.v20181114)

[
    {
        "closedLoopControlName": "LOOP_ClampTest_v1_0_vFW_PG0_k8s-tca-clamp-policy-05162019",
        "controlLoopYaml": "controlLoop%3A%0A++abatement%3A+false%0A++controlLoopName%3A+LOOP_ClampTest_v1_0_vFW_PG0_k8s-tca-clamp-policy-05162019%0A++timeout%3A+3600%0A++trigger_policy%3A+ModifyConfig%0Apolicies%3A%0A-+actor%3A+APPC%0A++failure%3A+final_failure%0A++failure_exception%3A+final_failure_exception%0A++failure_guard%3A+final_failure_guard%0A++failure_retries%3A+final_failure_retries%0A++failure_timeout%3A+final_failure_timeout%0A++id%3A+ModifyConfig%0A++payload%3A%0A++++streams%3A+%27%7B%22active-streams%22%3A5%7D%27%0A++recipe%3A+ModifyConfig%0A++retry%3A+2%0A++success%3A+final_success%0A++target%3A%0A++++modelCustomizationId%3A+%27%27%0A++++modelInvariantId%3A+%27%27%0A++++modelName%3A+%27%27%0A++++modelVersion%3A+%27%27%0A++++modelVersionId%3A+%27%27%0A++++resourceID%3A+vFW_PG%0A++++type%3A+VNF%0A++timeout%3A+1200%0A",
        "policyName": "OPERATIONAL_ClampTest_v1_0_vFW_PG0_k8s-tca-clamp-policy-05162019",
        "policyScope": "onap.policies.controlloop.Operational:1.0.0",
        "policyVersion": "1.0.0"
    }
]


Thanks,
Vidya

Join onap-discuss@lists.onap.org to automatically receive all group messages.