You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Initial port check fails with "object is not subscriptable" #157
The test worked yesterday. However, when I run the test first thing in the morning, I get this:
Pulling image google/cloud-sdk:latest
Container started: 3355b174d1
ERROR
...
File ".../lib/python3.7/site-packages/testcontainers/core/container.py", line 100, in get_exposed_port
mapped_port = self.get_docker_client().port(self._container.id, port)
File ".../lib/python3.7/site-packages/testcontainers/core/docker_client.py", line 44, in port
return self.client.api.port(container_id, port)[0]["HostPort"]
TypeError: 'NoneType' object is not subscriptable
However, if I run it again right away, it works. It looks like a timing issue related to Docker startup or something like that. Anything that can be done about this in docker_client.py? Like a None-check and a backoff/retry?
Activity
yakimka commentedon Mar 26, 2022
I am closing this issue. However, if this problem is still relevant, please open it again, but provide an example to reproduce the error.