apify-actor-docker icon indicating copy to clipboard operation
apify-actor-docker copied to clipboard

Failed to Launch Browser apify/actor-node-puppeteer-chrome

Open PeterPilley opened this issue 2 years ago • 4 comments

Using actor-node-puppeteer-chrome in Docker on a remote server.

When attempting to use await page.screenshot I get failed to launch browser process.

Googling around I can see it could be due to missing dependencies with the docker image.

I have tried changing versions of the docker image from 16 to 18 with no change

PeterPilley avatar May 22 '23 02:05 PeterPilley

Discovered this error in the process ERROR PuppeteerCrawler: Request failed and reached maximum retries. Error: Failed to launch the browser process! ap-auditor-workers | 2023-05-22T02:49:11.818867697Z [0522/024911.526188:FATAL:zygote_host_impl_linux.cc(127)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.

it is trying to setup an instance Starting X virtual framebuffer using: Xvfb :99 -ac -screen 0 1920x1080x24+32 -nolisten tcp

PeterPilley avatar May 22 '23 02:05 PeterPilley

Ok resolved this by following the instructions here https://github.com/puppeteer/puppeteer/issues/3451

The fix was to take the apify docker file add this USER root RUN echo 'kernel.unprivileged_userns_clone=1' > /etc/sysctl.d/userns.conf USER myuser # to return to the original user

then add in docker-compose.yml

cap: - SYS_ADMIN

PeterPilley avatar May 22 '23 03:05 PeterPilley

@vladfrangu please take a look at this

B4nan avatar May 22 '23 08:05 B4nan

this issue still happens today with docker

fcpauldiaz avatar Apr 16 '24 21:04 fcpauldiaz