-
-
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
InternalCommandPortListeningCheck not working when linux kernel lists ports as hexadecimal #749
Comments
Hi @stevewoodsdd, that was fixed long time ago in #524, please make sure you're using the latest version (1.7.3) |
Hi @bsideup, wow that was quick. Im using 'org.testcontainers:kafka:1.7.3' The port does not appear with cat /proc/net/tcp it need cat /proc/net/tcp6 |
@stevewoodsdd I see. Thanks for reporting! I'll take a look. Let me know if you want to contribute your awesome finding :) |
If you could add the fix that would be much appreciated. Thanks for maintaining such a powerful library. |
Thanks for reporting this Steve! 😀 |
Hi @stevewoodsdd, could you please try 1.8.0? |
Hi @bsideup, I have tried 1.8.0 this morning and unfortunately no luck. Looking at the fix the issue seems to be that tcp6 lists the IP and ports in hex. Hence the more elaborate suggestion: All the best, |
@stevewoodsdd could you please give an example of that tcp6 returns? |
@bsideup Sure no problem see attached: |
Hmm, I'm not sure about this. We already compensate for the fact that the port number will be expressed in hex in a /proc/net/tcp or /proc/net/tcp6 file. The It looks like your code would try and convert the actual port numbers into decimal, but would then still be grepping for the hex form. Could you try putting a breakpoint in Alternatively if this is running against a public image it would be interesting to have a direct look. BTW if debugging on Slack is easier we have https://slack.testcontainers.org. If as your username suggests, you're the Steve Woods I used to work with, then I'm also a guest user on your Slack team 😄 |
Kernel details:
Linux jenkins-v2 3.10.0-693.21.1.el7.x86_64 #1 SMP Fri Feb 23 18:54:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Command that should fix the issue:
{"/bin/sh", "-c", format("cat /proc/net/tcp6 | awk ‘{print $2}’ | awk --non-decimal-data -F: ‘{print (“0x”$2)+0}’ | grep -i %x && echo %s", internalPort, SUCCESS_MARKER)}
The text was updated successfully, but these errors were encountered: