-
Notifications
You must be signed in to change notification settings - Fork 56
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
Usage within Docker - "bind() failed: Cannot assign requested address (99)" #416
Comments
I was able to fix this by using a newer version of Chromium and Chromedriver. |
@chilliams can you maybe share a gist / small repo where you have this working, so I can check if it also works on my usecase (which is GitLab's CI)? I've just tried bumping my rules_webtesting dependency to 0.3.5 and to |
The root issue in my case was that chrome was crashing due to missing shared libraries. This line hints at the real error (the
If you run that binary directly: $ /root/.cache/[...]/chrome-linux/chrome --headless it may print out some errors like "libglib-2.0.so not found" which is the real reason Chrome is "crashing" (in fact it never starts). Rather than attempting to install all of these libraries one-by-one (and potentially having to install more libraries in future chromium releases), I found that the easiest way to get all of the missing shared libraries was just to install # The chromium binary used by rules_webtesting is not fully hermetic and
# depends on some shared libraries being available in the environment,
# so we install chromium-browser here just to install the shared libraries that it
# depends on.
RUN apt-get update && apt-get install -y chromium-browser This reliance on shared object files being installed on the host system means that |
Thanks @bduffany. The "install Independently of this issue: it would be nice if we could have those errors surfaced in the test logs if they happen. If the error messages just get printed to stderr, would be nice to have an option to pipe it into the test log, so it wouldn't be this hard to get to the bottom of it. I managed to get |
Hi.
I have a custom Docker image that I use to test my projects. Some of my tests use these web testing rules, and I'm having trouble running them in Docker.
Here's a simple example repo with my setup: https://gitlab.com/agentydragon/webtesting-docker-test
Here's what I'd like to be able do to within that repo:
docker build -t bazel-webtest-testrunner .
docker run -it \ --mount type=bind,source=$(pwd),target=/repo \ bazel-webtest-testrunner
The test I'm running in that repo is really simple, just loads http://python.org, tests there's "Python" in the title.
Issues I could fix
I've encountered the following issues that I've been able to fix. I'm not sure how fixable they are.
Missing urllib3
On my first try I got this backtrace:
I fixed that by
pip install
ingurllib3
in the Dockerfile.Missing libglib, libnss3
I got first this:
Then this:
I fixed that by installing
libglib2.0-0
,libnss3
in the Dockerfile.Issue I could not fix
When I run
bazel test //...
, I now get this log: https://pastebin.ubuntu.com/p/HcVPdKNFS4/Here's the relevant-looking part:
Overall, looks to me like Chromedriver crashes with
bind() failed: Cannot assign requested address (99)
.I've Googled for the error, and found some fixes which involved changing Chromedriver flags. Is there any easy way for me to pass additional flags to Chromedriver when using a
py_web_test_suite
? If there were, I could try those fixes I found.I found this promising-looking Stack Overflow question: https://stackoverflow.com/questions/55844788/how-to-fix-severe-bind-failed-cannot-assign-requested-address-99-while
There's 2 answers. One says it's due to IPv6, which might not be enabled in my Docker setup. I have not yet tried enabling IPv6 in my Docker host. The other answer says to pass
--whitelisted-ips=
to Chromedriver. Is there any way to do that when Chromedriver is launched bypy_web_test_suite
?Overall:
py_web_test_suite
? If yes, I can use that to try to resolve this on my own.The text was updated successfully, but these errors were encountered: