-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Multiple stop and starts results in a docker exception when port is exposed #1532
Comments
One of the reasons why we strongly advise agains fixed ports is issue like this one. I think the reason why it works when you move it to The best I can suggest is to not use the fixed ports 🤷♂️ |
Hm, I also tried it with a 5 second sleep. Doesn't help. True, I also prefer random ports, but currently I create an integration test which restarts rabbitmq a couple of times to see if the application can handle outages. Therefore the port should not change after the restart. |
Have you tried https://www.testcontainers.org/modules/toxiproxy/ ? |
C'mon. This is exactly what was looking for. Nice tool! My problem is solved by this tool. So for me it's good enough, but I guess the problem somehow is still there (isn't it)? |
@guenhter we're of course happy to receive any help! Your help with at least the investigation would help a lot 👍 |
Tell you what. I am closing this for now and if I find something, I'll repoen it for discussion. |
@guenhter ok, thanks for reporting 👍 Happy that your use case is unblocked, one way or another :) |
I would be willing to provide a code-fix for this. Could you pleas reopen this issue? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this. |
This issue has been automatically closed due to inactivity. We apologise if this is still an active problem for you, and would ask you to re-open the issue if this is the case. |
It looks to me like this can also happen if the container fails to launch the first time. The port problem is encountered during the retry. For example, if using |
Hi,
when I create a container with a fixed exposed port and call
start
+stop
multiple times, I get an error. First things first. Here is the container for my tests (I know there is a dedicated Nginx TestContainer but this is just to reproduce the problem and Nginx is easy to use):and here the function using the container:
When I run this, the first iteration is ok, but in the second one I get this root cause:
I thought It might be a docker issue but then just tried out this:
And this works.
But shouldn't the other approach by creating one container and calling
start
/stop
multiple times also work?The text was updated successfully, but these errors were encountered: