1
0
-1

Policy pap docker has some trouble with the policy push commands to pdp with curl:


root@ecomp-vm1-policy:/opt/policy# curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
>   "pdpGroup": "default",
>   "policyName": "com.BRMSParamvFWDemoPolicy",
>   "policyType": "BRMS_Param"
> }' 'http://pdp:8081/pdp/api/pushPolicy'
* Hostname was NOT found in DNS cache


inside of the pap coontainer:

pushPolicy : PUT : com.vFirewall
* Hostname was NOT found in DNS cache
*   Trying <proxy_ip>...
* Connected to <proxy_ip> (<proxy_ip>) port 8080 (#0)
> PUT http://pdp:8081/pdp/api/pushPolicy HTTP/1.1
> User-Agent: curl/7.35.0
> Host: pdp:8081
> Proxy-Connection: Keep-Alive
> Content-Type: application/json
> Accept: text/plain
> ClientAuth: cHl0aG9uOnRlc3Q=
> Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==
> Environment: TEST
> Content-Length: 92
>
* upload completely sent off: 92 out of 92 bytes
< HTTP/1.1 504 Gateway Timeout
< Content-Length: 2695

do you have any suggestion to solve this? how should the policy-pap container resolve the pdp name, in PUT request?

 PUT http://pdp:8081/pdp/api/pushPolicy HTTP/1.1


thanks,

Attila

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Attila Jány

      looks like you are trying to do curl from policy VM to PDP not from inside pap container. It should be straightforward since policy containers use docker network model. 

      try connecting port 8081 using telnet or nc commands. If you are trying from host VM, then make sure proxy is unset and /etc/hosts is update with pdp entry


      Sample logs from PDP:

      Transaction ID: 14eed7f4-d1b9-4e21-84c8-0103e8ecd146 --Policy 'com.Config_BRMS_Param_BRMSParamvLBDemoPolicy.1.xml' was successfully pushed to the PDP group 'default'.pushPolicy : PUT : com.BRMSParamvFWDemoPolicy
      * Hostname was NOT found in DNS cache
      * Trying 172.18.0.7...
      * Connected to pdp (172.18.0.7) port 8081 (#0)
      > PUT /pdp/api/pushPolicy HTTP/1.1
      > User-Agent: curl/7.35.0
      > Host: pdp:8081
      > Content-Type: application/json
      > Accept: text/plain
      > ClientAuth: cHl0aG9uOnRlc3Q=
      > Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==
      > Environment: TEST
      > Content-Length: 103
      >
      } [data not shown]
      * upload completely sent off: 103 out of 103 bytes
      < HTTP/1.1 200 OK
      * Server Apache-Coyote/1.1 is not blacklisted
      < Server: Apache-Coyote/1.1
      < Content-Type: text/plain;charset=ISO-8859-1
      < Content-Length: 166
      < Date: Thu, 07 Sep 2017 13:52:12 GMT
      <
      { [data not shown]
      * Connection #0 to host pdp left intact



      1. Attila Jány

        hi, yes it is true that I tried also from host vm but I also tried it from the pap.

        both is failing:

        when I replace the pdp to localhost and run it on host vm it is working.

        When I run it on pap then it is not resolved and send requests the http_proxy server

        the second log is from the pap container.

        inside of the pap coontainer:

        pushPolicy : PUT : com.vFirewall
        * Hostname was NOT found in DNS cache
        *   Trying <proxy_ip>...
        * Connected to <proxy_ip> (<proxy_ip>) port 8080 (#0)
        > PUT http://pdp:8081/pdp/api/pushPolicy HTTP/1.1
        > User-Agent: curl/7.35.0
        > Host: pdp:8081
        > Proxy-Connection: Keep-Alive
        > Content-Type: application/json
        > Accept: text/plain
        > ClientAuth: cHl0aG9uOnRlc3Q=
        > Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==
        > Environment: TEST
        > Content-Length: 92
        >
        * upload completely sent off: 92 out of 92 bytes
        < HTTP/1.1 504 Gateway Timeout
        < Content-Length: 2695

        do you have any suggestion to solve this? how should the policy-pap container resolve the pdp name, in PUT request?

         PUT http://pdp:8081/pdp/api/pushPolicy HTTP/1.1


        Should I remove the proxy setting from the pap after the installation is up and running?

        I will try it

      2. Attila Jány

        ok proxy removal (after installation) from pap container solved the problem!

        * Connection #0 to host pdp left intact

        Transaction ID: 66315692-b311-4a96-b3b8-ffb95fb1baa3 --Policy 'com.Config_BRMS_Param_BRMSParamvLBDemoPolicy.1.xml' was successfully pushed to the PDP group 'default'.pushPolicy : PUT : com.BRMSParamvFWDemoPolicy

        * Hostname was NOT found in DNS cache

        *   Trying 172.18.0.6...

        * Connected to pdp (172.18.0.6) port 8081 (#0)

        > PUT /pdp/api/pushPolicy HTTP/1.1

        > User-Agent: curl/7.35.0

        > Host: pdp:8081

        > Content-Type: application/json

        > Accept: text/plain

        > ClientAuth: cHl0aG9uOnRlc3Q=

        > Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==

        > Environment: TEST

        > Content-Length: 103



      CommentAdd your comment...