Docker Compose Aura Web: Startup is slow and fails due to PostgreSQL container not reachable
When trying to initialize the Aura Web Docker Compose (locally, without HTTPS) with:
docker-compose run --rm steering ./run.sh init-db
the step fails due to following errors:
CommandError: Could not create an OpenID connect client due to the following error: (<class 'django.db.utils.OperationalError'>, OperationalError('connection to server at "steering-postgres" (172.22.0.2), port 5432 failed: Connection timed out\n\tIs the server running on that host and accepting TCP/IP connections?\n'), <traceback object at 0x7ff02455c7c0>)
...
Something goes wrong: connection to server at "steering-postgres" (172.22.0.2), port 5432 failed: Connection timed out
Is the server running on that host and accepting TCP/IP connections?
After that, also a shutdown doesn't work:
meta/docker-compose/aura-web$ sudo docker-compose down
...
Stopping steering-postgres ... error
ERROR: for steering-postgres cannot stop container: f9344b8a0e1cea1b4133d00d1a9232cb726fc8c8a776db56e04712a884c05742: permission denied
Removing network aura-web_internal-steering
ERROR: error while removing network: network aura-web_internal-steering id 686c8dfca54ab8627b4f6e49669b85b3b7805f3e5743eb052ab3a05444a411ec has active endpoints
When analysing what the reason for the failed shutdown is:
docker network inspect --format '{{range $cid,$v := .Containers}}{{printf "%s: %s\n" $cid $v.Name}}{{end}}' 686c8dfca54a
f9344b8a0e1cea1b4133d00d1a9232cb726fc8c8a776db56e04712a884c05742: steering-postgres
it turned out it was because of Steering, which in turn also is not able to shutdown:
sudo docker stop steering-postgres
Error response from daemon: cannot stop container: steering-postgres: permission denied