docker / compose

Define and run multi-container applications with Docker
https://docs.docker.com/compose/
Apache License 2.0
33.87k stars 5.21k forks source link

UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60) #3927

Closed boda-sh closed 1 year ago

boda-sh commented 8 years ago

Hi since yesterday I've been running into this error while doing docker-compose up

Full Error Message

Device-Tracker $ docker-compose up
Creating device-tracker-db
Creating device-tracker

ERROR: for web  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose/cli/main.py", line 61, in main
  File "compose/cli/main.py", line 113, in perform_command
  File "contextlib.py", line 35, in __exit__
  File "compose/cli/errors.py", line 56, in handle_connection_errors
TypeError: log_timeout_error() takes exactly 1 argument (0 given)
docker-compose returned -1

Docker Version Docker for Mac: 1.12.0-a (Build 11213) Machine info MacBook Air (13-inch, Early 2015) Processor: 1.6 GHz i5 Memory: 4GB 1600 MHz DDR3 macOS: Version 10.11.6 (Build 15G1004)

Attempts

roboticflamingo commented 2 years ago

Still experiencing this issue on MacOS BigSur 11.6.2 with:

Docker Desktop 4.5.0 (74594)
Engine: 20.10.12
Compose: 1.29.2

Check that you are not running docker run when you want docker exec... I had this issue when I was using a docker-compose run on an already started container (among others) in Ubuntu 20.04 on a mac VM. WSL2 + ubuntu doesnt have these issues.

ebram96 commented 2 years ago

That's sad.. Restarting docker solves it.. But, restarting docker every few some minutes is a pain.

ilivestrong commented 2 years ago

Restarting docker desktop worked for me, thank you for suggestion.

lacriment commented 2 years ago

Having this issue "sometimes" on EC2 instance when trying to deploy with Gitlab Runner. Any help?

Tempest82 commented 2 years ago

I had this issue as well and it was actually due to logging (in my case AWS CloudWatch) not being able to start up and connect to the proper servers due to a network security issue.

First I extended my timeouts to 3 minutes (two just wasn't enough)

export DOCKER_CLIENT_TIMEOUT=180
export COMPOSE_HTTP_TIMEOUT=180

Then I got the failed to initialize logging driver: failed to create Cloudwatch log stream: RequestError: send request failed caused by: {{AWS URL and IP here}}: i/o timeout Resolving the real issue resulted in everything working again. I hope in the future if the logging fails to start up it can be a better error than standard i/o timeout. You can add the longer timeouts to your service file to keep the longer startup times. https://github.com/docker/compose/issues/3927#issuecomment-939477682

mutiev commented 2 years ago

Have same problem with airflow initiating in docker.

airflow-init_1 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out.

docker restart solve problem

Jafner commented 1 year ago

This is the error I got when some of the containers in a compose stack were dependent on a network share that was not mounted.

My NAS was offline and when I tried to docker-compose up any stacks with NAS-dependent containers, they would time out.

Just had to bring my NAS back online.

scippacercola commented 1 year ago

In my case it was an anonymous volume to cause the problem:

volumes:
      - /usr/src/app

I had to bind the folder to a local directory.

tan-yong-sheng commented 1 year ago

Faced the same problem:

My github repo I wish to use Binder is https://github.com/tys203831/portfolio_analysis


Removing intermediate container 60b0dfe441eb
 ---> 390c5bbcebc0
{"aux": {"ID": "sha256:390c5bbcebc04842eef6c909e77c4bb16ad9965557724aedb38f32dbaecf3044"}}Successfully built 390c5bbcebc0
Successfully tagged gesiscss/binder-r2d-g5b5b759-tys203831-2dportfolio-5fanalysis-63d906:78e3d7b82dfe345bcb4c98620cbfbd88b53a2c00
Error during build: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out.```
knight174 commented 1 year ago

+1, docker restart solve the problem

ndeloof commented 1 year ago

I'm closing this issue as obsolete: Docker Compose V1 has reached end-of-life and we are not accepting any more changes. Please try and reproduce your issue with Compose V2 and create a new issue or PR with the relevant Compose V2 information.

patsevanton commented 11 months ago

to summarize, how to fix this issue?

glours commented 11 months ago

@patsevanton If you still have the issue with a recent version of Compose v2, open a new issue with a example to reproduce it