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
could not translate host name "localnpipe" to address: Unknown host #108
venv\lib\site-packages\wrapt\wrappers.py:605: in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
venv\lib\site-packages\testcontainers\core\waiting_utils.py:46: in wrapper
raise TimeoutException(
E testcontainers.core.exceptions.TimeoutException: Wait time exceeded 120 sec.
E Method _connect, args () , kwargs {}.
E Exception (psycopg2.OperationalError) could not translate host name "localnpipe" to address: Unknown host
E
E (Background on this error at: http://sqlalche.me/e/e3q8)
Please help me out with this thing.
Reacted by Yurii Serhiichuk, Samanta Reinoso, Leon Cullens, Constantin, zztkm and JeroenBos
I am experiencing the same issue on Windows 10. If I subclass PostgresContainer like so then it works:
class X(PostgresContainer):
def get_connection_url(self):
return super().get_connection_url().replace('localnpipe', 'localhost')
with X('postgres:12.3') as pg:
print("HELLO")
engine = sqlalchemy.create_engine(pg.get_connection_url())
version, = engine.execute("select version()").fetchone()
print(version)
i.e. postgresql+psycopg2://test:test@localhost:32779/test does work as the URL.
Some quick Googling suggests there are issues with Windows 10 and Docker named pipes but I can't honestly say they are the ultimate cause of this issue.
Perhaps DockerClient.host() could be changed to return localhost if the host is Windows 10? Happy to submit a patch for that but again I am not 100% that is the "right" thing to do.
Reacted by Greg Leonard, Théo Vermersch, HinsterX, gatekeeper168, Sümeyye Nur, Yurii Serhiichuk, Stepan, Olivier Baudouin OURA, Marco Palmisano, Leon Cullens and 4 more
I am experiencing the same issue on Windows 10. If I subclass PostgresContainer like so then it works:
class X(PostgresContainer):
def get_connection_url(self):
return super().get_connection_url().replace('localnpipe', 'localhost')
with X('postgres:12.3') as pg:
print("HELLO")
engine = sqlalchemy.create_engine(pg.get_connection_url())
version, = engine.execute("select version()").fetchone()
print(version)
i.e. postgresql+psycopg2://test:test@localhost:32779/test does work as the URL.
Some quick Googling suggests there are issues with Windows 10 and Docker named pipes but I can't honestly say they are the ultimate cause of this issue.
Perhaps DockerClient.host() could be changed to return localhost if the host is Windows 10? Happy to submit a patch for that but again I am not 100% that is the "right" thing to do.
I am experiencing the same issue on Windows 10. If I subclass PostgresContainer like so then it works:
class X(PostgresContainer):
def get_connection_url(self):
return super().get_connection_url().replace('localnpipe', 'localhost')
with X('postgres:12.3') as pg:
print("HELLO")
engine = sqlalchemy.create_engine(pg.get_connection_url())
version, = engine.execute("select version()").fetchone()
print(version)
i.e. postgresql+psycopg2://test:test@localhost:32779/test does work as the URL.
Some quick Googling suggests there are issues with Windows 10 and Docker named pipes but I can't honestly say they are the ultimate cause of this issue.
Perhaps DockerClient.host() could be changed to return localhost if the host is Windows 10? Happy to submit a patch for that but again I am not 100% that is the "right" thing to do.
I also got an error running MysqlContainer on Windows because of the same error.
If you do not assign TC_HOST value to localhost, it seems to bring docker host information to localnpipe.
Why is the Docker client api adpaters information set to http+docker?
I think this happened for a different purpose, but I'm curious as to why.
it seems to bring docker host information to localnpipe. Why is the Docker client api adpaters information set to http+docker?
I think this happened for a different purpose, but I'm curious as to why.
raise EndpointConnectionError(endpoint_url=request.url, error=e)
E botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "http://localnpipe:49162/test-bucket"
Activity
tillahoffmann commentedon Jul 6, 2020
@arpost, do you know whether this issue is related to the fix you added in #100?
petedmarsh commentedon Jul 17, 2020
I am experiencing the same issue on Windows 10. If I subclass
PostgresContainerlike so then it works:i.e.
postgresql+psycopg2://test:test@localhost:32779/testdoes work as the URL.Some quick Googling suggests there are issues with Windows 10 and Docker named pipes but I can't honestly say they are the ultimate cause of this issue.
Perhaps
DockerClient.host()could be changed to returnlocalhostif the host is Windows 10? Happy to submit a patch for that but again I am not 100% that is the "right" thing to do.greg-el commentedon Jul 17, 2020
Workaround also confirmed working on arch linux.
arcann commentedon Jan 27, 2021
Another way to workaround the issue
marcrleonard commentedon Mar 18, 2021
This workaround works on Windows.
vinchauhan commentedon May 5, 2021
Any update on this issue ?
ujkim commentedon Aug 8, 2021
I also got an error running MysqlContainer on Windows because of the same error.
If you do not assign TC_HOST value to localhost, it seems to bring docker host information to localnpipe.
Why is the Docker client api adpaters information set to http+docker?
I think this happened for a different purpose, but I'm curious as to why.
bomzheg commentedon Jan 14, 2022
it defined in docker-py
https://github.com/docker/docker-py/blob/a48a5a9647761406d66e8271f19fab7fa0c5f582/docker/api/client.py#L168
but I don't understad why/
xSAVIKx commentedon Jul 30, 2022
FYI there's some movement in docker-py and a new beta is available already: https://github.com/docker/docker-py/releases/tag/6.0.0b1
It has a lot of fixes related to dependencies and better Windows support
fix work on windows only with docker testcontainers/testcontainers-py…
fix work on windows only with docker testcontainers/testcontainers-py…
dwwhitlock commentedon Apr 4, 2023
Same issue with localstack:
YouJiacheng commentedon May 9, 2023
You can try this workaround:
alexanderankin commentedon Jul 1, 2024
does this not fix it? https://github.com/testcontainers/testcontainers-python/pull/427/files