I’m working on pymssql where we are using docker-compose to spin up mssql and a python manylinux image to build and run tests. Some of the test use tcp to verify that different connection styles. To run the test locally I use the bridge driver in the docker-compose.yml and set the IP of the machines so that the test can run. The docker-compose.yml looks like:
I am now trying to use this with the local circleci cli tool and get the following error:
#!/bin/sh -eo pipefail
docker-compose up -d
Creating network "project_vpcbr" with driver "bridge"
ERROR: Pool overlaps with other one on this address space
Error: Exited with code 1
Step failed
Error: runner failed
Task failed
Yes the connection is made from the pymssql container to the sqlserver container. None of the services need to be reachable from outside of the container running docker compose and the two containers that are part of the compose setup.
Great. Just use the names then - Docker Compose adds network names to avoid having to hardwire IPs. As long as they are on the same virtual network, sqlserver will be reachable from pymssql, and vice-versa. My guess is that you can delete the networks section entirely, and remove the network entries from each service.
We use that (network names) to validate we can connect via hostname, but the CI/CD is for a Python package that others use to connect to SQL Server. Because of that one of the things we test in our code is that connection strings based on IP succeed not just hostname. Due to that we need to be able to have an IP for the sql server container to validate that tests for IP based connection strings succeed.
If there isn’t a static IP solution I can take that back to the team. This project has used IP based testing for years so I’m not sure the full scope of the IP based testing, but I can see and validate they are skipped when we can’t provide an IP address to the db conf file. It may be writing the DNS lookup in the container and having it write a new line into the conf file, but would only want to explore that if a static address isn’t an option.
Got it. I’ll give that a try. Since this worked locally with docker-compose but failed with the circleci local tool I wanted to open the issue and make sure this wasn’t something that just wasn’t supported with CircleCI. I’ll try the private ranges and look into some of the reports as you mentioned.
So I was able to resolve the network issue. I had to run docker-compose down, so that was an error on my end. Sorry about that, leaving this here in case anybody else does similar in the future. Once you mentioned this should work I started digging around for what could cause the issue on my end. The next thing I ran into was volumes which has plenty of post. I switched my executor to machine, but now I get this error:
#!/bin/bash -eo pipefail
mkdir -p /home/circleci/project && cp -r /tmp/_circleci_local_build_repo/. /home/circleci/project
cp: cannot stat '/tmp/_circleci_local_build_repo/.': No such file or directory
Error: Exited with code 1
Step failed
Error: runner failed
Task failed