Setting up Connect Server on Docker Swarm

Hey - I'm trying to modify the docker-compose.yaml file provided in the article here for use with Docker Swarm.

As part of that, I'm struggling to get the two containers to communicate with one another - logs on both show messages like this:

 {"log_message":"(E) failed to connectEndpoint for discovered peer: failed to transport.CreateConnection: [transport-websocket] failed to Dial endpoint: dial tcp connect: connection refused","timestamp":"2021-04-14T20:46:55.395621668Z","level":1}

It's obviously something to do with network communication, but I can't quite figure out what. From the file, I wasn't clear what ports had to be available externally (i.e. exposed to other machines on the network invoking the Terraform/Vault/Ansible tools), and which ports needed to be advertised internally between the sync and api containers.

I can add my sample docker-compose file if that is a help?

1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Sync Type: Not Provided


  • Might be helpful to see the docket-compose file. I had deployed the containers on aws elastic beanstalk and only exposed the port 80 for api to a load balancer and was able to hit the api. I didn’t expose the sync container port.

  • James_1PJames_1P

    Team Member


    A little background on the two containers, they will use multicast discovery to find each other. The only port that needs to be exposed for Terraform/Ansible/Vault on the containers is 8080 (or whatever port you have configured with OP_HTTP_PORT) on connect-api.

    I am rusty on how networking works in Docker swarm but internally both containers listen on 8080 by default and need to be able to communicate over that port with each other.

  • After a little more investigation, it does seem more likely to be an issue with the specific network setup on my Docker Swarm node (a Synology NAS) - since the exact same docker-compose file is working elsewhere! Grrr. Will have to keep investigating.

  • James_1PJames_1P

    Team Member

    Thanks for the update. When you sort it out please share what was up so we can update our documentation to help others that run into this.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file