-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StartAsync() hangs when using Windows with wsl2 container #58
Comments
Note: a colleague tried with more or less the same env, but it works as expected, so it's probably an issue with my env... |
Ok, the issue seem to be caused by port exclusion. I have a lot of TCP port excluded on my machine and it seem that the mapped port is chosen in this range
When tried, the chosen mapped port was 49173, which is in an excluded range. The strange thing is that if I try to map this port when starting a docker image with the CLI, I have an exception and the container cannot start. So I don't know how docker.dotnet manage to start it |
What is happening is that your MsSql container dies after being started. You suspicion is probably correct to say that maybe the exposed port is blocked. What you can do is this:
from the logs, you might find why the container is dead |
The problem is that the container does not die in fact. For example for ryuk it starts, The log is something like 'Waiting for connexion on port 8080'
And finally, the test container timeouts because the mapped port is not reachable. I haven't found how the random(?) mapped port is chosen. Is it done by testcontainers or by docker.dotnet? |
Oh you mean TestContainers timeout when waiting to connect to ryku! The random port is not selected by TestContainer or Docker.Dotnet. The docker engine maps 8080 to a random port in the higher port range (> 32000). Now, I'm not sure how the docker engine does it, but my guess is to map it to port 0 and let the OS pick a port in the high port ranges. |
Ok, so lot of people have the same problem docker/for-win#3171 (comment) / docker/for-win#11584 Do you know if it is possible to define a port explicitly, to workaround this issue? |
Unfortunately, there isn't currently a way to map it. You can, however, disable the reaper for now |
Yes, but I have the same problem with the SQL container, it also takes an excluded port and TestContainers timeouts when trying to connect. But I've seen that the port binding is configurable for the DB, so everything is ok :) |
Hi,
I try to use TestContainers.Container.Database.MsSql on a Windows system with DockerDesktop running with wsl2 engine.
When calling
StartAsync
the call blocks then times out. The container is started, but it seems that the application still wait for something that does not happen.Sometimes I have a timeout, sometimes I have an exception saying that the container is not found
with docker ps, I see the container
First, I thought that it was an issue with ryuk, so I tried to disable it via
REAPER_DISABLED
env variable, but same thing happens with the mssql server containerI also tried to update to the last version of
Docker.DotNet
but I still have the same problemMy env is
Windows 10 pro 21H1
Docker desktop 4.0.1
.Net 5.0.40
TestContainers.Container.Database.MsSql 1.5.0
Docker.DotNet 3.125.5
The container configuration is
Edit: the logs say that the container has started
The text was updated successfully, but these errors were encountered: