Skip to content
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

Chrome fails at startup with Jenkins agent #36

Closed
hodossy opened this issue Sep 20, 2019 · 5 comments
Closed

Chrome fails at startup with Jenkins agent #36

hodossy opened this issue Sep 20, 2019 · 5 comments
Labels

Comments

@hodossy
Copy link

hodossy commented Sep 20, 2019

Describe the bug
I have a Jenkins with Kubernetes, and I would like to run a headless Chrome for unittesting (using Karma). I extended a Jenkins Agent image with alpine-chrome:with-node and use that in my agent pods. However karma is not able to start Chrome:

[0920/093525.387820:ERROR:zygote_host_impl_linux.cc(259)] Failed to adjust OOM score of renderer with pid 202: Permission denied (13)
[0920/093525.474421:ERROR:gpu_channel_manager.cc(398)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.

To Reproduce
Use this image:

FROM jenkins/jnlp-slave:alpine as jnlp

FROM alpine-chrome:with-node

USER root
RUN apk -U add openjdk8-jre

COPY --from=jnlp /usr/local/bin/jenkins-slave /usr/local/bin/jenkins-agent
COPY --from=jnlp /usr/share/jenkins/slave.jar /usr/share/jenkins/slave.jar

ENTRYPOINT ["/usr/local/bin/jenkins-agent"]

What is the expected behavior?
Karma able to start Chrome.

Logs

20 09 2019 09:35:24.438:INFO [launcher]: Starting browser Chrome

20 09 2019 09:35:32.813:ERROR [launcher]: Cannot start Chrome
[0920/093525.113146:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093525.387820:ERROR:zygote_host_impl_linux.cc(259)] Failed to adjust OOM score of renderer with pid 202: Permission denied (13)
[0920/093525.474421:ERROR:gpu_channel_manager.cc(398)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[0920/093525.505667:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093532.787035:ERROR:browser_process_sub_thread.cc(203)] Waited 1 ms for network service

20 09 2019 09:35:32.813:ERROR [launcher]: Chrome stdout: 
20 09 2019 09:35:32.813:ERROR [launcher]: Chrome stderr: [0920/093525.113146:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093525.387820:ERROR:zygote_host_impl_linux.cc(259)] Failed to adjust OOM score of renderer with pid 202: Permission denied (13)
[0920/093525.474421:ERROR:gpu_channel_manager.cc(398)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[0920/093525.505667:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093532.787035:ERROR:browser_process_sub_thread.cc(203)] Waited 1 ms for network service

20 09 2019 09:35:32.818:INFO [launcher]: Trying to start Chrome again (1/2).

20 09 2019 09:35:33.093:ERROR [launcher]: Cannot start Chrome
[0920/093532.949748:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093532.961242:ERROR:zygote_host_impl_linux.cc(259)] Failed to adjust OOM score of renderer with pid 248: Permission denied (13)
[0920/093533.004353:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093533.005844:ERROR:gpu_channel_manager.cc(398)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[0920/093533.076144:ERROR:browser_process_sub_thread.cc(203)] Waited 3 ms for network service

20 09 2019 09:35:33.093:ERROR [launcher]: Chrome stdout: 
20 09 2019 09:35:33.093:ERROR [launcher]: Chrome stderr: [0920/093532.949748:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093532.961242:ERROR:zygote_host_impl_linux.cc(259)] Failed to adjust OOM score of renderer with pid 248: Permission denied (13)
[0920/093533.004353:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093533.005844:ERROR:gpu_channel_manager.cc(398)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[0920/093533.076144:ERROR:browser_process_sub_thread.cc(203)] Waited 3 ms for network service

20 09 2019 09:35:33.096:INFO [launcher]: Trying to start Chrome again (2/2).

20 09 2019 09:35:33.373:ERROR [launcher]: Cannot start Chrome
[0920/093533.231075:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093533.244953:ERROR:zygote_host_impl_linux.cc(259)] Failed to adjust OOM score of renderer with pid 290: Permission denied (13)
[0920/093533.289019:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093533.289656:ERROR:gpu_channel_manager.cc(398)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[0920/093533.359067:ERROR:browser_process_sub_thread.cc(203)] Waited 3 ms for network service

20 09 2019 09:35:33.373:ERROR [launcher]: Chrome stdout: 
20 09 2019 09:35:33.373:ERROR [launcher]: Chrome stderr: [0920/093533.231075:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093533.244953:ERROR:zygote_host_impl_linux.cc(259)] Failed to adjust OOM score of renderer with pid 290: Permission denied (13)
[0920/093533.289019:WARNING:dns_config_service_posix.cc(340)] Failed to read DnsConfig.
[0920/093533.289656:ERROR:gpu_channel_manager.cc(398)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
[0920/093533.359067:ERROR:browser_process_sub_thread.cc(203)] Waited 3 ms for network service

20 09 2019 09:35:33.376:ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up.

Versions

Software Version(s) How-to
Chromium 76.0.3809.132 docker run -it --rm --entrypoint "" zenika/alpine-chrome chromium-browser --version
Image a449df36 docker image inspect --format='{{index .RepoDigests 0}}' zenika/alpine-chrome
Docker Engine 19.03.2 docker version

Additional context
I start Chrome with the following flags:
--headless, --no-sandbox, --disable-gpu, --disable-software-rasterizer, --disable-dev-shm-usage, --disable-web-security

@hodossy hodossy added the bug label Sep 20, 2019
@hodossy
Copy link
Author

hodossy commented Sep 24, 2019

I got it working without this image. I installed all dependencies of chromium listed here, and I also added chromium-chromedriver, and I removed the --disable-software-rasterizer, --disable-dev-shm-usage and --disable-web-security flags as well.

@hodossy hodossy closed this as completed Sep 24, 2019
@jlandure
Copy link
Owner

Hi @hodossy 👋
Thanks for your feedback. 👍

Can you explain a little the fixed problem to improve the sustainability of this image? 📝
Do you think this image is useful?
What's your usage of the image? for testing purpose? 🐛
Have a great day!

@sergei66666
Copy link

@hodossy Thank you.
Removing --disable-software-rasterizer help me to run Cef 76.1.13 (CefGlue) on linux.

@jlandure
Copy link
Owner

jlandure commented May 3, 2020

@all-contributors please add @hodossy for bug

@allcontributors
Copy link
Contributor

@jlandure

I've put up a pull request to add @hodossy! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants