Release Automation

  • 1.  Docker Action Issue: Not able to establish connection with Docker?

    Posted Jun 23, 2017 09:14 AM

    When I try to use Action Pack like Docker: Create an Image or Create a Container. I am getting following error:

    "There was an error trying to execute a REST Call Action: 'Docker Images - Create an image' for Action Pack: Connection refused (Connection refused)". Can anyone help?

     

    Also, how can you let me know how to identify from logs that what process is being executed by CARA as it is having only these details

     

    2017-06-23 13:20:10,178 [Communication Msg Processor-159] DEBUG (com.nolio.platform.shared.datamodel.Action:463) - Submitting Action null(__sub_final___flow_Test Server Type):StepResultEvaluator for flow execution.
    2017-06-23 13:20:10,212 [job-65654-jobServer-65654-8:null(__sub_final___flow_Test Server Type):StepResultEvaluator] DEBUG (com.nolio.platform.shared.parameter.InParameterPlaceHolder:170) - PlaceHolder for field [evaluationResult] got value [Step Result: false - There was an error trying to execute a REST Call Action: 'Docker Containers - Create a container' for Action Pack: Connection refused (Connection refused)]



  • 2.  Re: Docker Action Issue: Not able to establish connection with Docker?

    Broadcom Employee
    Posted Jun 23, 2017 10:16 AM

    Hello Ashish,

     

    It appears that the "Create Container" action was designed with the ability to communicate with a remote docker host. That is why it has the Server and Port field. In order to get it working I found that I needed to modify my systemctl docker daemon startup script (/usr/lib/systemd/system/docker.service) from: ExecStart=/usr/bin/dockerd

     

    To: ExecStart=/usr/bin/dockerd -H tcp://127.0.0.1:2375

     

    I'm not suggesting that this is the best way to go about configuring your docker host (via the file or with 127.0.01). But it was sufficient to test the create container action that I ran on a machine that had both the RA Agent and Docker daemon.

     

    I also found that the image that you're specifying in the action must already be on the local docker host where you're trying to start the container. It will not download the image like 'docker run' does. 

     

    I hope this helps.

     

    Regards,

    Gregg



  • 3.  Re: Docker Action Issue: Not able to establish connection with Docker?

    Posted Jun 26, 2017 03:05 AM

    Hi Gregg

     

    Thanks for your response. I performed the changes as you suggested and restarted the docker service but same issue is still occurring.

     

    Getting error : - There was an error trying to execute a REST Call Action: 'Docker Containers - Create a container' for Action Pack: Connection refused (Connection refused)

     

    Below screenshot to show the docker service running after the changes you suggested.



  • 4.  Re: Docker Action Issue: Not able to establish connection with Docker?
    Best Answer

    Broadcom Employee
    Posted Jun 26, 2017 12:40 PM

    Hello,

     

    Can you confirm the entries that you're using as input to the action? I'm asking this for two reasons:

    1. based on configuring the service to start with 127.0.0.1, I've had to configure my action to either use 127.0.0.1 or localhost (since my hosts file on the agent/dockerHost resolves localhost to 127.0.0.1) for it to work successfully. If I try using the machines hostname then it will return this message. 

    2. After fixing the "Server" field to use 127.0.0.1 I began getting a different error: server error. If I looked in nolio_all.log I found that it was returning: 

    Caught exception during JsonPath matching com.jayway.jsonpath.PathNotFoundException: No results for path: $['Id']

     

    To track down the $['Id'] error I had to tail -f /var/log/messages. 

    This showed me that docker was seemingly responding with:

    level=error msg="Handler for POST /containers/create returned error: invalid environment variable: "

     

    This wasn't resolved until I added an environment variable and value into the "Env" field of my action. For example: var1=test

     

    Also, from what I can tell you can only set 1 environment variable via the Env field of that specific action. 

     

    Kind regards,

    Gregg



  • 5.  Re: Docker Action Issue: Not able to establish connection with Docker?

    Posted Jun 27, 2017 02:21 AM

    Hi Gregg

     

    Thanks for your help. I am able to create docker image now by changing the server to 127.0.0.1 in my action.

     Thanks much :-)