Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`docker-compose up` times out with UnixHTTPConnectionPool

In our Jenkins agents we are running about several (around 20) tests whose setup involves running docker-compose up for a "big" number of services/containers (around 14).

From time to time, I'll get the following error:

ERROR: for testdb-data  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60) An HTTP request took too long to complete. Retry with --verbose to obtain debug information. If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60). 

Haven't been able to reproduce this consistently. And I'm still trying to figure out whether or not there is a correlation with our agent's resources being at full use.

docker -v is 1.10.1 and docker-compose -v is 1.13.1.

Any ideas about what this may be related to?

like image 276
jleeothon Avatar asked Feb 14 '17 15:02

jleeothon


People also ask

Does docker compose exit?

The docker compose up command aggregates the output of each container (like docker compose logs --follow does). When the command exits, all containers are stopped. Running docker compose up --detach starts the containers in the background and leaves them running.

Do I need to run docker compose up every time?

There is an answer from docker docs. Typically, you want docker-compose up . Use up to start or restart all the services defined in a docker-compose. yml .

Do you need Dockerfiles with docker compose?

Docker compose uses the Dockerfile if you add the build command to your project's docker-compose. yml. Your Docker workflow should be to build a suitable Dockerfile for each image you wish to create, then use compose to assemble the images using the build command.

Is it possible to run multiple copies of a compose file on the same host?

Compose uses the project name to create unique identifiers for all of a project's containers and other resources. To run multiple copies of a project, set a custom project name using the -p command line option or the COMPOSE_PROJECT_NAME environment variable.


2 Answers

Restarting docker service:

sudo systemctl restart docker 

and setting DOCKER_CLIENT_TIMEOUT and COMPOSE_HTTP_TIMEOUT environment variables:

export DOCKER_CLIENT_TIMEOUT=120 export COMPOSE_HTTP_TIMEOUT=120 

are two workarounds for now. But the issues are still open in docker compose github:

https://github.com/docker/compose/issues/3927

https://github.com/docker/compose/issues/4486

https://github.com/docker/compose/issues/3834

like image 192
sajjadG Avatar answered Sep 28 '22 00:09

sajjadG


I had the same problem. It was solved after change the max-file size value from a number to a string.

Wrong config

logging:  options:        max-file: 10        max-size: 10m 

Correct config

logging:  options:        max-file: "10"        max-size: 10m 
like image 35
Yoruba Avatar answered Sep 28 '22 00:09

Yoruba