davetapley
davetapley

Reputation: 17968

Docker compose hangs on Ubuntu 18.04 after Ctrl+C

If I Ctrl+C immediately after running docker-compose run, then:

Intermittently it will hang, ultimately reporting:

ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.

And:

All subsequent docker-compose commands for that docker-compose.yml will do the same until I restart the host.

Upvotes: 1

Views: 1284

Answers (1)

davetapley
davetapley

Reputation: 17968

I have a remedy which at least avoids having to restart the host:

The container which failed to shutdown correctly is left in the Created state. So long as there is at least one container in this state, then the ERROR will occur.

Attempting to interact with Created containers (e.g. using docker rm) also results in the ERROR.

I have been able to remove them by:

  1. sudo service docker stop (which does succeed), then:
  2. Observe a dangling docker-containerd-shim process (as seen with a ps aux | grep docker) and kill it with a sudo kill -9.
  3. sudo service docker start (which does succeed), then:

  4. Remove the offending containers with:

    docker rm $(docker ps --all -q -f status=created)
    

Upvotes: 2

Related Questions