compose: Compose error "HTTP request took too long to complete"
Lately I’ve been noticing the following error message quite frequently with docker-compose up
:
ERROR: 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).
Increasing the COMPOSE_HTTP_TIMEOUT
only seems to delay the error. Is this a known issue and/or is there a workaround for this?
I’m using ubuntu 16.04, please find below the output of docker-compose version
and docker version
. I’d also like to note that I see this issue with docker for mac beta, docker-machine, etc.
$ docker-compose version
docker-compose version 1.7.1, build 6c29830
docker-py version: 1.8.1
CPython version: 2.7.11+
OpenSSL version: OpenSSL 1.0.2g-fips 1 Mar 2016
$ docker version
Client:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 22:00:43 2016
OS/Arch: linux/amd64
Server:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 22:00:43 2016
OS/Arch: linux/amd64
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 134
- Comments: 78
Links to this issue
Commits related to this issue
- Add note about viewing logs and debugging `docker-compose logs` quits randomly when tty is set to true: https://github.com/docker/compose/issues/3633 — committed to open-austin/influence-texas by tonysyu 7 years ago
- docker-compose hangs, try disabling color https://github.com/docker/compose/issues/3633#issuecomment-637367562 — committed to SolrNet/SolrNet by mausch 3 years ago
- docker-compose hangs, try disabling color https://github.com/docker/compose/issues/3633#issuecomment-637367562 — committed to SolrNet/SolrNet by mausch 3 years ago
- docker-compose hangs, try disabling color https://github.com/docker/compose/issues/3633#issuecomment-637367562 — committed to SolrNet/SolrNet by mausch 3 years ago
By simply restarting the docker service via
sudo service docker restart
I was able to get the aforementioned error to go away when runningdocker-compose up
.Note: I did not touch the
tty=true
parameter as suggested, as I wanted to avoid a quick fix.I get the same error message.
My docker-compose.yml file does not mention
tty
so this isn’t the problem for me.Increasing the timeout does nothing.
The only things that work for me are:
docker-compose
command. It will eventually work. I often need 2 retries, sometimes more.docker-compose
and it usually works.The fact that it takes so long for me to restart the docker daemon is interesting. Is docker doing something in the background that causes docker-compose to throw this error?
I am running:
UPDATE: I upgraded to docker version 1.12.5 but it did not help.
@aaronjensen I can confirm that removing the
tty: true
line from thedocker-compose.yaml
file resolved the issue for me. As a workaround for the tty, I definedTERM=xterm
to the containers environment. Do you see any issues with that?Encountered this fun bug on macOS - fixed with
docker-compose restart
followed by adocker-compose up
Restarting docker daemon did the trick. My env is MacOS 10.13.4
I faced the same problem and solved it by just restarting the docker services,
sudo service docker restart
after that i started the dockerdocker-compose up -d
and it works.The
docker-compose up
times out.To reproduce:
Flushing old docker images seems to fix this. So something like,
docker rmi $(docker images --quiet --filter "dangling=true")
After running this, I didn’t see the timeout error anymore (on Ubuntu anyway).
Is anything happening with this issue? We are seeing it all the time now and increasing the timeout doesn’t seem to work.
@sameersbn try disabling tty. I believe this is a dupe of https://github.com/docker/compose/issues/3106
still no real solution for this issue ?
(i’m on MAc OSX too)
The latest reports seem related to https://github.com/moby/moby/issues/35933
I’m going to close this as the thread is a hodgepodge of unrelated issues:
tty
issue that was fixed in 1.16.0: #3106docker system prune
might help free up some disk space / inodes if that’s the issue.docker-compose up
but might occur with other commands as well): currently being addressed at the engine level https://github.com/moby/moby/issues/35933 (my original assumption that this was a Mac OS specific problem was mistaken - sorry about that)If there’s anything that isn’t addressed by this list now or in the future with the same symptoms, please open a new thread.
Still have the same issue on 17.12
I’m having the same problem using appcontainers/wordpress recipe on OSX 10.11.6 running docker app 1.12.0-a with 2CPUs and 6Gb RAM. Loading process takes ages for every request.
Furthermore running:
I got this error:
Experiencing this issue. I’m running daemonised containers using the command
And then tailing the logs using
After about a min, I get the error
If I provide a huge value for
COMPOSE_HTTP_TIMEOUT
, like 10000, then it kind of works for that whole time. Guessing, not measuredI’m not sure the exactly how
COMPOSE_HTTP_TIMEOUT
is used, but guessing since its a timeout value, its used as any other timeout. Can’t we disable it by setting it to 0 (I have tried setting it to 0, doesn’t work)? Shouldn’t no timeout be the default?Versions
Docker
Docker Compose
Restarting docker daemon worked for me on MacOS as suggested by @WernerRaath 4 years ago!
I had a
docker-compose.yml
with a big port range being forwarded (20k ports) in one of my services. Then I got this error message. I fixed it by reducing the port range to just 300 ports, then it worked fine again.On Mac, what I did was going to the docker icon (upper right corner) and clicked restart, maybe is not the best solution, but it´s the fastest one
After several consultation of the topic (hoping there would be an out-of-the-box solution), I’m joining the conversation.
I experience the issue also. I never used the
tty: true
option (I’m not even clear of what it does). But as @shin- suggests, I can pretty much tell this is memory related:I’m working on a micro-serviced project and often have up to 4 compose process running at the same time on a not-so-powerful machine (4Gb RAM 😕).
Sometimes they’ll start without issue, sometimes I get the error. Individually they all work.
I really don’t have a solution here, only few comments and questions:
You may not have enough memory on your system
service docker restart
doesn’t help since this will take down all already running containersThanks, ❤️ docker & compose.
@shin- I’m seeing this issue as well, on a Mac. Versions:
My machine was not under high load, there is plenty of RAM, plenty of disk space, etc. My docker-compose file also doesn’t mention
tty
, but I was usingdocker-compose run
. IncreasingCOMPOSE_HTTP_TIMEOUT
only increased the time before it failed.After restarting the Docker daemon, it started working again.
I have the same issue, I have tried all the comments above but did not work for me. I finally use one of suggestion above, just restart the docker and resolved the issue.
Fixed Issue Thanks
Can anyone explain why does it work ^^
None of the suggestions here actually work for me.
docker restart hang without response:
I ran into this issue as well; have to sudo service docker restart to get docker commands to work again. I checked top but didn’t see cpu high usage etc.
No tty: true option in docker-compose.yml
I did notice my inode usage is quite high at 95%
Coincidentally I think there is some serious memory leak; not sure if it is with docker-compose itself but I notice my system memory usage was ~70% before and now it is at ~17% after restart.
Restarting docker solves it everytime too
Maybe try checking this out https://github.com/docker/compose/issues/4459. It mentions that the values need to be enclosed in quotes. Also here, https://docs.docker.com/compose/compose-file, the docker compose version 3 requires that all boolean values be enclosed in quotes. tty option is set to true or false.
Oh god! Why! the answer to everything is restart! BTW thanks 😃
I had this issue and it turns out that Docker had its “update ready, install now?” dialogue open. After updating Docker and then restarting Docker desktop, the issue went away.
@leovujanic Thanks. Using quotes solved the problem
I just started having this problem as well with docker-compose commands failing with HTTP request took too long. And I am not forwarding many ports.
EDIT: It appears that upgrading docker-compose to
docker-compose version 1.25.4, build 8d51620a
fixed the issue for me.This is still an issue after the reset to defaults. @shin- Since this doesn’t seem to be a compose issue, is there a good place to get this in front of the docker team? I’d love to help. At this point, my docker development workflows have ground to almost a halt with all the constant daemon restarting.
I started experiencing the same issue on OSX 10.13.2 (high sierra) after the update to docker 17.12.0-ce and compose 1.18.0. At this point, I’m able to issue
docker-compose up
once, maybe twice before all docker-compose commands (up, restart, run, exec) hang and exit with this error.docker-compose restart
has the same behavior. At this point, the only way I can rescue the situation is the restart docker completely.@shin- I’m sure there are multiple issues at play here. Last time, after restarting Docker for Mac, the issue went away, so I didn’t get a chance to test if the daemon was responsive.
I hadn’t seen the issue again until today. I am able to launch new containers using the regular
docker
command, but not throughdocker-compose
. All the circumstances I described previously are still true - the machine isn’t under heavy load, there’s plenty of memory (the Docker for Mac VM RAM usage is also much lower than its limit), etc.This probably is a docker engine issue, but it only seems to be manifesting through docker compose.
using TERM=xterm still produces exit code 0 when using docker-compose up
I’m running into the same issue frequently. Did you fix it?
BTW: I’m using Docker 1.11.2 and docker-compose 1.7.1