Home >Backend Development >Golang >Why Does 'docker-compose up' Time Out with UnixHTTPConnectionPool?

Why Does 'docker-compose up' Time Out with UnixHTTPConnectionPool?

DDD
DDDOriginal
2024-11-15 17:10:03832browse

Why Does

"docker-compose up" Times Out with UnixHTTPConnectionPool

When executing docker-compose up, particularly for a substantial number of services/containers, users may encounter 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).

Possible Solutions:

To resolve this issue and facilitate successful execution of docker-compose up, consider implementing the following workarounds:

  • Restart the docker service: Executing the command sudo systemctl restart docker can alleviate the issue.
  • Set environment variables: Configure two environment variables to extend the timeout period:
export DOCKER_CLIENT_TIMEOUT=120
export COMPOSE_HTTP_TIMEOUT=120

Note that these workarounds do not permanently resolve the issue. For further insights, refer to the related threads on GitHub:

  • https://github.com/docker/compose/issues/3927
  • https://github.com/docker/compose/issues/4486
  • https://github.com/docker/compose/issues/3834

The above is the detailed content of Why Does 'docker-compose up' Time Out with UnixHTTPConnectionPool?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn