I have an automated test that brings up a RabbitMQ container which occasionally fails because the container is stuck in ‘Created’ with no ports exposed. This can be reproduced, but not every time. Reproducing the failure relies on running a set of other tests on the same node simultaneously. However, I can’t see any obvious way for these tests to interact, in particular none of the other test are binding any ports or running docker/docker-compose themselves.
Example of a container that has failed to start:
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f02d11bfafa4 rabbitmq:3.6.12-management "docker-entrypoint.s…" 5 minutes ago Created e26c14fe39b511e9b9eb42010a030075_rabbitmq_1
Excerpt of docker-compose with the verbose flag set:
compose.cli.verbose_proxy.proxy_callable: docker create_container <- (name=u'49593b76306d11e9aedb42010a0300a2_rabbitmq_1', image='rabbitmq:3.6.12-management', labels={u'com.docker.compose.service': u'rabbitmq', u'com.docker.compose.config-hash': 'cd47649f3731353f99dc94303d03b7eff43fb767efc18dfd98918435cdfb99c6', u'com.docker.compose.project': u'49593b76306d11e9aedb42010a0300a2', u'com.docker.compose.version': u'1.23.2', u'com.docker.compose.oneoff': u'False', u'com.docker.compose.container-number': '1', 'www.example.com-rabbitmq_job_queue': 'port'}, host_config={'NetworkMode': u'49593b76306d11e9aedb42010a0300a2_default', 'Links': [], 'PortBindings': {'5672/tcp': [{'HostPort': '', 'HostIp': ''}]}, 'Binds': [], 'LogConfig': {'Type': u'', 'Config': {}}, 'VolumesFrom': []}, environment=[], volumes={}, detach=True, ports=[(u'5672', u'tcp')], networking_config={u'EndpointsConfig': {u'49593b76306d11e9aedb42010a0300a2_default': {u'IPAMConfig': {}, u'Aliases': ['rabbitmq']}}})
compose.parallel.feed_queue: Pending: set([])
compose.parallel.feed_queue: Pending: set([])
<snip>
compose.parallel.parallel_execute_iter: Failed: ServiceName(project='49593b76306d11e9aedb42010a0300a2', service='rabbitmq', number=1)
compose.parallel.feed_queue: Pending: set([])
ERROR: for 49593b76306d11e9aedb42010a0300a2_rabbitmq_1 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=120)
compose.parallel.parallel_execute_iter: Failed: <Service: rabbitmq>
Is there anyway to fix this issue or investigate further?